Problem with umask and stty

Problem with umask and stty

Post by S.RamNaray » Thu, 08 Aug 1996 04:00:00



Organization: Bell-Northern Research Ltd.
Cc:


Quote:>Hi,

>Two different queries about 'umask' and 'stty' commands of Unix.

>A query about 'umask'.  They do not work the same for  directories  and files.
>Eg.  umask  000.  A  directory  created  after the umask  has 777  permissions
>whereas a file has 666  permissions.  I don't think the man pages say anything
>about  this.  Is  it  that  generally  files  are  not  to  have  any  execute
>permissions by default and the permissions have to be given consciously ?  

>Also I notice that the command  'stty -echo' for masking the input  characters
>doesn't  work on 'csh'.  It works  fine in 'sh' and 'ksh'.  This also  doesn't
>seem to be documented in the 'csh' man pages.

>I use HP-UX 09.05. Any response would be appreciated.

Another query on the same lines.  Is '-m' option of mkdir  specific to HP-UX ?
This is for creating directories with specified  permissions, but doesn't work
as expected always.

- Show quoted text -

Quote:>RamNarayan S

 
 
 

Problem with umask and stty

Post by Rich K » Thu, 08 Aug 1996 04:00:00



>Organization: Bell-Northern Research Ltd.
>Cc:


>>Hi,

>>Two different queries about 'umask' and 'stty' commands of Unix.

>>A query about 'umask'.  They do not work the same for  directories  and files.
>>Eg.  umask  000.  A  directory  created  after the umask  has 777  permissions
>>whereas a file has 666  permissions.  I don't think the man pages say anything
>>about  this.  Is  it  that  generally  files  are  not  to  have  any  execute
>>permissions by default and the permissions have to be given consciously ?  

>>Also I notice that the command  'stty -echo' for masking the input  characters
>>doesn't  work on 'csh'.  It works  fine in 'sh' and 'ksh'.  This also  doesn't
>>seem to be documented in the 'csh' man pages.

>>I use HP-UX 09.05. Any response would be appreciated.

>Another query on the same lines.  Is '-m' option of mkdir  specific to HP-UX ?
>This is for creating directories with specified  permissions, but doesn't work
>as expected always.

>>RamNarayan S

 no it is part of SYSV . what did you type?

 richk

 
 
 

Problem with umask and stty

Post by S.RamNaray » Sat, 10 Aug 1996 04:00:00




>>Organization: Bell-Northern Research Ltd.
>>Cc:

>>Another query on the same lines.  Is '-m' option of mkdir  specific to HP-UX ?
>>This is for creating directories with specified  permissions, but doesn't work
>>as expected always.

> no it is part of SYSV . what did you type?

One thing I noticed is that the umask of the parent  process  controls  its
children.  This I think is the cause of the  problem  as can be noticed  in
the following dump.

Thanks for the responses.

RamNarayan S

------------------------------------------------------------------------------

~/garbo-42% umask
22
~/garbo-43% mkdir -m 700 dir-1
~/garbo-44% mkdir -m 775 dir-2
~/garbo-45% mkdir -m 777 dir-3
~/garbo-46% mkdir -m 744 dir-4
~/garbo-47% ll
total 8
drwx------   2 srn      oc48sg        24 Aug  9 11:39 dir-1
drwxr-xr-x   2 srn      oc48sg        24 Aug  9 11:39 dir-2
drwxr-xr-x   2 srn      oc48sg        24 Aug  9 11:39 dir-3  <- Parent masks
drwxr--r--   2 srn      oc48sg        24 Aug  9 11:39 dir-4
~/garbo-48% umask 000
~/garbo-49% umask
0
~/garbo-50% mkdir -m 777 dir-5
~/garbo-51% mkdir -m 775 dir-6
~/garbo-52% mkdir -m 075 dir-7
~/garbo-53% ll
total 14
drwx------   2 srn      oc48sg        24 Aug  9 11:39 dir-1
drwxr-xr-x   2 srn      oc48sg        24 Aug  9 11:39 dir-2
drwxr-xr-x   2 srn      oc48sg        24 Aug  9 11:39 dir-3
drwxr--r--   2 srn      oc48sg        24 Aug  9 11:39 dir-4
drwxrwxrwx   2 srn      oc48sg        24 Aug  9 11:40 dir-5  <- Things are OK
drwxrwxr-x   2 srn      oc48sg        24 Aug  9 11:40 dir-6
d---rwxr-x   2 srn      oc48sg        24 Aug  9 11:40 dir-7
~/garbo-54%
------------------------------------------------------------------------------

 
 
 

Problem with umask and stty

Post by Kurt Fran » Sat, 17 Aug 1996 04:00:00


...
|> One thing I noticed is that the umask of the parent  process  controls  its
|> children.  This I think is the cause of the  problem  as can be noticed  in
|> the following dump.

the only umask controlling a process is the own one, not that one of the
 parent process.
but when a process is forked the umask currently in effect is
 inherited to the child.

kf

--