bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kill builtin incorrectly works with -s -n and -PGID options


From: Roman Rakus
Subject: kill builtin incorrectly works with -s -n and -PGID options
Date: Fri, 11 Dec 2009 14:08:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

kill builtin incorrectly thinks that -PGID is signal name even if the signal name is set by -s or -n option.

Reproducer:
[rrakus@dhcp-lab-170 ~]$ sleep 1d | sleep 2d | sleep 3d &
[1] 5034
[rrakus@dhcp-lab-170 ~]$ ps -j
  PID  PGID   SID TTY          TIME CMD
 4863  4863  4863 pts/2    00:00:00 bash
 5032  5032  4863 pts/2    00:00:00 sleep
 5033  5032  4863 pts/2    00:00:00 sleep
 5034  5032  4863 pts/2    00:00:00 sleep
 5035  5035  4863 pts/2    00:00:00 ps
[rrakus@dhcp-lab-170 ~]$ kill -s TERM -5032
bash: kill: 5032: invalid signal specification

Patch:
diff -up bash-4.0/builtins/kill.def.pgid bash-4.0/builtins/kill.def
--- bash-4.0/builtins/kill.def.pgid    2009-12-11 13:56:26.000000000 +0100
+++ bash-4.0/builtins/kill.def    2009-12-11 13:58:04.000000000 +0100
@@ -121,6 +121,7 @@ kill_builtin (list)
           else
         sig = decode_signal (sigspec, dflags);
           list = list->next;
+          saw_signal++;
         }
       else
         {

RR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]