r2023: If there's garbage in the pidfile, we should not panic but assume that no one
authorVolker Lendecke <vlendec@samba.org>
Tue, 24 Aug 2004 20:58:12 +0000 (20:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:28 +0000 (10:52 -0500)
else is around. We can't find the other guy anyway.

Volker
(This used to be commit bf8773b094d41941478f0164ce33838027fadc09)

source3/lib/pidfile.c

index 1a462bf12876a53db13d47ba69945728bf774274..20a8e82ce23e48df499a72e329dfdae365010ddb 100644 (file)
@@ -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;