Named Pipe Creation

Phil Cornes pc at cs.keele.ac.uk
Tue Jul 4 00:22:51 AEST 1989


>From article <163 at cerc.wvu.wvnet.edu.edu>, by drs at cerc.wvu.wvnet.edu (Darrell Schiebel):
> I am attempting to create a named pipe which several different users
> can read from and write to, but ......
> 
> the system creates a pipe with owner r/w, group r, and world r.  The
> protection I was expecting is owner r/w , group r/w, wnd world r/w.
> 

The simplest explanation for this is that somewhere in your login sequence
the command:

	umask 022

gets executed. What umask(1) does is to specify a pattern of permission bits
that will definitely be reset to 0 whenever a file is created whatever file
permission bits are given in the system call that creates the file.

What you must do is to issue a new umask(1) command (so that the group and
world write permission bits are not reset) before you run your program, or
issue a umask(2) system call from within your program to achieve the same
effect.


Phil Cornes          I just called to say .....
-----------*
                     JANET: cdtpc at uk.ac.stafpol.cr83
                     Phone: +44 (0)785 53511 x6058
                     Smail: Staffordshire Polytechnic, Computing Department
                            Blackheath Lane, STAFFORD, ST18 0AD, ENGLAND.



More information about the Comp.unix.questions mailing list