2013-02-26 1104 views
2

我試圖用git來掛鉤trac,而且大多數都很好,除了一些存儲庫外,我無法從git獲取修訂信息。git對象文件夾權限

我已經做了以下後,修改正確的Trac

chmod -R 777 <git-repo>/objects/ 

收集(我知道777是非常危險的,它只是爲診斷的目的),但是

,對於那些新的提交,承諾的項目仍然是0700許可。

drwxrwxrwx 2 git git 4.0K 2013-02-26 10:49 80 
drwxrwxrwx 2 git git 4.0K 2013-02-26 10:49 0a 
drwxrwxrwx 2 git git 4.0K 2013-02-26 11:01 04 
drwxrwxrwx 2 git git 4.0K 2013-02-26 11:01 a6 
drwxrwxrwx 2 git git 4.0K 2013-02-26 11:01 61 
drwxrwxrwx 2 git git 4.0K 2013-02-26 11:01 2f 
drwx------ 2 git git 4.0K 2013-02-26 12:13 da 
drwx------ 2 git git 4.0K 2013-02-26 12:13 a3 
drwx------ 2 git git 4.0K 2013-02-26 12:13 8c 
drwx------ 2 git git 4.0K 2013-02-26 12:13 26 

但奇怪的部分是,在同一臺機器裏面的一些其他git倉庫,這些新的對象文件夾大多是755的權限(這仍然是罰款的Trac)。

drwxr-xr-x 2 git git 4.0K 2011-07-12 17:22 14 
drwxr-xr-x 2 git git 4.0K 2011-07-12 17:22 f5 
drwxr-xr-x 2 git git 4.0K 2011-07-12 17:22 9e 
drwxr-xr-x 2 git git 4.0K 2013-02-26 14:12 aa 
drwx------ 2 git git 4.0K 2013-02-26 14:12 76 
drwxr-xr-x 2 git git 4.0K 2013-02-26 14:12 44 
drwxr-xr-x 2 git git 4.0K 2013-02-26 14:12 c5 
drwxr-xr-x 2 git git 4.0K 2013-02-26 14:12 9c 
drwx------ 2 git git 4.0K 2013-02-26 14:12 6a 

我可以知道什麼可能導致這種情況嗎?非常感謝

+1

隨機猜測:也許[的umask(http://en.wikipedia.org/wiki/Umask)問題? – melpomene 2013-02-26 06:18:23

+0

對不起,我不明白。我應該如何驗證或確認它是否是umask問題? – 2013-02-26 06:57:40

+0

您是否使用gitolite管理您的回購權的權利? – VonC 2013-02-26 07:10:15

回答

1

您需要檢查執行跟蹤守護程序的用戶是否與git用戶位於同一組中。

考慮這個installation process

useradd -m -K UMASK=027 git 
useradd -m -K UMASK=077 -G git trac 

通過git的處理umask 027創建的任何文件仍然將是TRAC可讀。

如果您使用gitolite,作爲mentioned here,您需要將umask設置爲.gitolite.rc爲0027以允許組擁有讀取權限。
Rc.pm,默認情況下它是077而不是027:

# HELP for all the other external programs (the syntactic sugar helpers and 
# the various programs/functions in the 8 trigger lists), can be found in 
# doc/non-core.mkd (http://sitaramc.github.com/gitolite/non-core.html) or in 
# the corresponding source file itself. 

%RC = (
    # if you're using mirroring, you need a hostname. This is *one* simple 
    # word, not a full domain name. See documentation if in doubt 
    # HOSTNAME => 'darkstar', 
    UMASK => 0077, 
+1

謝謝,改變UMASK的作品!儘管這是我改變的$ REPO_UMASK。 http://www.giocc.com/public-repositories-in-gitolite-with-umasks.html – 2013-02-26 07:58:51

+0

@Walty你的意思是,你仍然在gitolite v2? 'UMASK'(而不是'REPO_UMASK')用於gitolite V3,我推薦升級:它的VREFs是一個強大的功能:http://stackoverflow.com/questions/10888300/gitosis-vs-gitolite/10888358#10888358。 – VonC 2013-02-26 08:00:59

+0

感謝您指出這一點,我們會看看。 – 2013-02-26 08:05:50