]> git.proxmox.com Git - libgit2.git/commit - src/index.h
*: correct and codify various file permissions
authorBrodie Rao <brodie@bitheap.org>
Tue, 6 Sep 2011 22:48:45 +0000 (15:48 -0700)
committerBrodie Rao <brodie@bitheap.org>
Fri, 14 Oct 2011 23:07:47 +0000 (16:07 -0700)
commit01ad7b3a9ec8f5e465f94c2704e1e96b84f941c7
treec44520dc0f23ceb24463ab6a2d0b754cd0b55cbb
parentce8cd006ce3adcd012a38401b8a7555ba3307b3f
*: 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".
31 files changed:
src/config.h
src/config_file.c
src/fetch.c
src/filebuf.c
src/filebuf.h
src/index.c
src/index.h
src/indexer.c
src/odb.h
src/odb_loose.c
src/pack.h
src/reflog.c
src/reflog.h
src/refs.c
src/refs.h
src/repository.h
src/transports/http.c
tests-clay/core/dirent.c
tests-clay/core/filebuf.c
tests-clay/core/rmdir.c
tests-clay/status/single.c
tests/t00-core.c
tests/t04-commit.c
tests/t06-index.c
tests/t08-tag.c
tests/t09-tree.c
tests/t12-repo.c
tests/t15-config.c
tests/t18-status.c
tests/test_helpers.c
tests/test_helpers.h