{"thread":{"id":"54209","subject":"permissions of main folder for git-manpages.tar.gz","startedAt":"2020-09-08T18:04:13Z","lastAt":"2020-09-09T19:07:25Z","messageCount":5,"participants":["Daniel Villeneuve","Junio C Hamano","Carlo Marcelo Arenas Belón"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"405167","messageId":"cc8487b0-c23f-46c3-b8c3-e3188b7c0d0e@gmail.com","threadId":"54209","inReplyTo":null,"subject":"permissions of main folder for git-manpages.tar.gz","fromName":"Daniel Villeneuve","fromEmail":"dvilleneuve.4142@gmail.com","sentAt":"2020-09-08T15:56:47Z","receivedAt":"2020-09-08T18:04:13Z","isPatch":false,"sender":{"key":"dvilleneuve.4142@gmail.com","avatar":null},"body":"Hi,\n\nI am using https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.28.0.tar.gz to get the manpages part of git.\n\nThere has been a change in the permissions of the top-level folder, from 2.22 (perms 2750) to 2.25 (perms 0700) to 2.28 (perms 2700).\nHowever, the permissions of other files/directories allow group/others read/execute, as before.\n\nThis change broke my latest installations by preventing group members to see manpages (I did a chmod to fix that).\n\nJust sharing this observation, in case the change was not intentional.\n--\nDaniel Villeneuve\n\n"},{"id":"405214","messageId":"xmqq7dt3x134.fsf@gitster.c.googlers.com","threadId":"54209","inReplyTo":"cc8487b0-c23f-46c3-b8c3-e3188b7c0d0e@gmail.com","subject":"Re: permissions of main folder for git-manpages.tar.gz","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-09T00:09:35Z","receivedAt":"2020-09-09T00:09:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Villeneuve <dvilleneuve.4142@gmail.com> writes:\n\n> I am using\n> https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.28.0.tar.gz\n> to get the manpages part of git.\n>\n> There has been a change in the permissions of the top-level\n> folder, from 2.22 (perms 2750) to 2.25 (perms 0700) to 2.28 (perms\n> 2700).  However, the permissions of other files/directories allow\n> group/others read/execute, as before.\n>\n> This change broke my latest installations by preventing group\n> members to see manpages (I did a chmod to fix that).\n>\n> Just sharing this observation, in case the change was not\n> intentional.\n\nThanks for letting me know.  \n\nThe build procedure of these documentation tarballs pretty much just\nsnapshots how I personally have these files locally and not\nsomething that was carefully designed to produce files for public\nconsumption.\n\nI'm contemplating to apply something like the following patch to the\nbuild procedure so that I can externally control the mode bits\nrecorded in the tarball by setting TAR_C_EXTRA_OPTS to options that\noverrides mode bits and stuff (it takes GNU tar unfortunately, but\nI suspect I am the only person that runs dist-doc target anyway)\n\n Makefile | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 86e5411f39..2a8510f6e6 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3041,6 +3041,7 @@ artifacts-tar:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) \\\n \t$(TAR) czf \"$(ARTIFACTS_DIRECTORY)/artifacts.tar.gz\" $^ templates/blt/\n .PHONY: artifacts-tar\n \n+TAR_C_EXTRA_OPTS =\n htmldocs = git-htmldocs-$(GIT_VERSION)\n manpages = git-manpages-$(GIT_VERSION)\n .PHONY: dist-doc distclean\n@@ -3048,7 +3049,7 @@ dist-doc:\n \t$(RM) -r .doc-tmp-dir\n \tmkdir .doc-tmp-dir\n \t$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc\n-\tcd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .\n+\tcd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar $(TAR_C_EXTRA_OPTS) .\n \tgzip -n -9 -f $(htmldocs).tar\n \t:\n \t$(RM) -r .doc-tmp-dir\n@@ -3058,7 +3059,7 @@ dist-doc:\n \t\tman5dir=../.doc-tmp-dir/man5 \\\n \t\tman7dir=../.doc-tmp-dir/man7 \\\n \t\tinstall\n-\tcd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .\n+\tcd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar $(TAR_C_EXTRA_OPTS) .\n \tgzip -n -9 -f $(manpages).tar\n \t$(RM) -r .doc-tmp-dir\n \n\n"},{"id":"405226","messageId":"20200909032838.GA59978@Carlos-MBP","threadId":"54209","inReplyTo":"xmqq7dt3x134.fsf@gitster.c.googlers.com","subject":"Re: permissions of main folder for git-manpages.tar.gz","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2020-09-09T03:28:38Z","receivedAt":"2020-09-09T03:28:49Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Tue, Sep 08, 2020 at 05:09:35PM -0700, Junio C Hamano wrote:\n> \n> I'm contemplating to apply something like the following patch to the\n> build procedure so that I can externally control the mode bits\n> recorded in the tarball by setting TAR_C_EXTRA_OPTS to options that\n> overrides mode bits and stuff (it takes GNU tar unfortunately, but\n> I suspect I am the only person that runs dist-doc target anyway)\n\nalso useful (albeit not for the same reason) with BSD tar for adding\nthings like \"--check-links\", either way don't forget the signed-off\nwhile adding:\n\n  Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n\nCarlo\n"},{"id":"405266","messageId":"xmqq363qx1mq.fsf@gitster.c.googlers.com","threadId":"54209","inReplyTo":"20200909032838.GA59978@Carlos-MBP","subject":"Re: permissions of main folder for git-manpages.tar.gz","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-09T18:10:05Z","receivedAt":"2020-09-09T18:10:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:\n\n> On Tue, Sep 08, 2020 at 05:09:35PM -0700, Junio C Hamano wrote:\n>> \n>> I'm contemplating to apply something like the following patch to the\n>> build procedure so that I can externally control the mode bits\n>> recorded in the tarball by setting TAR_C_EXTRA_OPTS to options that\n>> overrides mode bits and stuff (it takes GNU tar unfortunately, but\n>> I suspect I am the only person that runs dist-doc target anyway)\n>\n> also useful (albeit not for the same reason) with BSD tar for adding\n> things like \"--check-links\", either way don't forget the signed-off\n> while adding:\n>\n>   Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n\nThanks.  I haven't even written a proposed log message yet, but I'll\nremember.\n"},{"id":"405271","messageId":"xmqqimcmvkf3.fsf@gitster.c.googlers.com","threadId":"54209","inReplyTo":"20200909032838.GA59978@Carlos-MBP","subject":"Re: permissions of main folder for git-manpages.tar.gz","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-09T19:07:12Z","receivedAt":"2020-09-09T19:07:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:\n\n> On Tue, Sep 08, 2020 at 05:09:35PM -0700, Junio C Hamano wrote:\n>> \n>> I'm contemplating to apply something like the following patch to the\n>> build procedure so that I can externally control the mode bits\n>> recorded in the tarball by setting TAR_C_EXTRA_OPTS to options that\n>> overrides mode bits and stuff (it takes GNU tar unfortunately, but\n>> I suspect I am the only person that runs dist-doc target anyway)\n>\n> also useful (albeit not for the same reason) with BSD tar for adding\n> things like \"--check-links\", either way don't forget the signed-off\n> while adding:\n>\n>   Tested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n\nI just realized that we should do the same for the soure release\ntarball, not just preformatted documentation tarballs that are not\nreally sources.\n\nThe use of the 'c' mode with 'tar' is an implementation detail of\ndoing a 'distribution'; TAR_C_EXTRA_OPTS in the draft version was\nrenamed to TAR_DIST_EXTRA_OPTS to make it more clear that this is\nfor use with $(TAR) for dist targets.\n\nThanks.\n\n-- >8 --\nFrom: Junio C Hamano <gitster@pobox.com>\nDate: Wed, 9 Sep 2020 11:53:04 -0700\nSubject: [PATCH] Makefile: allow extra tweaking of distribution tarball\n\nThe maintainer's dist rules are used to produce distribution\ntarballs.  They use \"$(TAR) cf\" and \"$(TAR) rf\" to produce archives\nout of a freshly created local installation area, which means that\nthe built product can be affected by maintainer's umask and other\nlocal environment.\n\nImplementations of \"tar\" have ways (implementation specific,\nunfortunately) to force permission bits and other stuff to allow the\nuser to hide these effects coming from the local environment.  Teach\nour Makefile to allow the maintainer to tweak the invocation of the\n$(TAR) commands by setting TAR_DIST_EXTRA_OPTS.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 86e5411f39..62e8bfcf6e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2992,6 +2992,9 @@ quick-install-html:\n \n ### Maintainer's dist rules\n \n+# Allow tweaking to hide local environment effects, like perm bits.\n+# With GNU tar, \"--mode=u+rwX,og+rX,og-w\" would be a good idea, for example.\n+TAR_DIST_EXTRA_OPTS =\n GIT_TARNAME = git-$(GIT_VERSION)\n dist: git-archive$(X) configure\n \t./git-archive --format=tar \\\n@@ -3000,7 +3003,7 @@ dist: git-archive$(X) configure\n \t@cp configure $(GIT_TARNAME)\n \t@echo $(GIT_VERSION) > $(GIT_TARNAME)/version\n \t@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version\n-\t$(TAR) rf $(GIT_TARNAME).tar \\\n+\t$(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \\\n \t\t$(GIT_TARNAME)/configure \\\n \t\t$(GIT_TARNAME)/version \\\n \t\t$(GIT_TARNAME)/git-gui/version\n@@ -3014,7 +3017,7 @@ ifdef DC_SHA1_SUBMODULE\n \t\t$(GIT_TARNAME)/sha1collisiondetection/lib/\n \t@cp sha1collisiondetection/lib/ubc_check.[ch] \\\n \t\t$(GIT_TARNAME)/sha1collisiondetection/lib/\n-\t$(TAR) rf $(GIT_TARNAME).tar \\\n+\t$(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \\\n \t\t$(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \\\n \t\t$(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \\\n \t\t$(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch]\n@@ -3048,7 +3051,7 @@ dist-doc:\n \t$(RM) -r .doc-tmp-dir\n \tmkdir .doc-tmp-dir\n \t$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc\n-\tcd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .\n+\tcd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar $(TAR_DIST_EXTRA_OPTS) .\n \tgzip -n -9 -f $(htmldocs).tar\n \t:\n \t$(RM) -r .doc-tmp-dir\n@@ -3058,7 +3061,7 @@ dist-doc:\n \t\tman5dir=../.doc-tmp-dir/man5 \\\n \t\tman7dir=../.doc-tmp-dir/man7 \\\n \t\tinstall\n-\tcd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .\n+\tcd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar $(TAR_DIST_EXTRA_OPTS) .\n \tgzip -n -9 -f $(manpages).tar\n \t$(RM) -r .doc-tmp-dir\n \n-- \n2.28.0-558-g7a0184fd7b\n\n"}]}