* [PATCH] Install builtins with the user and group of the installing personality
@ 2009-02-23 15:50 Gerrit Pape
2009-02-23 17:00 ` Johannes Sixt
0 siblings, 1 reply; 4+ messages in thread
From: Gerrit Pape @ 2009-02-23 15:50 UTC (permalink / raw)
To: Junio C Hamano, git
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 <pape@smarden.org>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Install builtins with the user and group of the installing personality
2009-02-23 15:50 [PATCH] Install builtins with the user and group of the installing personality Gerrit Pape
@ 2009-02-23 17:00 ` Johannes Sixt
2009-02-24 8:58 ` Gerrit Pape
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2009-02-23 17:00 UTC (permalink / raw)
To: Gerrit Pape; +Cc: Junio C Hamano, git
Gerrit Pape schrieb:
> 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 <pape@smarden.org>
> ---
> 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 || \
I think the intent of the lines that you removed was actually this:
diff --git a/Makefile b/Makefile
index 27b9569..97087c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1471,8 +1471,8 @@ 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"; } && \
+ ln "$$bindir/git$X" "$$execdir/git-add$X" 2>/dev/null || \
+ cp "$$bindir/git$X" "$$execdir/git-add$X"; } && \
{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \
$(RM) "$$execdir/$$p" && \
ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \
-- Hannes
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] Install builtins with the user and group of the installing personality
2009-02-23 17:00 ` Johannes Sixt
@ 2009-02-24 8:58 ` Gerrit Pape
2009-02-25 9:54 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Gerrit Pape @ 2009-02-24 8:58 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, git
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 initial hardlink or copy is done from the installation tree and not
the build tree to fix this.
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
Thanks, Johannes.
Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b040a96..0675c43 100644
--- a/Makefile
+++ b/Makefile
@@ -1468,8 +1468,8 @@ 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"; } && \
+ ln "$$bindir/git$X" "$$execdir/git-add$X" 2>/dev/null || \
+ cp "$$bindir/git$X" "$$execdir/git-add$X"; } && \
{ 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Install builtins with the user and group of the installing personality
2009-02-24 8:58 ` Gerrit Pape
@ 2009-02-25 9:54 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2009-02-25 9:54 UTC (permalink / raw)
To: Gerrit Pape; +Cc: Johannes Sixt, git
Thanks, both.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-25 9:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 15:50 [PATCH] Install builtins with the user and group of the installing personality Gerrit Pape
2009-02-23 17:00 ` Johannes Sixt
2009-02-24 8:58 ` Gerrit Pape
2009-02-25 9:54 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).