From 1d290eea1eab1e1698401cba788d733f450ac55d Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Fri, 1 Jun 2012 15:33:04 -0700 Subject: [PATCH] s3-winbindd: call dump_core_setup after command line option has been parsed Without this fix in some situations winbindd can't coredump. Such cases append when samba is compiled in a custom prefix (ie. /home/build/mat/prod/1/) in this case get_dyn_LOGFILEBASE or basename(lp_logfile) before the configuration file and the command line is parsed will be something like /home/build/mat/prod/1/var which might not exists on the host where you run it (where it's most probably more "normal" directories). Specifying --log-basename didn't help as dump_core_setup is called before the command line and the config file is read so it didn't help getting a correct value in dump_core_setup. We fix this issue by calling dump_core_setup() also after the command line has been read and also after the configfile has been parsed so that the final location for the coredump is coherent with the final logile location. --- source3/winbindd/winbindd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 034e43b..0baadbb 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1072,6 +1072,7 @@ int main(int argc, char **argv, char **envp) } } + dump_core_setup("winbindd"); if (is_daemon && interactive) { d_fprintf(stderr,"\nERROR: " "Option -i|--interactive is not allowed together with -D|--daemon\n\n"); @@ -1106,6 +1107,7 @@ int main(int argc, char **argv, char **envp) DEBUG(0, ("error opening config file\n")); exit(1); } + dump_core_setup("winbindd"); /* Initialise messaging system */ -- 1.7.9.5