[PATCH] fix hush umask command
Denys Vlasenko
vda.linux at googlemail.com
Wed Oct 7 14:57:51 UTC 2015
On Wed, Oct 7, 2015 at 6:44 AM, Rich Felker <dalias at libc.org> wrote:
> On Wed, Oct 07, 2015 at 12:31:15AM -0400, Rich Felker wrote:
>> The hush umask command is backwards; umask 022 sets the umask to 0755.
>> Attached patch should fix it.
>>
>> Rich
>
>> diff --git a/shell/hush.c b/shell/hush.c
>> index 96c739f..58c8dab 100644
>> --- a/shell/hush.c
>> +++ b/shell/hush.c
>> @@ -8956,9 +8956,7 @@ static int FAST_FUNC builtin_umask(char **argv)
>> if (argv[0]) {
>> mode_t old_mask = mask;
>>
>> - mask ^= 0777;
>> rc = bb_parse_mode(argv[0], &mask);
>> - mask ^= 0777;
>> if (rc == 0) {
>> mask = old_mask;
>> /* bash messages:
>
> Hmm, this may break symbolic umask specs, a feature I've never seen
> used and wasn't aware even existed. I might look into it more later
> but it would be great if someone who already knows this stuff could
> figure it out and work out a correct patch.
Fixed in git, thanks!
More information about the busybox
mailing list