Re: File permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Uttered Sean Kennedy <skennedy@xxxxxxxx>, 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.

Attachment: pgpaNmRkekHPk.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux