File permissions

Tommy Reynolds Tommy.Reynolds at MegaCoder.com
Fri Mar 5 02:39:29 UTC 2004


Uttered Sean Kennedy <skennedy at tpno.org>, spake thus:

> You will want a umask of 0111
> 
> Mike Westkamper wrote:
> 
> |This not strictly a Fedora issue, however...
> |
> |I have a process that I start via a script
> |
> |     umask 0000
> |     nohup /usr/bin/datarecord &
> |
> |Files are created by the datarecord program once a second, however the
> |permissions are
> |
> |-rw-------
> |
> |What I am trying to do is
> |
> |-rw-rw-rw-

Assuming the creat(2) or open(2) calls in "datarecord" are attempting 
to use the file access permissions 0666, then the umask of 0011 gets
you what you want.  The way that umask works is this:

	0777	<-- Requested permissions from program
     & ~0011	<-- Turns OFF each umask'ed permission
     -------
	0766	<-- Actual permissions given to the file system

So you see, both the act of creating the file interacts with the
umask to control the recorded file permissions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20040304/d522bdef/attachment-0002.bin 


More information about the users mailing list