summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-07-06 01:21:46 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-06 10:39:59 -0700
commitf312de018b48853d166040908b0ba2bf666e26c1 (patch)
treea1863bec8ca2a728502562baf933527e10b93609
parentb2cb94254be7bf8b44c851897dd29a00ce654e3c (diff)
downloadgit-f312de018b48853d166040908b0ba2bf666e26c1.tar.gz
[PATCH] Let umask do its work upon filesystem object creation.
IIRC our strategy was to let the users' umask take care of the final mode bits. This patch fixes places that deviate from it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--apply.c2
-rw-r--r--csum-file.c2
-rw-r--r--entry.c4
-rw-r--r--init-db.c2
-rw-r--r--receive-pack.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/apply.c b/apply.c
index 701c01a3bc..c87cbf9eb3 100644
--- a/apply.c
+++ b/apply.c
@@ -1237,7 +1237,7 @@ static void create_subdirectories(const char *path)
len = slash - path;
memcpy(buf, path, len);
buf[len] = 0;
- if (mkdir(buf, 0755) < 0) {
+ if (mkdir(buf, 0777) < 0) {
if (errno != EEXIST)
break;
}
diff --git a/csum-file.c b/csum-file.c
index c8c7369152..907efbf860 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -86,7 +86,7 @@ struct sha1file *sha1create(const char *fmt, ...)
die("you wascally wabbit, you");
f->namelen = len;
- fd = open(f->name, O_CREAT | O_EXCL | O_WRONLY, 0644);
+ fd = open(f->name, O_CREAT | O_EXCL | O_WRONLY, 0666);
if (fd < 0)
die("unable to open %s (%s)", f->name, strerror(errno));
f->fd = fd;
diff --git a/entry.c b/entry.c
index 874516e174..ded83103a9 100644
--- a/entry.c
+++ b/entry.c
@@ -12,10 +12,10 @@ static void create_directories(const char *path, struct checkout *state)
len = slash - path;
memcpy(buf, path, len);
buf[len] = 0;
- if (mkdir(buf, 0755)) {
+ if (mkdir(buf, 0777)) {
if (errno == EEXIST) {
struct stat st;
- if (len > state->base_dir_len && state->force && !unlink(buf) && !mkdir(buf, 0755))
+ if (len > state->base_dir_len && state->force && !unlink(buf) && !mkdir(buf, 0777))
continue;
if (!stat(buf, &st) && S_ISDIR(st.st_mode))
continue; /* ok */
diff --git a/init-db.c b/init-db.c
index 6990903bf7..c78c495114 100644
--- a/init-db.c
+++ b/init-db.c
@@ -7,7 +7,7 @@
static void safe_create_dir(const char *dir)
{
- if (mkdir(dir, 0755) < 0) {
+ if (mkdir(dir, 0777) < 0) {
if (errno != EEXIST) {
perror(dir);
exit(1);
diff --git a/receive-pack.c b/receive-pack.c
index dfa7cd1d0a..1768c87531 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -70,7 +70,7 @@ static void update(const char *name, unsigned char *old_sha1, unsigned char *new
if (!has_sha1_file(new_sha1))
die("unpack should have generated %s, but I can't find it!", new_hex);
- newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 0644);
+ newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 0666);
if (newfd < 0)
die("unable to create %s (%s)", lock_name, strerror(errno));