Re: [PATCH] fix hush umask command

2015-10-07 Thread Denys Vlasenko
On Wed, Oct 7, 2015 at 6:44 AM, Rich Felker  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 ^= 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!
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] fix hush umask command

2015-10-06 Thread Rich Felker
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 ^= 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.

Rich
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH] fix hush umask command

2015-10-06 Thread Rich Felker
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 ^= 0777;
if (rc == 0) {
mask = old_mask;
/* bash messages:
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox