зеркало из https://github.com/microsoft/git.git
Fix total permission bogosity in "checkout-cache.c".
Use the proper octal mode naming instead of random decimal crud, and don't reset the mode after the create with fchmod: the whole point was to let "umask" do its thing. Duh.
This commit is contained in:
Родитель
c4e3cca1f7
Коммит
fa06d442c6
|
@ -54,7 +54,7 @@ static int create_file(const char *path, unsigned int mode)
|
|||
{
|
||||
int fd;
|
||||
|
||||
mode = (mode & 0100) ? 777 : 666;
|
||||
mode = (mode & 0100) ? 0777 : 0666;
|
||||
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
|
||||
if (fd < 0) {
|
||||
if (errno == ENOENT) {
|
||||
|
@ -62,8 +62,6 @@ static int create_file(const char *path, unsigned int mode)
|
|||
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
|
||||
}
|
||||
}
|
||||
if (fd >= 0)
|
||||
fchmod(fd, mode);
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче