The following commit has been merged in the sourcev3 branch:
commit 07c81f94aa64e9b6f148c5b5cb24461708feb2b5
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Fri Feb 15 20:41:38 2008 +0100

    Dpkg::IPC: avoid surprising execution via the shell
    
    * scripts/Dpkg/IPC.pm (fork_and_exec): If @prog only
    contains one entry exec() might execute it via the
    shell if it deems it necessary. This is not intended,
    so avoid this by giving $prog[0] explicetly as the
    program to execute.

diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm
index b3937cd..9c621f9 100644
--- a/scripts/Dpkg/IPC.pm
+++ b/scripts/Dpkg/IPC.pm
@@ -75,7 +75,7 @@ sub fork_and_exec {
        # Close some inherited filehandles
         close($_) foreach (@{$opts{"close_in_child"}});
        # Execute the program
-        exec(@prog) or syserr(_g("exec %s"), "@prog");
+       exec({ $prog[0] } @prog) or syserr(_g("exec %s"), "@prog");
     }
     # Close handle that we can't use any more
     close($opts{"from_handle"}) if exists $opts{"from_handle"};

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to