* safe.directory and ACLs
@ 2022-11-02 15:18 John Soo
2022-11-02 21:27 ` brian m. carlson
0 siblings, 1 reply; 5+ messages in thread
From: John Soo @ 2022-11-02 15:18 UTC (permalink / raw)
To: git
Hello git!
We have some build processes that would like access to repos in /home
directories that are 0700. We had done this already:
$ setfacl --recursive --modify group:<build users
group>:r-X,default:group:<build users group>:r-X /home
Should this ACL be enough to consider the repos "owned" by the build
users? Should *any* ACL be enough to consider the repos "owned" by the
build users?
Currently:
$ sudo -u <build user> git config --get safe.directory
$ sudo -u <build user> git -C /home/<non build user>/repo rev-parse HEAD
fatal: unsafe repository ('/home/<non build user>/repo' is owned by
someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /home/<non build user>
Kindly,
John Soo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: safe.directory and ACLs
2022-11-02 15:18 safe.directory and ACLs John Soo
@ 2022-11-02 21:27 ` brian m. carlson
2022-11-02 23:41 ` John Soo
0 siblings, 1 reply; 5+ messages in thread
From: brian m. carlson @ 2022-11-02 21:27 UTC (permalink / raw)
To: John Soo; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]
On 2022-11-02 at 15:18:25, John Soo wrote:
> Hello git!
>
> We have some build processes that would like access to repos in /home
> directories that are 0700. We had done this already:
>
> $ setfacl --recursive --modify group:<build users
> group>:r-X,default:group:<build users group>:r-X /home
>
> Should this ACL be enough to consider the repos "owned" by the build
> users? Should *any* ACL be enough to consider the repos "owned" by the
> build users?
>
> Currently:
> $ sudo -u <build user> git config --get safe.directory
> $ sudo -u <build user> git -C /home/<non build user>/repo rev-parse HEAD
> fatal: unsafe repository ('/home/<non build user>/repo' is owned by
> someone else)
> To add an exception for this directory, call:
>
> git config --global --add safe.directory /home/<non build user>
No, the permissions of a repository, whether standard Unix permissions
or ACLs, are not relevant to ownership. The question here is whether
the owner of the .git directory (that is, the value of the `st_uid`
field when calling lstat(2) on it) is equal to the effective user ID.
When you the path in `ls`, you can see the owner and group of the file
specified, and that owner is what matters here.
--
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: safe.directory and ACLs
2022-11-02 21:27 ` brian m. carlson
@ 2022-11-02 23:41 ` John Soo
2022-11-03 0:11 ` Taylor Blau
0 siblings, 1 reply; 5+ messages in thread
From: John Soo @ 2022-11-02 23:41 UTC (permalink / raw)
To: brian m. carlson, John Soo, git
Hi brian!
> No, the permissions of a repository, whether standard Unix permissions
> or ACLs, are not relevant to ownership. The question here is whether
> the owner of the .git directory (that is, the value of the `st_uid`
> field when calling lstat(2) on it) is equal to the effective user ID.
>
> When you the path in `ls`, you can see the owner and group of the file
> specified, and that owner is what matters here.
I see. Is that by design or an implementation detail?
Kindly,
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: safe.directory and ACLs
2022-11-02 23:41 ` John Soo
@ 2022-11-03 0:11 ` Taylor Blau
2022-11-03 0:39 ` John Soo
0 siblings, 1 reply; 5+ messages in thread
From: Taylor Blau @ 2022-11-03 0:11 UTC (permalink / raw)
To: John Soo; +Cc: brian m. carlson, Johannes Schindelin, git
On Wed, Nov 02, 2022 at 04:41:15PM -0700, John Soo wrote:
> Hi brian!
>
> > No, the permissions of a repository, whether standard Unix permissions
> > or ACLs, are not relevant to ownership. The question here is whether
> > the owner of the .git directory (that is, the value of the `st_uid`
> > field when calling lstat(2) on it) is equal to the effective user ID.
> >
> > When you the path in `ls`, you can see the owner and group of the file
> > specified, and that owner is what matters here.
>
> I see. Is that by design or an implementation detail?
It is by design. See 8959555cee7 (setup_git_directory(): add an owner
check for the top-level directory, 2022-03-02) for details.
Thanks,
Taylor
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: safe.directory and ACLs
2022-11-03 0:11 ` Taylor Blau
@ 2022-11-03 0:39 ` John Soo
0 siblings, 0 replies; 5+ messages in thread
From: John Soo @ 2022-11-03 0:39 UTC (permalink / raw)
To: Taylor Blau; +Cc: brian m. carlson, Johannes Schindelin, git
Thank you!
Got it!
Kindly,
John
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-03 0:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 15:18 safe.directory and ACLs John Soo
2022-11-02 21:27 ` brian m. carlson
2022-11-02 23:41 ` John Soo
2022-11-03 0:11 ` Taylor Blau
2022-11-03 0:39 ` John Soo
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 read-only IMAP folder(s) and NNTP newsgroup(s).