pidof was not returning PIDs of programs which were launched
using a symbolic link. (ie /tmp/sleep when /tmp/sleep links to /usr/bin/sleep). This is now fixed as we check both the realpath and symbolic path for processes. In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep.
This commit is contained in:
parent
86c5d7b93c
commit
b70b2776ed
@ -2,6 +2,11 @@ sysvinit (3.07) released; urgency=low
|
|||||||
* Fixed killall5 so that processes in the omit list are
|
* Fixed killall5 so that processes in the omit list are
|
||||||
not sent any signals, including SIGSTOP.
|
not sent any signals, including SIGSTOP.
|
||||||
* Fixed usage message for killall5 to be more accurate.
|
* Fixed usage message for killall5 to be more accurate.
|
||||||
|
* pidof was not returning PIDs of programs which were launched
|
||||||
|
using a symbolic link. (ie /tmp/sleep when /tmp/sleep links to /usr/bin/sleep).
|
||||||
|
This is now fixed as we check both the realpath and symbolic path for processes.
|
||||||
|
In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return
|
||||||
|
the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep.
|
||||||
|
|
||||||
|
|
||||||
sysvinit (3.06) released; urgency=low
|
sysvinit (3.06) released; urgency=low
|
||||||
|
@ -763,6 +763,11 @@ PIDQ_HEAD *pidof(char *prog)
|
|||||||
add_pid_to_q(q, p);
|
add_pid_to_q(q, p);
|
||||||
foundone++;
|
foundone++;
|
||||||
}
|
}
|
||||||
|
else if ( (p->argv0) && (! strcmp(p->argv0, prog) ) )
|
||||||
|
{
|
||||||
|
add_pid_to_q(q, p);
|
||||||
|
foundone++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,6 +831,7 @@ PIDQ_HEAD *pidof(char *prog)
|
|||||||
* as was done in earlier versions of this program, since this
|
* as was done in earlier versions of this program, since this
|
||||||
* allows /aaa/foo to match /bbb/foo .
|
* allows /aaa/foo to match /bbb/foo .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ok |=
|
ok |=
|
||||||
(p->argv0 && strcmp(p->argv0, prog) == 0)
|
(p->argv0 && strcmp(p->argv0, prog) == 0)
|
||||||
|| (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
|
|| (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user