Re: Solaris - umask

From: Stein Arne Storslett (sastorsl_at_THOU.SHALT.NOT.SPAM.online.no)
Date: 09/25/03


Date: Thu, 25 Sep 2003 13:13:51 GMT


<s_raghu20@yahoo.com> wrote in <d4998e2a.0309220815.2799dd7e@posting.google.com>:
> We are trying to implement a group level write permission on newly
> created files on directory. We tried using
>
> umask 002
>
> but it works fine when we use it manually, but when an application
> which is run under the same user, tries to create the file, it does
> not provide the write permission.

As others pointed out "umask" just sets the "filter" for what
permissions new files and directories will be created with.

Files default 666 - 002 = 664
Dirs default 777 - 002 = 775

> user1 is running a server application which generates some files.
> these files are to be created in a directory dir1 which is owned by
> user2 and that directory has group level write permission allowed.
> user1 and user2 both belong to same group (say grp1).
>
> the profile of user1 contains the command umask 002. The files created
> by the application (running by user1) should have the umask (or am I
> thinking in wrong direction ?). But they don't have the write
> permission on the group level (i.e. the umask does not seem to work).
>
> when we try to simulate the situation manually (creating files
> manually in dir1 by user1), the permissions seem to be correct.
>
> What can I be doing wrong ?

My guess is that you need to restart your application with the correct
umask set. Your application does not parse umask again after it is
started.

-- 
Stein Arne


Relevant Pages

  • Re: Solaris - umask
    ... > not provide the write permission. ... > user2 and that directory has group level write permission allowed. ... > permission on the group level (i.e. the umask does not seem to work). ... Stein Arne ...
    (comp.unix.admin)
  • Re: Solaris - umask
    ... > not provide the write permission. ... > user2 and that directory has group level write permission allowed. ... > permission on the group level (i.e. the umask does not seem to work). ... Stein Arne ...
    (comp.unix.programmer)
  • Re: Solaris - umask
    ... Stein Arne Storslett wrote: ... >> We are trying to implement a group level write permission on newly ... >> not provide the write permission. ... Your application does not parse umask again after it is ...
    (comp.unix.misc)
  • Re: [SLE] Sometimes Linux makes me crazy.
    ... > there a site where I can learn more about security on Linux? ... The Unix / Linux concept of the "umask" is probably somewhat obscure, ... The value passed for this permission is typically "maximal" in the sense ... If you're working in a cooperative environment where groups are used to ...
    (SuSE)
  • Re: [SLE] Alert
    ... >>Randall Schulz ... > tell me the effect of doing an umask, as I'm not quite convinced what ... Every time a program creates a file, it specifies a set of permission ... it will usually use 0777 (read+write+execute for owner, ...
    (SuSE)