[Rt-devel] Patch review request: Incorrect evaluation of ACLS in mail gateway when no queue is specified

Dominic Hargreaves dominic.hargreaves at oucs.ox.ac.uk
Thu Jan 14 09:55:59 EST 2010


Hi,

I've just filed a bug at

http://rt3.fsck.com/Ticket/Display.html?id=14360

detailing a recent problem we've discovered following the upgrade
of one of our RT instances from RT2 to RT 3.8.7.

I've attached a patch which I've verified fixes the problem on our 
test system. I would appreciate if someone knowledgable in this area
of the RT code base could cast their eye over the patch to make sure
it makes sense before I deploy it on our production system (I am
slightly nervous since regressions introduced into the mail gateway
code is likely to be very visible to end users).

Cheers,
Dominic.

-- 
Dominic Hargreaves, Systems Development and Support Team
Computing Services, University of Oxford
-------------- next part --------------
diff -urN request-tracker3.8-3.8.7.orig/lib/RT/Interface/Email.pm request-tracker3.8-3.8.7/lib/RT/Interface/Email.pm
--- request-tracker3.8-3.8.7.orig/lib/RT/Interface/Email.pm	2009-12-11 17:27:20.000000000 +0000
+++ request-tracker3.8-3.8.7/lib/RT/Interface/Email.pm	2010-01-08 18:38:48.000000000 +0000
@@ -1247,7 +1247,7 @@
     my $argsref = shift;
     my %args    = (
         action  => 'correspond',
-        queue   => '1',
+        queue   => undef,
         ticket  => undef,
         message => undef,
         %$argsref
@@ -1264,7 +1264,7 @@
             "Invalid 'action' parameter "
                 . $actions[0]
                 . " for queue "
-                . $args{'queue'},
+                . defined $args{'queue'} ? $args{'queue'} : '<undefined>',
             undef
         );
     }
@@ -1365,12 +1365,16 @@
         $Right = 'CreateTicket';
     }
 
+    # If no queue is supplied, try and look up the ticket's queue
+    if ( $SystemTicket->id && !defined $args{'queue'} ) {
+        $args{'queue'} = $SystemTicket->QueueObj->id;
+    }
+
     #Set up a queue object
     my $SystemQueueObj = RT::Queue->new( $RT::SystemUser );
     $SystemQueueObj->Load( $args{'queue'} );
 
-    # We can safely have no queue of we have a known-good ticket
-    unless ( $SystemTicket->id || $SystemQueueObj->id ) {
+    unless ( $SystemQueueObj->id ) {
         return ( -75, "RT couldn't find the queue: " . $args{'queue'}, undef );
     }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20100114/1f4cb129/attachment.pgp 


More information about the Rt-devel mailing list