Forward port of 2.5 patch.
/*
- * $Id: cache_cf.cc,v 1.476 2005/06/26 18:51:20 serassio Exp $
+ * $Id: cache_cf.cc,v 1.477 2005/07/09 20:02:49 serassio Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
enter_suid();
}
+ configDoConfigure();
+
if (opt_send_signal == -1) {
- configDoConfigure();
cachemgrRegister("config",
"Current Squid Configuration",
dump_config,
path = pathbuf;
}
- if (stat(path, &sb) < 0)
- fatalf("%s %s: %s", name, path, xstrerror());
+ if (stat(path, &sb) < 0) {
+ if (opt_send_signal == -1 || opt_send_signal == SIGHUP)
+ fatalf("%s %s: %s", name, path, xstrerror());
+ else
+ fprintf(stderr, "WARNING: %s %s: %s\n", name, path, xstrerror());
+ }
}
char *
/*
- * $Id: globals.h,v 1.132 2005/05/01 08:11:48 serassio Exp $
+ * $Id: globals.h,v 1.133 2005/07/09 20:02:49 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern int ssl_ex_index_server; /* -1 */
extern int ssl_ctx_ex_index_dont_verify_domain; /* -1 */
-extern int opt_no_daemon; /* 0 */
extern const char *external_acl_message; /* NULL */
extern int opt_send_signal; /* -1 */
+extern int opt_no_daemon; /* 0 */
#endif /* SQUID_GLOBALS_H */
/*
- * $Id: main.cc,v 1.410 2005/04/30 19:32:01 serassio Exp $
+ * $Id: main.cc,v 1.411 2005/07/09 20:02:49 serassio Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
if (opt_send_signal != -1) {
/* chroot if configured to run inside chroot */
- if (Config.chroot_dir && chroot(Config.chroot_dir)) {
- fatal("failed to chroot");
+ if (Config.chroot_dir) {
+ if (chroot(Config.chroot_dir))
+ fatal("failed to chroot");
+
+ no_suid();
+ } else {
+ leave_suid();
}
sendSignal();
return 0;
#endif
+
}
static void
/* NOTREACHED */
#endif /* _SQUID_MSWIN_ */
+
}
static void
/*
- * $Id: tools.cc,v 1.256 2005/05/06 01:57:55 hno Exp $
+ * $Id: tools.cc,v 1.257 2005/07/09 20:02:49 serassio Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
return host;
}
- fatal("Could not determine fully qualified hostname. Please set 'visible_hostname'\n");
+ if (opt_send_signal == -1)
+ fatal("Could not determine fully qualified hostname. Please set 'visible_hostname'\n");
+ else
+ return ("localhost");
+
return NULL; /* keep compiler happy */
}