diff options
author | Ron Yorston <rmy@pobox.com> | 2022-04-19 14:34:18 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-04-19 15:31:29 +0100 |
commit | 3cbe64df41eb408740a59145c6318b71f47c4f6d (patch) | |
tree | f931319c8c8f706c2222875284acfb588ccc806a /libbb/appletlib.c | |
parent | 8bf13fbd83137c34fd3da0f8d9b47b19dc1899ac (diff) | |
download | busybox-w32-3cbe64df41eb408740a59145c6318b71f47c4f6d.tar.gz busybox-w32-3cbe64df41eb408740a59145c6318b71f47c4f6d.tar.bz2 busybox-w32-3cbe64df41eb408740a59145c6318b71f47c4f6d.zip |
win32: minor adjustments to file permissions
Mask the file permission bits in mingw_umask(), not when it's
called from run_applet_no_and_exit().
Rather than hardcode write permissions for group and other in
file_attr_to_st_mode() and mingw_fstat() make them respect the
current umask setting.
In mingw_fstat() there's no need to check the mode using S_ISDIR():
the hardcoded mode doesn't set S_IFDIR. The compiler had already
figured this out so there's no reduction in bloat.
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 4a4699c68..aa442144a 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1116,7 +1116,7 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar | |||
1116 | 1116 | ||
1117 | vmask = getenv("BB_UMASK"); | 1117 | vmask = getenv("BB_UMASK"); |
1118 | if (vmask && sscanf(vmask, "%o", &mask) == 1) | 1118 | if (vmask && sscanf(vmask, "%o", &mask) == 1) |
1119 | umask((mode_t)(mask&0777)); | 1119 | umask((mode_t)mask); |
1120 | # else | 1120 | # else |
1121 | argc = string_array_len(argv); | 1121 | argc = string_array_len(argv); |
1122 | # endif | 1122 | # endif |