File/directory creation umask when cloning is `0000`
I'm assuming that this is not a bug, but maybe someone can tell me the rationale behind this decision.
We're currently re-building our continuous delivery setup on GitLab/Gitlab CI and noticed that file permissions are odd when deploying through Gitlab CI. When
gitlab-ci-multi-runner checks out a repository inside a docker container, it appears to be doing so with
umask 0000, with the result that everything that's checked out is world-writable. This is not a problem inside the container, but since we deploy from inside the container, the permissions are also transferred to the production system.
It seems like this behavior cannot be influenced, since
before_script runs after the repository has been cloned. To verify that my assumption about the umask was correct, I threw in a
w.Command("umask", "0022") in abstract.go L61, which resulted in the correct (for me) file permissions being set.
So my questions are:
- Is this intended behavior, and if so, what is the rationale?
- Can this be influenced in any way?
- If it is not, I'd be willing to submit a merge request providing such functionality after discussing what the best approach would be to do so
Thanks for your time :)