summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d9740c)
raw | patch | inline | side by side (parent: 1d9740c)
author | Matthieu Moy <Matthieu.Moy@imag.fr> | |
Mon, 22 Feb 2010 22:32:16 +0000 (23:32 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 22 Feb 2010 23:24:46 +0000 (15:24 -0800) |
We used to unnecessarily give the read permission to group and others,
regardless of the umask, which isn't serious because the objects are
still protected by their containing directory, but isn't necessary
either.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
regardless of the umask, which isn't serious because the objects are
still protected by their containing directory, but isn't necessary
either.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c | patch | blob | history | |
t/t1304-default-acl.sh | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index 657825e14ef78c19649779fe89e1d09ae672901a..3316f282c6903eb9156835d2d2ebd0d5501ee142 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
}
out:
- if (set_shared_perm(filename, (S_IFREG|0444)))
+ if (adjust_shared_perm(filename))
return error("unable to set permission to '%s'", filename);
return 0;
}
}
memcpy(buffer, filename, dirlen);
strcpy(buffer + dirlen, "tmp_obj_XXXXXX");
- fd = mkstemp(buffer);
+ fd = git_mkstemp_mode(buffer, 0444);
if (fd < 0 && dirlen && errno == ENOENT) {
/* Make sure the directory exists */
memcpy(buffer, filename, dirlen);
/* Try again */
strcpy(buffer + dirlen - 1, "/tmp_obj_XXXXXX");
- fd = mkstemp(buffer);
+ fd = git_mkstemp_mode(buffer, 0444);
}
return fd;
}
diff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh
index 8472dbb44a500b1e4af6f76fff5f1ba79782621e..cc30be4a655cad98eac233b5da9fc585ddb5d055 100755 (executable)
--- a/t/t1304-default-acl.sh
+++ b/t/t1304-default-acl.sh
git commit -m "init"
'
-test_expect_failure 'Objects creation does not break ACLs with restrictive umask' '
+test_expect_success 'Objects creation does not break ACLs with restrictive umask' '
# SHA1 for empty blob
check_perms_and_acl .git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
'