git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] daemon: Set up PATH properly on startup.

From
MWMark Wooding <mdw@distorted.org.uk>
Date
Feb 9, 2008, 11:17 UTC
Message-ID
<1202555873-8099-1-git-send-email-mdw@distorted.org.uk>

Since exec_cmd.c changed (511707d42b3b3e57d9623493092590546ffeae80) to just use the PATH variable for finding Git binaries, the daemon has been broken for people with picky inetds (such as the OpenBSD one) which launder the environment on startup. The result is that the daemon mysteriously fails to do anything useful.

One line fix: call setup_paths() in main before doing anything.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
---
 daemon.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
	I've not addressed the other problem with git-daemon which this
	bug brought to my attention, which is that it doesn't log any
	kind of error if it fails to exec.
diff --git a/daemon.c b/daemon.c
index 41a60af..cfd6124 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1149,6 +1149,7 @@ int main(int argc, char **argv)
 		usage(daemon_usage);
 	}
 
+	setup_path(NULL);
 	if (inetd_mode && (group_name || user_name))
 		die("--user and --group are incompatible with --inetd");
 
-- 
1.5.4.rc5.5.gab98-dirty
Next: Johannes Sixt
Message 1 of 3 in “daemon: Set up PATH properly on startup.”
  1. daemon: Set up PATH properly on startup.Mark Wooding, Feb 9, 2008
  2. Johannes SixtFeb 10, 2008
  3. Mark WoodingFeb 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.