[mythtv] mythtv commit: r16515 - in trunk by bjm

Michael T. Dean mtdean at thirdcontact.com
Wed Mar 12 05:50:07 UTC 2008


On 03/11/2008 11:55 PM, Nigel Pearson wrote:
>> Modified:
>>
>>    trunk/myththemes/cpsvndir
>>    trunk/mythtv/themes/cpsvndir
>>
>> Log:
>>
>> Hadn't anyone tried this twice?
>>     
> Yes, but only with sudo make install. Sorry.
>
>
> Original cp (before I added -p) obeyed umask.
> Wish I could do something like chmod 777-`umask`

Don't know if it's a GNU extension to chmod, but if no ugoa is specified 
in a symbolic mode, the effect is as if a (all of user, group, and 
other) were set but umask bits are untouched.  So, chmod =rw (with GNU 
chmod, at least) should work well:

[mtdean ~]$ umask
0022
[mtdean ~]$ touch foo
[mtdean ~]$ ls -al foo
-rw-r--r-- 1 mtdean mtdean 0 2008-03-12 01:40 foo

Initial file is created according to umask.

[mtdean ~]$ chmod 0000 foo
[mtdean ~]$ ls -al foo
---------- 1 mtdean mtdean 0 2008-03-12 01:40 foo
[mtdean ~]$ chmod a=rw foo
[mtdean ~]$ ls -al foo
-rw-rw-rw- 1 mtdean mtdean 0 2008-03-12 01:40 foo

Because of the 'a' specifier, chmod ignored umask and set the mode for all

[mtdean ~]$ chmod 0000 foo
[mtdean ~]$ ls -al foo
---------- 1 mtdean mtdean 0 2008-03-12 01:40 foo
[mtdean ~]$ chmod =rw foo
[mtdean ~]$ ls -al foo
-rw-r--r-- 1 mtdean mtdean 0 2008-03-12 01:40 foo

Without a ugoa specifier, chmod honors umask

[mtdean ~]$ chmod 0777 foo
[mtdean ~]$ ls -al foo
-rwxrwxrwx 1 mtdean mtdean 0 2008-03-12 01:40 foo
[mtdean ~]$ chmod =rw foo
[mtdean ~]$ ls -al foo
-rw-r--r-- 1 mtdean mtdean 0 2008-03-12 01:40 foo

It will even remove permissions to honor umask since we're using = 
(whereas + adds the permissions and - removes the permissions)

[mtdean ~]$ umask 0002
[mtdean ~]$ umask
0002
[mtdean ~]$ chmod =rw foo
[mtdean ~]$ ls -al foo
-rw-rw-r-- 1 mtdean mtdean 0 2008-03-12 01:40 foo

Just to prove it does honor umask.

Anyone know if this is common to non-GNU chmod?

Mike



More information about the mythtv-dev mailing list