From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
K_V <zinen2@gmail.com>,
git@vger.kernel.org
Subject: Re: git gc changes ownerships of files linux
Date: Sun, 11 Feb 2024 17:59:41 +0100 [thread overview]
Message-ID: <20240211165941.GB28699@tb-raspi4> (raw)
In-Reply-To: <xmqqcyt39cju.fsf@gitster.g>
On Sun, Feb 11, 2024 at 08:43:33AM -0800, Junio C Hamano wrote:
> Torsten Bögershausen <tboegi@web.de> writes:
>
> > Briam, Hm, I wonder what this function (in path.c) does:
> >
> > int adjust_shared_perm(const char *path)
> >
> > According to my understanding, it was included into the Git codebase
> > to work around the missing "setgid" feature in Linux (and probably cygwin).
>
> No. "g+s on directory" is required and depended upon for getting
> the correct group ownership. We do not do anything to chown(2) a
> filesystem entry to force what group it is owned by there.
>
> What adjust_shared_perm() does is to counter what the screwed-up
> umask settings the user may have causes. If you are a member of a
> group and working in a directory owned by the group with other
> members, you want to make sure others in the group can access the
> files and the directories in the project. Their umask should be
> loosened to at least 027 and preferrably to 007 to give group
> members the same access as you do. Yet people do not loosen their
> umask when starting work in such a group owned directory that is
> supposed to be shared, as it would be extremely cumbersome to do
> [*]. These users end up creating files with overly tight permission
> bits, e.g. 0644 or 0700, and we go in with adjust_shared_perm() to
> fix these modes.
>
> You definitely must set up your initial directory with g+s if you
> are usihng the group-writable shared directory model (which I would
> actually be surprised to see in 2020---is a shared machine with more
> than one user-account still a thing???); adjust_shared_perm() will
> not help you there.
>
Oh - I learned something today and sorry for the noise.
>
> [Footnote]
>
> * Unless, of course, you use some sort of "hook" in the shell to
> notice you switched to a certain directory and run command
> there---some people achieve this by aliasing their "cd", "pushd",
> and "popd".
>
>
next prev parent reply other threads:[~2024-02-11 16:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-10 19:52 git gc changes ownerships of files linux K_V
2024-02-11 15:14 ` Torsten Bögershausen
2024-02-11 15:28 ` brian m. carlson
2024-02-11 15:43 ` Torsten Bögershausen
2024-02-11 16:43 ` Junio C Hamano
2024-02-11 16:59 ` Torsten Bögershausen [this message]
2024-02-11 19:09 ` brian m. carlson
2024-02-11 19:48 ` rsbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240211165941.GB28699@tb-raspi4 \
--to=tboegi@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
--cc=zinen2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox