]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r22113: Fix core dump when configfile in same directory.
authorJeremy Allison <jra@samba.org>
Fri, 6 Apr 2007 22:08:44 +0000 (22:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:14 +0000 (12:19 -0500)
From Steven Danneman <steven.danneman@isilon.com>.
Jeremy.

source/lib/pidfile.c

index 49626acade570fcd9bef80bf8a5ea7be6eb58f6f..89ab6d799b7f332bfe3c2c18848a5ae4ed3b6f6f 100644 (file)
@@ -93,6 +93,13 @@ void pidfile_create(const char *program_name)
                strncpy( name, program_name, sizeof( name)-1);
        } else {
                short_configfile = strrchr( dyn_CONFIGFILE, '/');
+               if (short_configfile == NULL) {
+                       /* conf file in current directory */
+                       short_configfile = dyn_CONFIGFILE;
+               } else {
+                       /* full/relative path provided */
+                       short_configfile++;
+               }
                slprintf( name, sizeof( name)-1, "%s-%s", program_name, short_configfile+1);
        }