git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug: permissions problem when recursively cloning from a suid program
@ 2021-01-05 18:07 southerntofu
  0 siblings, 0 replies; only message in thread
From: southerntofu @ 2021-01-05 18:07 UTC (permalink / raw)
  To: git

What did you do before the bug happened? (Steps to reproduce your issue)

Hi, i tried to clone a repository with submodules from a program running with the suid/guid bit set.

What did you expect to happen? (Expected behavior)

It should clone the repository, with the submodules, with permissions from the owner of the suid program.

What happened instead? (Actual behavior)

git fails with a permissions error:

```
error: could not lock config file /path/to/.git/config: Permission denied
fatal: Failed to register url for submodule path
```

What's different between what you expected and what actually happened?

Cloning failed when fetching submodules (--recursive). However, it only works without submodules.

Anything else you want to add:

I could reproduce the bug on the next branch. I have a small reproduction case. It's a rust program, but the code is a bit more convoluted so it works without any dependency (just the standard library). Reproduction instructions in the repository:

https://tildegit.org/southerntofu/testsuid

[System Info]
git version:
git version 2.30.0.284.gd98b1dd5ea
cpu: x86_64
built from commit: d98b1dd5eaa7327399716162c746c9bd3cac3866
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
[REDACTED]
$SHELL (typically, interactive shell): /bin/bash

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-05 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 18:07 Bug: permissions problem when recursively cloning from a suid program southerntofu

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).