Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.stat before calls to os.chmod to see if the chmod is necessary to avoid ownership issues on shared systems #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fapestniegd
Copy link

When using gitosis for multiple users, the hooks are installed as root. init.py tries to chmod 755 the hooks whenever a repository is initialized even if the user it's running as does not own the files. It shouldn't need to make them 755 if they are already 755. I first just tried making them owned by git, but then others wanted to use it as well and they kept getting the operation not permitted on the chmod. The stat-before-chmod works better on shared systems.

… to os.chmod so that the chmod will not be called if the file is already 755. This fixes a problem when the file is owned by root and gitosis gitosis-init run as a non-root user fails with Operation not permitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants