[RndTbl] How does umask really work?

John Lange john.lange at open-it.ca
Thu Feb 10 11:19:08 CST 2005

On Thu, 2005-02-10 at 10:30, Gilles Detillieux wrote:
> No, the other remaining question is why you think whatever "foo" the
> shell spits out to a file should be executable by default?  One would
> hope that a bit of thought would go into the creation of an executable
> file, whether a binary or a script.  Why make this the default, when the
> majority of regular files on a file system don't contain executable code?

Of course some thought should go into it but thats not the point. I just
don't agree that just because we can't think of a good reason to do it
on our system that it shouldn't be possible for anyone.

> But a umask of 133 would turn off execute (i.e. search or traversal)
> permission on new directories by default.

Which is another flaw in umask. It should be:

Umask [ Umask file octal-mask [directory octal-mask]]

(Which is how it is implemented in proftpd)

>   So, either you're stuck
> manually turning off execute permission on the majority of regular files
> you create, or you're stuck manually turning on execute permission on
> all the directories you create.

Wouldn't a default of 700 for directories make the most sense for the
majority of users anyhow?

>   This makes more sense that having to
> manually chmod the few executable script files you're likely to create,
> after thinking about whether the code really is ready to execute?

I agree that this method makes more sense given that there is no way to
specify file masks and directory masks separately.

John Lange

More information about the Roundtable mailing list