summaryrefslogtreecommitdiff
path: root/src/odb.h
diff options
context:
space:
mode:
authorBrodie Rao <brodie@bitheap.org>2011-09-06 15:48:45 -0700
committerBrodie Rao <brodie@bitheap.org>2011-10-14 16:07:47 -0700
commit01ad7b3a9ec8f5e465f94c2704e1e96b84f941c7 (patch)
treec44520dc0f23ceb24463ab6a2d0b754cd0b55cbb /src/odb.h
parentce8cd006ce3adcd012a38401b8a7555ba3307b3f (diff)
downloadlibgit2-01ad7b3a9ec8f5e465f94c2704e1e96b84f941c7.tar.gz
*: 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/odb.h')
-rw-r--r--src/odb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/odb.h b/src/odb.h
index 7c8c9f9e2..833739e99 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -16,6 +16,7 @@
#define GIT_OBJECTS_DIR "objects/"
#define GIT_OBJECT_DIR_MODE 0777
+#define GIT_OBJECT_FILE_MODE 0444
/* DO NOT EXPORT */
typedef struct {