summaryrefslogtreecommitdiffstats
path: root/source/lib/pidfile.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-08-24 20:58:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:28 -0500
commitbf8773b094d41941478f0164ce33838027fadc09 (patch)
tree1af821ee4fc950d63340e7bfa5c0a2d9f5a52ed3 /source/lib/pidfile.c
parent43af9e67dd7c0328f214def4b591041e9b69614a (diff)
downloadsamba-bf8773b094d41941478f0164ce33838027fadc09.tar.gz
samba-bf8773b094d41941478f0164ce33838027fadc09.tar.xz
samba-bf8773b094d41941478f0164ce33838027fadc09.zip
r2023: If there's garbage in the pidfile, we should not panic but assume that no one
else is around. We can't find the other guy anyway. Volker
Diffstat (limited to 'source/lib/pidfile.c')
-rw-r--r--source/lib/pidfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/lib/pidfile.c b/source/lib/pidfile.c
index 1a462bf1287..20a8e82ce23 100644
--- a/source/lib/pidfile.c
+++ b/source/lib/pidfile.c
@@ -49,6 +49,13 @@ pid_t pidfile_pid(const char *name)
}
ret = atoi(pidstr);
+
+ if (ret == 0) {
+ /* Obviously we had some garbage in the pidfile... */
+ DEBUG(1, ("Could not parse contents of pidfile %s\n",
+ pidFile));
+ goto noproc;
+ }
if (!process_exists((pid_t)ret)) {
goto noproc;