diff options
author | Brodie Rao <brodie@bitheap.org> | 2011-09-07 02:48:45 +0400 |
---|---|---|
committer | Brodie Rao <brodie@bitheap.org> | 2011-10-15 03:07:47 +0400 |
commit | 01ad7b3a9ec8f5e465f94c2704e1e96b84f941c7 (patch) | |
tree | c44520dc0f23ceb24463ab6a2d0b754cd0b55cbb /src/refs.h | |
parent | ce8cd006ce3adcd012a38401b8a7555ba3307b3f (diff) |
*: correct and codify various file permissions
The following files now have 0444 permissions:
- loose objects
- pack indexes
- pack files
- packs downloaded by fetch
- packs downloaded by the HTTP transport
And the following files now have 0666 permissions:
- config files
- repository indexes
- reflogs
- refs
This brings libgit2 more in line with Git.
Note that git_filebuf_commit() and git_filebuf_commit_at() have both
gained a new mode parameter.
The latter change fixes an important issue where filebufs created with
GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3)
usage). Now we chmod() the file before renaming it into place.
Tests have been added to confirm that new commit, tag, and tree
objects are created with the right permissions. I don't have access to
Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
Diffstat (limited to 'src/refs.h')
-rw-r--r-- | src/refs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/refs.h b/src/refs.h index f802cfe4a..33c1e6983 100644 --- a/src/refs.h +++ b/src/refs.h @@ -17,6 +17,7 @@ #define GIT_REFS_TAGS_DIR GIT_REFS_DIR "tags/" #define GIT_REFS_REMOTES_DIR GIT_REFS_DIR "remotes/" #define GIT_REFS_DIR_MODE 0777 +#define GIT_REFS_FILE_MODE 0666 #define GIT_RENAMED_REF_FILE GIT_REFS_DIR "RENAMED-REF" |