tags 356686 + patch
thanks

Martin Michlmayr <[EMAIL PROTECTED]> writes:

> I got the following by email with sbuild 1.94 (I think this happened
> when I killed sbuild or something):
>
>> sh: -c: line 0: syntax error near unexpected token `('
>> sh: -c: line 0: `/usr/bin/sudo /usr/sbin/chroot 
>> /home/tbm/debian/build/chroot-unstable /usr/bin/sudo -u tbm -H /bin/sh -c 
>> 'perl -e 'kill( "TERM", 17059 )'''

It's a quoting issue when forking a new perl to kill child processes.
The attached patch fixes this.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
Index: sbuild
===================================================================
RCS file: /cvsroot/buildd-tools/sbuild/sbuild,v
retrieving revision 1.97
diff -u -r1.97 sbuild
--- sbuild	14 Mar 2006 10:03:39 -0000	1.97
+++ sbuild	14 Mar 2006 16:00:13 -0000
@@ -874,7 +874,7 @@
 	my(@timeout_times, @timeout_sigs, $last_time);
 	$SIG{'ALRM'} = sub {
 		my $signal = ($timed_out > 0) ? "KILL" : "TERM";
-		run_command("perl -e 'kill( $signal, $main::sub_pid )'", $main::username, 1, 0);
+		run_command("perl -e \"kill( \\\"$signal\\\", $main::sub_pid )\"", "root", 1, 0);
 		$timeout_times[$timed_out] = time - $last_time;
 		$timeout_sigs[$timed_out] = $signal;
 		$timed_out++;
@@ -3306,7 +3306,7 @@
 	# next: kill currently running command (if one)
 	if ($main::sub_pid) {
 		print "Killing $main::sub_task subprocess $main::sub_pid\n";
-		run_command("perl -e 'kill( \"TERM\", $main::sub_pid )'", $main::username, 1, 0);
+		run_command("perl -e \"kill( \\\"TERM\\\", $main::sub_pid )\"", "root", 1, 0);
 	}
 	remove_srcdep_lock_file();
 

Attachment: pgpL1Dvmnhh7I.pgp
Description: PGP signature

Reply via email to