diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-06 22:08:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:14 -0500 |
commit | b86758ebcc9d017594bf16041d4e83b6d8b27ff3 (patch) | |
tree | fbe2645b7bf64ad0dd6e504445c859817a8cfc80 | |
parent | 725fcf3461f7684554938c5571a5013408ff431c (diff) | |
download | samba-b86758ebcc9d017594bf16041d4e83b6d8b27ff3.tar.gz samba-b86758ebcc9d017594bf16041d4e83b6d8b27ff3.tar.bz2 samba-b86758ebcc9d017594bf16041d4e83b6d8b27ff3.zip |
r22113: Fix core dump when configfile in same directory.
From Steven Danneman <steven.danneman@isilon.com>.
Jeremy.
(This used to be commit 572c418b04eb1dbce8da7643fe7e236b06fce57b)
-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 49626acade..89ab6d799b 100644 --- a/source3/lib/pidfile.c +++ b/source3/lib/pidfile.c @@ -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); } |