1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

source4/smbd/pidfile: don't panic if pid file is corrupt.

In particular, on a virtual machine after a forced reboot, it
contained "Ille" instead of a valid PID.  Given it was the right
length, I'm assuming it was filesystem corruption.

process_exists_by_pid() then panics, when given a pid < 1.

Reported-by: lostogre on #samba-technical
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Thu Jun 28 05:19:24 CEST 2012 on sn-devel-104
This commit is contained in:
Rusty Russell 2012-06-28 11:04:25 +09:30
parent 0a1aaca1bd
commit f80e399ab2

View File

@ -57,6 +57,9 @@ pid_t pidfile_pid(const char *piddir, const char *name)
}
ret = (pid_t)atoi(pidstr);
if (ret <= 0) {
goto noproc;
}
if (!process_exists_by_pid(ret)) {
goto noproc;