From: Amos Jeffries Date: Mon, 20 Jun 2016 12:50:59 +0000 (+1200) Subject: Bug 4532: pid_filename not working as documented X-Git-Tag: SQUID_4_0_12~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6e07b483683f2b08ab538404393350a18d94e1a;p=thirdparty%2Fsquid.git Bug 4532: pid_filename not working as documented --- diff --git a/src/cf_gen.cc b/src/cf_gen.cc index c0ba01a916..fcacff0d5f 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -478,11 +478,13 @@ gen_default(const EntryList &head, std::ostream &fout) fout << "static void" << std::endl << "default_line(const char *s)" << std::endl << "{" << std::endl << - " LOCAL_ARRAY(char, tmp_line, BUFSIZ);" << std::endl << - " xstrncpy(tmp_line, s, BUFSIZ);" << std::endl << - " xstrncpy(config_input_line, s, BUFSIZ);" << std::endl << + " int len = strlen(s) +1;" << std::endl << + " char *tmp_line = xstrndup(s, len);" << std::endl << + " ProcessMacros(tmp_line, len);" << std::endl << + " xstrncpy(config_input_line, tmp_line, len);" << std::endl << " config_lineno++;" << std::endl << " parse_line(tmp_line);" << std::endl << + " xfree(tmp_line);" << std::endl << "}" << std::endl << std::endl; fout << "static void" << std::endl << "default_all(void)" << std::endl << diff --git a/src/tools.cc b/src/tools.cc index c5c64b0032..5c6c9e43e7 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -718,6 +718,8 @@ writePidFile(void) mode_t old_umask; char buf[32]; + debugs(50, DBG_IMPORTANT, "creating PID file: " << Config.pidFilename); + if ((f = Config.pidFilename) == NULL) return; @@ -751,6 +753,7 @@ void removePidFile() { if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) { + debugs(50, DBG_IMPORTANT, "removing PID file: " << Config.pidFilename); enter_suid(); safeunlink(Config.pidFilename, 0); leave_suid();