mirror of
https://github.com/opnsense/src.git
synced 2026-02-09 22:06:55 -05:00
Serial murderers shouldn't commit suicide. (killall should
avoid killing itself.) PR: bin/46107 Submitted by: stacey <stacey_@starwhack.net>
This commit is contained in:
parent
7338182f91
commit
b4e148e9ff
1 changed files with 4 additions and 0 deletions
|
|
@ -118,6 +118,7 @@ main(int ac, char **av)
|
|||
int zflag = 0;
|
||||
uid_t uid = 0;
|
||||
dev_t tdev = 0;
|
||||
pid_t mypid;
|
||||
char thiscmd[MAXCOMLEN + 1];
|
||||
pid_t thispid;
|
||||
uid_t thisuid;
|
||||
|
|
@ -303,6 +304,7 @@ main(int ac, char **av)
|
|||
nprocs = size / sizeof(struct kinfo_proc);
|
||||
if (dflag)
|
||||
printf("nprocs %d\n", nprocs);
|
||||
mypid = getpid();
|
||||
|
||||
for (i = 0; i < nprocs; i++) {
|
||||
if ((procs[i].ki_stat & SZOMB) == SZOMB && !zflag)
|
||||
|
|
@ -313,6 +315,8 @@ main(int ac, char **av)
|
|||
thistdev = procs[i].ki_tdev;
|
||||
thisuid = procs[i].ki_ruid; /* real uid */
|
||||
|
||||
if (thispid == mypid)
|
||||
continue;
|
||||
matched = 1;
|
||||
if (user) {
|
||||
if (thisuid != uid)
|
||||
|
|
|
|||
Loading…
Reference in a new issue