summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 49b8b29)
raw | patch | inline | side by side (parent: 49b8b29)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 4 Nov 2006 20:24:05 +0000 (12:24 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 6 Nov 2006 02:36:36 +0000 (18:36 -0800) |
When widening permission for files and directories in a 'shared'
repository for a user with inappropriate umask() setting for
shared work, make sure we call chmod() only when we actually
need to.
The primary idea owes credit to Johannes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
repository for a user with inappropriate umask() setting for
shared work, make sure we call chmod() only when we actually
need to.
The primary idea owes credit to Johannes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
path.c | patch | blob | history |
index bb89fb02dc9a8a1a09492fb32d8708f952afe47e..d2c076d7cbad3a16a002897d926cc13633be4f77 100644 (file)
--- a/path.c
+++ b/path.c
: 0));
if (S_ISDIR(mode))
mode |= S_ISGID;
: 0));
if (S_ISDIR(mode))
mode |= S_ISGID;
- if (chmod(path, mode) < 0)
+ if ((mode & st.st_mode) != mode && chmod(path, mode) < 0)
return -2;
return 0;
}
return -2;
return 0;
}