Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15
STALE3729d

[PATCH] Install builtins with the user and group of the installing personality

From: Gerrit Pape <hidden>
Date: 2016-06-15 22:46:16
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

If 'make install' was run with sufficient privileges, then the installed
builtins in gitexecdir, which are either hardlinked, symlinked, or copied,
would receive the user and group of whoever built git.  With this commit the
git-add program is installed using $(INSTALL), and subsequently linked or
copied to the other builtins.

Signed-off-by: Gerrit Pape <redacted>
---
 Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index b040a96..7401603 100644
--- a/Makefile
+++ b/Makefile
@@ -1467,9 +1467,7 @@ ifneq (,$X)
 endif
 	bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
 	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
-	{ $(RM) "$$execdir/git-add$X" && \
-		ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
-		cp git-add$X "$$execdir/git-add$X"; } && \
+	$(INSTALL) git-add$X "$$execdir" && \
 	{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \
 		$(RM) "$$execdir/$$p" && \
 		ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \
-- 
1.6.1.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help