Question

I have installed gitolite and gitweb according to the tutorial in this blog post. The whole thing runs really good. I am able to clone and commit to the server.

However, Gitweb shows no project with the error code 404 - No projects found. I discovered that SELinux denied gitweb.cgi from accessing some files. Gitweb is able to show the repositories only after putting SELinux into permissive mode.

# setenforce 0

I have already tried many solutions from a few sites, but I found none of them work for me. For example, I have tried the solution introduced in this blog post.

# semanage fcontext -a -t httpd_sys_content_t /var/lib/gitolite/projects.list
# restorecon -v /var/lib/gitolite/projects.list

I have the following SELinux log but I really have no ideas what to do with it. I have already messing with this problem for a whole day, any suggestions are appreciated. Thanks in advance

type=AVC msg=audit(1390845123.601:280): avc:  denied  { rlimitinh } for  pid=2049 comm="gitweb.cgi" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:system_r:httpd_git_script_t:s0 tclass=process
type=AVC msg=audit(1390845123.601:280): avc:  denied  { siginh } for  pid=2049 comm="gitweb.cgi" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:system_r:httpd_git_script_t:s0 tclass=process
type=AVC msg=audit(1390845123.601:280): avc:  denied  { noatsecure } for  pid=2049 comm="gitweb.cgi" scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:system_r:httpd_git_script_t:s0 tclass=process
type=SYSCALL msg=audit(1390845123.601:280): arch=40000003 syscall=11 success=yes exit=0 a0=1d554e0 a1=1d52e38 a2=1d52e48 a3=1d532a8 items=0 ppid=1610 pid=2049 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=2 comm="gitweb.cgi" exe="/usr/bin/perl" subj=unconfined_u:system_r:httpd_git_script_t:s0 key=(null)
type=AVC msg=audit(1390845124.272:281): avc:  denied  { search } for  pid=2049 comm="gitweb.cgi" name="gitolite" dev=dm-0 ino=658360 scontext=unconfined_u:system_r:httpd_git_script_t:s0 tcontext=system_u:object_r:gitosis_var_lib_t:s0 tclass=dir
type=SYSCALL msg=audit(1390845124.272:281): arch=40000003 syscall=195 success=no exit=-13 a0=9ce0890 a1=98f50c0 a2=996ff4 a3=98f5008 items=0 ppid=1610 pid=2049 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=2 comm="gitweb.cgi" exe="/usr/bin/perl" subj=unconfined_u:system_r:httpd_git_script_t:s0 key=(null)
type=AVC msg=audit(1390845124.273:282): avc:  denied  { search } for  pid=2049 comm="gitweb.cgi" name="gitolite" dev=dm-0 ino=658360 scontext=unconfined_u:system_r:httpd_git_script_t:s0 tcontext=system_u:object_r:gitosis_var_lib_t:s0 tclass=dir
type=SYSCALL msg=audit(1390845124.273:282): arch=40000003 syscall=195 success=no exit=-13 a0=9ce0890 a1=98f50c0 a2=996ff4 a3=98f5008 items=0 ppid=1610 pid=2049 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=2 comm="gitweb.cgi" exe="/usr/bin/perl" subj=unconfined_u:system_r:httpd_git_script_t:s0 key=(null)
Was it helpful?

Solution

You would change the default context for any of files or subdirectories in '/var/lib/gitolite', not only projects.list.

# semanage fcontext -a -t httpd_sys_content_t "/var/lib/gitolite(/.*)?"
# restorecon -v /var/lib/gitolite

Read more about that denial on https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=736623

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top