files recovery after rm?

Richard O'Keefe ok at cs.mu.oz.au
Mon Nov 13 17:41:27 AEST 1989


In article <15844 at bloom-beacon.MIT.EDU>,
jik at athena.mit.edu (Jonathan I. Kamens) flames at Moore:

>   As has already been pointed out to you, setting your umask to 077
> will cause all files created by you to have permissions ---rw-rw- or
> ---rwxrwx.  Meaning that you can't read them or execute them.

The thing about umask is that it is the COMPLEMENT of a mask, the bits
which are ON in the umask are the permissions which are to be DENIED.
So if you create a file with mode 0<u><g><o> when your umask is 0<0><7><7>
the <0> leaves the <u> permissions alone and the <7>s clear the <g> and
<o> permissions, making the result 0<u><0><0>.  For example, if I do
	creat("foo", 0666)
when my umask is     0077 what I get is 0600, or rw-------.  I'm afraid
Sro Kamens has it backwards.



More information about the Comp.unix.questions mailing list