diff options
author | Volker Lendecke <vlendec@samba.org> | 2004-08-24 20:58:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:28 -0500 |
commit | 990d9d15db27f47d2a6cac306ab773d42427ade4 (patch) | |
tree | 855452388dc9e5fab620ef7fdd2ef32079e328f6 /source3 | |
parent | c542a2c17956c9e9e49d2aecdb8fd06f589bb8c9 (diff) | |
download | samba-990d9d15db27f47d2a6cac306ab773d42427ade4.tar.gz samba-990d9d15db27f47d2a6cac306ab773d42427ade4.tar.bz2 samba-990d9d15db27f47d2a6cac306ab773d42427ade4.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
(This used to be commit bf8773b094d41941478f0164ce33838027fadc09)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/pidfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c index 1a462bf128..20a8e82ce2 100644 --- a/source3/lib/pidfile.c +++ b/source3/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; |