Group permissions not respected
まだ誰も着手していません。
評価
調査の方向性
サポート対象の環境で issue の権限設定を再現し、pygit2.Repository と pygit2/repository.py の 1620 行目に示されている init_file_backend の呼び出しから始めます。グループ権限の失敗が Python binding で発生しているのか libgit2 で発生しているのかを追跡し、その後、リグレッションテストを追加して、確認済みの動作または修正内容を文書化します。
索引モデルが issue の本文から書いたものです。
説明
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…
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/pygit2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·