diff options
author | Vicent Martà <tanoku@gmail.com> | 2011-10-28 19:04:23 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2011-10-28 19:04:23 -0700 |
commit | 89fb8f025a1f72b90f1f9563c85bf43b7f66ba60 (patch) | |
tree | 11726793eecf4670d4948a22e276dd3d50d1addb /src/odb_loose.c | |
parent | 3286c408eccb18c525ca123383f3ebf5097441bc (diff) | |
parent | 01ad7b3a9ec8f5e465f94c2704e1e96b84f941c7 (diff) | |
download | libgit2-89fb8f025a1f72b90f1f9563c85bf43b7f66ba60.tar.gz |
Merge pull request #456 from brodie/perm-fixes
Create objects, indexes, and directories with the right file permissions
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r-- | src/odb_loose.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c index 538fbc909..8c0331834 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -666,11 +666,11 @@ static int loose_backend__stream_fwrite(git_oid *oid, git_odb_stream *_stream) if (object_file_name(final_path, sizeof(final_path), backend->objects_dir, oid)) return GIT_ENOMEM; - if ((error = git_futils_mkpath2file(final_path)) < GIT_SUCCESS) + if ((error = git_futils_mkpath2file(final_path, GIT_OBJECT_DIR_MODE)) < GIT_SUCCESS) return git__rethrow(error, "Failed to write loose backend"); stream->finished = 1; - return git_filebuf_commit_at(&stream->fbuf, final_path); + return git_filebuf_commit_at(&stream->fbuf, final_path, GIT_OBJECT_FILE_MODE); } static int loose_backend__stream_write(git_odb_stream *_stream, const char *data, size_t len) @@ -787,10 +787,10 @@ static int loose_backend__write(git_oid *oid, git_odb_backend *_backend, const v if ((error = object_file_name(final_path, sizeof(final_path), backend->objects_dir, oid)) < GIT_SUCCESS) goto cleanup; - if ((error = git_futils_mkpath2file(final_path)) < GIT_SUCCESS) + if ((error = git_futils_mkpath2file(final_path, GIT_OBJECT_DIR_MODE)) < GIT_SUCCESS) goto cleanup; - return git_filebuf_commit_at(&fbuf, final_path); + return git_filebuf_commit_at(&fbuf, final_path, GIT_OBJECT_FILE_MODE); cleanup: git_filebuf_cleanup(&fbuf); |