git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug: permissions problem when recursively cloning from a suid program

From
Ssoutherntofu@thunix.net <southerntofu@thunix.net>
Date
Jan 5, 2021, 18:07 UTC
Message-ID
<X/Sq38YKmLjY4KmD@thunix.net>
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

Message 1 of 1 in “Bug: permissions problem when recursively cloning from a suid program”
  1. southerntofu@thunix.netJan 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.