Context: I am creating a gitolite3 hook for a specific repo, which contains some logic and css foo of my website.
so what essentailly happens is
Content under /var/www/nginx/
looks like:
drwxrwxr-x. nginx git system_u:object_r:httpd_sys_content_t:s0 foo
.git
is special:
drwxrwxr-x. git git system_u:object_r:httpd_sys_content_t:s0 .git
To make sure all subdirs have the proper access rights I used:
chown nginx:git -Rf ./webfoo
chmod g+rw -Rf ./webfoo
chown git:git -Rf ./webfoo/.git
[This is just bonus, you can skip this.]
The gitolite3 hook
#!/bin/bash
cd /var/www/nginx/webfoo || exit
unset GIT_DIR
echo "where: $(pwd)"
git pull -f origin deploy-me-branch
remote: where: /var/www/nginx/webfoo
remote: From /home/gitolite/repositories/webfoo
remote: c092ee2..07274a6 master -> origin/master
remote: error: unable to unlink old '.gitignore' (Permission denied)
remote: error: unable to unlink old 'templates/fancypost.html' (Permission denied)
remote: error: unable to unlink old 'templates/layout.html' (Permission denied)
/var/log/audit/audit.log
does not contain any access denies.
Update: Even loging in git
locally does not work either. So this is probably unrelated to SELinux/file security context.
Why does this fail to work as I'd expect?
setenforce 0
to verify it actually is SELinux blocking the operation and not something else? Also where does that error output in the page (after your hook script) come from?/var/log/audit/audit.log
contains nothing). So it is not selinux related but I have no clue what it acutlly is...