From 75722fa183d1678bc7360bc79f9ac8cf17cd62e3 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 20 Mar 2002 06:57:03 +0000 Subject: 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 (This used to be commit 098905bea29c7d5b886809d431294ddf2fc1e152) --- source3/web/startstop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/web') diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 27ee7dd96e..c56320c962 100644 --- a/source3/web/startstop.c +++ b/source3/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); } -- cgit