{"thread":{"id":"17971","subject":"[PATCH] Install builtins with the user and group of the installing personality","startedAt":"2009-02-23T15:50:42Z","lastAt":"2009-02-25T09:54:02Z","messageCount":4,"participants":["Gerrit Pape","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"105907","messageId":"20090223155042.14806.qmail@518da7eef5d9e4.315fe32.mid.smarden.org","threadId":"17971","inReplyTo":null,"subject":"[PATCH] Install builtins with the user and group of the installing personality","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2009-02-23T15:50:42Z","receivedAt":"2009-02-23T15:50:42Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"If 'make install' was run with sufficient privileges, then the installed\nbuiltins in gitexecdir, which are either hardlinked, symlinked, or copied,\nwould receive the user and group of whoever built git.  With this commit the\ngit-add program is installed using $(INSTALL), and subsequently linked or\ncopied to the other builtins.\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n Makefile |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b040a96..7401603 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1467,9 +1467,7 @@ ifneq (,$X)\n endif\n \tbindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \\\n \texecdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \\\n-\t{ $(RM) \"$$execdir/git-add$X\" && \\\n-\t\tln git-add$X \"$$execdir/git-add$X\" 2>/dev/null || \\\n-\t\tcp git-add$X \"$$execdir/git-add$X\"; } && \\\n+\t$(INSTALL) git-add$X \"$$execdir\" && \\\n \t{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-add$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n-- \n1.6.1.3\n"},{"id":"105920","messageId":"49A2D644.6040106@viscovery.net","threadId":"17971","inReplyTo":"20090223155042.14806.qmail@518da7eef5d9e4.315fe32.mid.smarden.org","subject":"Re: [PATCH] Install builtins with the user and group of the installing personality","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-02-23T17:00:52Z","receivedAt":"2009-02-23T17:00:52Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Gerrit Pape schrieb:\n> If 'make install' was run with sufficient privileges, then the installed\n> builtins in gitexecdir, which are either hardlinked, symlinked, or copied,\n> would receive the user and group of whoever built git.  With this commit the\n> git-add program is installed using $(INSTALL), and subsequently linked or\n> copied to the other builtins.\n> \n> Signed-off-by: Gerrit Pape <pape@smarden.org>\n> ---\n>  Makefile |    4 +---\n>  1 files changed, 1 insertions(+), 3 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index b040a96..7401603 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1467,9 +1467,7 @@ ifneq (,$X)\n>  endif\n>  \tbindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \\\n>  \texecdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \\\n> -\t{ $(RM) \"$$execdir/git-add$X\" && \\\n> -\t\tln git-add$X \"$$execdir/git-add$X\" 2>/dev/null || \\\n> -\t\tcp git-add$X \"$$execdir/git-add$X\"; } && \\\n> +\t$(INSTALL) git-add$X \"$$execdir\" && \\\n>  \t{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \\\n>  \t\t$(RM) \"$$execdir/$$p\" && \\\n>  \t\tln \"$$execdir/git-add$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n\nI think the intent of the lines that you removed was actually this:\n\ndiff --git a/Makefile b/Makefile\nindex 27b9569..97087c3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1471,8 +1471,8 @@ endif\n \tbindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \\\n \texecdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \\\n \t{ $(RM) \"$$execdir/git-add$X\" && \\\n-\t\tln git-add$X \"$$execdir/git-add$X\" 2>/dev/null || \\\n-\t\tcp git-add$X \"$$execdir/git-add$X\"; } && \\\n+\t\tln \"$$bindir/git$X\" \"$$execdir/git-add$X\" 2>/dev/null || \\\n+\t\tcp \"$$bindir/git$X\" \"$$execdir/git-add$X\"; } && \\\n \t{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-add$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n\n-- Hannes\n"},{"id":"106003","messageId":"20090224085817.16736.qmail@86bc3118539950.315fe32.mid.smarden.org","threadId":"17971","inReplyTo":"49A2D644.6040106@viscovery.net","subject":"[PATCH] Install builtins with the user and group of the installing personality","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2009-02-24T08:58:16Z","receivedAt":"2009-02-24T08:58:16Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"If 'make install' was run with sufficient privileges, then the installed\nbuiltins in gitexecdir, which are either hardlinked, symlinked, or copied,\nwould receive the user and group of whoever built git.  With this commit\nthe initial hardlink or copy is done from the installation tree and not\nthe build tree to fix this.\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n\nThanks, Johannes.\n\n\n Makefile |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b040a96..0675c43 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1468,8 +1468,8 @@ endif\n \tbindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \\\n \texecdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \\\n \t{ $(RM) \"$$execdir/git-add$X\" && \\\n-\t\tln git-add$X \"$$execdir/git-add$X\" 2>/dev/null || \\\n-\t\tcp git-add$X \"$$execdir/git-add$X\"; } && \\\n+\t\tln \"$$bindir/git$X\" \"$$execdir/git-add$X\" 2>/dev/null || \\\n+\t\tcp \"$$bindir/git$X\" \"$$execdir/git-add$X\"; } && \\\n \t{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-add$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n-- \n1.6.1.3\n"},{"id":"106189","messageId":"7vmyca6dvp.fsf@gitster.siamese.dyndns.org","threadId":"17971","inReplyTo":"20090224085817.16736.qmail@86bc3118539950.315fe32.mid.smarden.org","subject":"Re: [PATCH] Install builtins with the user and group of the installing personality","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-25T09:54:02Z","receivedAt":"2009-02-25T09:54:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, both.\n"}]}