2013-02-26 1065 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