Group permissions not respected
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
Direção de pesquisa
Reproduza a configuração de permissões da issue em um ambiente compatível, começando com pygit2.Repository e a chamada de init_file_backend mostrada na linha 1620 de pygit2/repository.py. Rastreie se a falha de permissões de grupo ocorre no binding Python ou no libgit2; em seguida, adicione cobertura de regressão e documente o comportamento confirmado ou a correção.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I ran into a strange behavior when trying to read a bare repo on my FreeBSD machine with pygit2:
Info:
- FreeBSD: 13.1
- libgit2-1.3.2
- pygit2: 1.10.0
> whoami
www
> git init --bare testrepo.git
Initialized empty Git repository in /example/testrepo.git/
> chmod -R 770 testrepo.git
> ls -lah
[...]
drwxrwx--- 7 www www 10B Jul 28 08:48 testrepo.git
> python3 -c "import pygit2;path = pygit2.discover_repository('testrepo.git');print(path);print(pygit2.Repository(path))"
/example/testrepo.git/
pygit2.Repository('/example/testrepo.git/')
> sudo chown -R git:www testrepo.git
> ls -lah
[...]
drwxrwx--- 7 git www 10B Jul 28 08:48 testrepo.git
> python3 -c "import pygit2;path = pygit2.discover_repository('testrepo.git');print(path);print(pygit2.Repository(path))"
/example/testrepo.git/
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/example/.venv/lib/python3.9/site-packages/pygit2/repository.py", line 1620, in __init__
path_backend = init_file_backend(path, flags)
_pygit2.GitError: Repository not found at testrepo.git
> sudo chmod -R 777 testrepo.git
> ls -lah
[...]
drwxrwxrwx 7 git www 10B Jul 28 08:48 testrepo.git
> python3 -c "import pygit2;path = pygit2.discover_repository('testrepo.git');print(path);print(pygit2.Repository(path))"
/example/testrepo.git/
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/example/.venv/lib/python3.9/site-packages/pygit2/repository.py", line 1620, in __init__
path_backend = init_file_backend(path, flags)
_pygit2.GitError: Repository not found at testrepo.git
It seems, like the repo can only be opened if the owner is also the user; the group permissions seem to be ignored.
I could confirm this behavior also on a Ubuntu machine:
- Ubuntu: 20.04
- libgit2-28
- pygit2: 1.10.0
I'm not quite sure if this is a problem of pygit2 or the underlying libgit2, or if I did something wrong…
- Linguagem predominante
- Python
- Estrelas
- 1.7k
- Forks
- 408
- Merge médio
- 1d 15h
- PRs com merge (30d)
- 7
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de libgit2/pygit2
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
-
Feature Request: Support app-level temporary config overrides using libgit2's backend supprtTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
-
merge_bases not wrappedAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
Todas as issues de libgit2/pygit2
Issues semelhantes
-
needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")Talvez já em andamento @mayureshsonawane17 assumiu hoje. AbertaWaiting for: Product Owner
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Add .devin pluginAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
ayghri/i-have-adhd#249 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
modelscope/FunASR#3762 ·
Mantenedores costumam responder em até 1 dia