The following patch adds a comment asking if effectiveUser is always set (ie.
I suspect this portion of code never executes after the change for non-root
execution made the other day), and removes a line that caused squid to crash out
if no chroot_dir was specified and it couldn't cd to the cache dir. Normally,
if squid can't cd to the first cache_dir, that would indicate something bad has
happened, but in this age of strange filesystems it's entirely possible that the
cache_dir cannot be chdir'ed into... Oh, I also made the log line the same as
the one above it.
I'd suspect that running and dumping core where-ever it's run from is vaguely
appropriate, but I'm not entirely sure, so a better patch may be called for ;)
KevinL
Index: main.c
===================================================================
RCS file: /cvsroot/squid/squid/src/main.c,v
retrieving revision 1.17
diff -u -r1.17 main.c
--- main.c 2001/01/12 08:20:33 1.17
+++ main.c 2001/01/29 12:40:33
@@ -430,6 +430,7 @@
debug(50, 0) ("chdir: %s: %s\n", Config.coredump_dir, xstrerror());
}
}
+ /* Is effectiveUser always set now? */
if (!Config.effectiveUser) {
char *p = getcwd(NULL, 0);
debug(0, 1) ("Current Directory is %s\n", p);
@@ -442,8 +443,7 @@
debug(0, 1) ("Set Current Directory to %s\n", storeSwapDir(0));
return;
} else {
- debug(50, 0) ("%s: %s\n", storeSwapDir(0), xstrerror());
- fatal_dump("Cannot cd to swap directory?");
+ debug(50, 0) ("chdir: %s: %s\n", storeSwapDir(0), xstrerror());
}
}
Received on Mon Jan 29 2001 - 05:45:39 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:26 MST