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

[PATCH 2/2] Remember and use GIT_EXEC_PATH on exec()'s

From
MOMichal Ostrowski <mostrows@watson.ibm.com>
Date
Jan 9, 2006, 23:36 UTC
Message-ID
<1136849810.11717.518.camel@brick.watson.ibm.com>
In-Reply-To
<1136849678.11717.514.camel@brick.watson.ibm.com>

Calls to git_setup_exec_path() are inserted on paths that will execute other git programs. git_setup_exec_path() will ensure that the git installation directories are in the path.

Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
---
 daemon.c      |    2 ++
 fetch-clone.c |    2 ++
 run-command.c |    1 +
 send-pack.c   |    2 ++
 upload-pack.c |    4 +++-
 5 files changed, 10 insertions(+), 1 deletions(-)
bb14b4b61f53f755486695e5bdc45b5623a6f8c5
diff --git a/daemon.c b/daemon.c
index 3bd1426..d653f33 100644
--- a/daemon.c
+++ b/daemon.c
@@ -226,6 +226,8 @@ static int upload(char *dir)
 
 	snprintf(timeout_buf, sizeof timeout_buf, "--timeout=%u", timeout);
 
+	git_setup_exec_path();
+
 	/* git-upload-pack only ever reads stuff, so this is safe */
 	execlp("git-upload-pack", "git-upload-pack", "--strict", timeout_buf,
".", NULL);
 	return -1;
diff --git a/fetch-clone.c b/fetch-clone.c
index f46fe6e..afbbb79 100644
--- a/fetch-clone.c
+++ b/fetch-clone.c
@@ -98,6 +98,8 @@ int receive_unpack_pack(int fd[2], const
 	int status;
 	pid_t pid;
 
+	git_setup_exec_path();
+
 	pid = fork();
 	if (pid < 0)
 		die("%s: unable to fork off git-unpack-objects", me);
diff --git a/run-command.c b/run-command.c
index 8bf5922..993a3f9 100644
--- a/run-command.c
+++ b/run-command.c
@@ -9,6 +9,7 @@ int run_command_v_opt(int argc, char **a
 	if (pid < 0)
 		return -ERR_RUN_COMMAND_FORK;
 	if (!pid) {
+		git_setup_exec_path();
 		if (flags & RUN_COMMAND_NO_STDIO) {
 			int fd = open("/dev/null", O_RDWR);
 			dup2(fd, 0);
diff --git a/send-pack.c b/send-pack.c
index cd36193..a241f00 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -30,6 +30,7 @@ static void exec_pack_objects(void)
 		"--stdout",
 		NULL
 	};
+	git_setup_exec_path();
 	execvp("git-pack-objects", args);
 	die("git-pack-objects exec failed (%s)", strerror(errno));
 }
@@ -58,6 +59,7 @@ static void exec_rev_list(struct ref *re
 		refs = refs->next;
 	}
 	args[i] = NULL;
+	git_setup_exec_path();
 	execvp("git-rev-list", args);
 	die("git-rev-list exec failed (%s)", strerror(errno));
 }
diff --git a/upload-pack.c b/upload-pack.c
index 1834b6b..f8d4fbe 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -270,7 +270,9 @@ int main(int argc, char **argv)
 			break;
 		}
 	}
-	
+
+	git_setup_exec_path();
+
 	if (i != argc-1)
 		usage(upload_pack_usage);
 	dir = argv[i];
-- 
0.99.9m-g02ad
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 33 in “Remember and use GIT_EXEC_PATH on exec()'s”
  1. 0/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  2. 1/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  3. Junio C HamanoJan 10, 2006
  4. 2/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  5. Junio C HamanoJan 10, 2006
  6. Michal OstrowskiJan 10, 2006
  7. Andreas EricssonJan 10, 2006
  8. Michal OstrowskiJan 10, 2006
  9. Andreas EricssonJan 10, 2006
  10. Alex RiesenJan 10, 2006
  11. Michal OstrowskiJan 10, 2006
  12. Junio C HamanoJan 10, 2006
  13. Johannes SchindelinJan 10, 2006
  14. Michal OstrowskiJan 10, 2006
  15. Johannes SchindelinJan 10, 2006
  16. Andreas EricssonJan 11, 2006
  17. Junio C HamanoJan 11, 2006
  18. Andreas EricssonJan 11, 2006
  19. Jon LoeligerJan 11, 2006
  20. Junio C HamanoJan 10, 2006
  21. Michal OstrowskiJan 10, 2006
  22. Andreas EricssonJan 11, 2006
  23. Junio C HamanoJan 11, 2006
  24. Michal OstrowskiJan 11, 2006
  25. Exec git programs without using PATH.Michal Ostrowski, Jan 11, 2006
  26. Junio C HamanoJan 11, 2006
  27. (Updated) Exec git programs without using PATH.Michal Ostrowski, Jan 11, 2006
  28. Junio C HamanoJan 11, 2006
  29. Linus TorvaldsJan 11, 2006
  30. Michal OstrowskiJan 11, 2006
  31. Junio C HamanoJan 11, 2006
  32. Andreas EricssonJan 12, 2006
  33. H. Peter AnvinJan 12, 2006

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.