Make certain clients of bb_make_directory default to honoring

the user's umask
This commit is contained in:
Eric Andersen
2004-10-13 06:25:52 +00:00
parent 9315842242
commit 0e020d1025
3 changed files with 10 additions and 3 deletions

View File

@@ -49,7 +49,14 @@ int bb_make_directory (char *path, long mode, int flags)
struct stat st;
mask = umask(0);
umask(mask & ~0300);
if (mode == -1) {
umask(mask);
mode = (S_IXUSR | S_IXGRP | S_IXOTH |
S_IWUSR | S_IWGRP | S_IWOTH |
S_IRUSR | S_IRGRP | S_IROTH) & ~mask;
} else {
umask(mask & ~0300);
}
do {
c = 0;