summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b2cb942)
raw | patch | inline | side by side (parent: b2cb942)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 6 Jul 2005 08:21:46 +0000 (01:21 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Wed, 6 Jul 2005 17:39:59 +0000 (10:39 -0700) |
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>
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>
apply.c | patch | blob | history | |
csum-file.c | patch | blob | history | |
entry.c | patch | blob | history | |
init-db.c | patch | blob | history | |
receive-pack.c | patch | blob | history |
index 701c01a3bcaecfd1e1d4ec3c8b96ab923e2c8c27..c87cbf9eb3c9c3cc3c836c9b60e0171d89eb75d2 100644 (file)
--- a/apply.c
+++ b/apply.c
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 c8c7369152cd2b744aae488eb794c12ffbdfe9b9..907efbf860152347bffe0cc999fdacad2a5f0724 100644 (file)
--- a/csum-file.c
+++ b/csum-file.c
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;
index 874516e174d0704808587689504b9ba84f2dc9af..ded83103a9d8f16333d941e1e5410e0a12822ae7 100644 (file)
--- a/entry.c
+++ b/entry.c
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 6990903bf75ef3cb4764166f2537fd64c4d07f18..c78c4951144e04d97773a872b0663a405097874c 100644 (file)
--- a/init-db.c
+++ b/init-db.c
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 dfa7cd1d0a81eade8225e11dc0f2b97682a905c0..1768c875311d43a35636bab37d547c199a12b6e1 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
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));