diff options
author | Martin Pool <mbp@samba.org> | 2002-03-20 06:57:03 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-03-20 06:57:03 +0000 |
commit | 098905bea29c7d5b886809d431294ddf2fc1e152 (patch) | |
tree | 5b99b8876978459673bfb690193365a51bc66d77 /source/web | |
parent | b1b7ae8bcfafc92c2d475908f4220f3f1ff941a1 (diff) | |
download | samba-098905bea29c7d5b886809d431294ddf2fc1e152.tar.gz samba-098905bea29c7d5b886809d431294ddf2fc1e152.tar.xz samba-098905bea29c7d5b886809d431294ddf2fc1e152.zip |
Add assertions that kill() is never accidentally passed a non-positive
pid. This follows a bug in rsync where it would accidentally
kill(-1), removing all the user's processes. I can't see any way this
would directly happen in Samba, but having the assertions seems
beneficial.
http://cvs.samba.org/cgi-bin/cvsweb/rsync/util.c.diff?r1=1.108&r2=1.109&f=h
Diffstat (limited to 'source/web')
-rw-r--r-- | source/web/startstop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/web/startstop.c b/source/web/startstop.c index 27ee7dd96e0..c56320c962b 100644 --- a/source/web/startstop.c +++ b/source/web/startstop.c @@ -75,7 +75,7 @@ void stop_smbd(void) if (geteuid() != 0) return; - if (pid == 0) return; + if (pid <= 0) return; kill(pid, SIGTERM); } @@ -87,7 +87,7 @@ void stop_nmbd(void) if (geteuid() != 0) return; - if (pid == 0) return; + if (pid <= 0) return; kill(pid, SIGTERM); } |