]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4532: pid_filename not working as documented
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 20 Jun 2016 12:50:59 +0000 (00:50 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 20 Jun 2016 12:50:59 +0000 (00:50 +1200)
src/cf_gen.cc
src/tools.cc

index c0ba01a9169e0fbf51e2d45edb4d43ffe057ab61..fcacff0d5f297b5f3e6a710c3ba7abf7165f60e2 100644 (file)
@@ -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 <<
index c5c64b0032dbc4bfdf6ace53a2c58243f347b362..5c6c9e43e76278ed3306ec5634d64d7e8bae415e 100644 (file)
@@ -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();