umask and rsh
Mark J. Kilgard
mjk at puffed.rice.edu
Sat Nov 25 16:57:39 AEST 1989
Sun-spots readers,
I have written a maketool application which allows the user to perform
"remote" makes by rsh'ing to the specified machine and then cd'ing to the
correct directory and performing the specified make. Everything works
cool except for one small problem.
The problem is that I have noticed when other users use the program, the
files created by the make ended up being writable by everyone (ie, 0666
permissions). But strangely the behavior did not happen to me. It turns
out I explicitly set my umask in my .cshrc and the other users didn't.
It seems rsh doesn't set your umask to 022 by default as a login or rlogin
does. Example (have taken "umask 022" out of my .cshrc):
puffed:/snowy/mjk#121 -> ls -l hello
ls: hello: No such file or directory
puffed:/snowy/mjk#122 -> rsh snowy touch hello
puffed:/snowy/mjk#123 -> ls -l hello
-rw-rw-rw- 1 mjk staff 0 Nov 24 23:50 hello
puffed:/snowy/mjk#125 -> rsh snowy umask
0
Is there a reason for this? Since a umask of 0 is not generally what
users want, should users be advised to explicitly set their umask then -
or risk rsh biting them.
- Mark Kilgard
Rice University
<mjk at rice.edu>
More information about the Comp.sys.sun
mailing list