tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: umask question
@ 1998-07-29 17:55 SIMEONE, Allan J.
  0 siblings, 0 replies; only message in thread
From: SIMEONE, Allan J. @ 1998-07-29 17:55 UTC (permalink / raw)
  To: tru64-unix-managers

Following is the summary to my question about umask.  Doesn't seem
possible
to create a file with rwxrwxr-x as the default unless using some kind of
wrapper with
a chmod in it.

thanks for replies from:

alan@nabeth.cxo.dec.com
rrodrigu@ssc.wisc.edu
oisin@sbcm.com

and replies are still coming in but I get the point :-)

original question follows summary.

in summary...

Unfortunately, you will not be able to use a umask to control this.
In csh, tcsh, bash, and sh, the umask is a shell built-in command.
This comes from the csh man page (the most technically clear 
statement):

     umask [ value ]
               Display the file creation mask.   With  value  set
               the  file creation mask.  value is given in octal,
               and is XORed with the permissions of 666 for files
               and  777  for directories to arrive at the permis-
               sions for new files.  Common values  include  002,
               giving complete access to the group, and read (and
               directory search) access to others, or 022, giving
               read  (and directory search) but not write permis-
               sion to the group and others.
               .
               .
               .
	Depending on how the file is created, some type of wrapper might
	do the trick.

and...

           The creat(2) and open(2) system calls have a mask argument
	that is used with the umask to create the initial mask of
	a file.  If the particular application didn't see fit to
	allow files to be created with the execute permission turned
	on, there's no way umask can change it.  Example:

		fd = open("file", O_CREAT, 0644) ;

	The mask of 0644 limits the permission to 0644 at most.  The
	umask only turns off bits.  However, if the caller of open
	had used 0777, then any reasonable permission is possible.


original question follows...
>----------
>From: 	SIMEONE, Allan J.
>Sent: 	Wednesday, July 29, 1998 1:09PM
>To: 	'alpha-osf-managers@ornl.gov'
>Subject: 	umask question
>
>Hi,
>
>We need to create a file with the default permissions rwxrwxr-x.  Can
>this be done
>by setting the umask?  I would think setting the umask to 002 would do
>this, but
>it creates the file as rw-rw-r--.  Do I have to change anything else for
>this to take effect?
>
>thanks,
>Allan
>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-07-29 17:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-29 17:55 SUMMARY: umask question SIMEONE, Allan J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox