[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question on File Permissions



Am Son, 2002-09-22 um 22.36 schrieb Debian User:

> Ok, I am learning this umask util.  I'm confused, if you set the umask, 
> is that for any new file created on the linux system, or just the files 
> in the paticular directory that the umask command was run in?
> 
> This isn't listed on the man page or in my book.

ok, here are two hints:

from the bash-help:
==============================================================
umask: umask [-S] [mode]
The user file-creation mask is set to MODE.  If MODE is omitted, or if
-S' is supplied, the current value of the mask is printed.  The `-S'
option makes the output symbolic; otherwise an octal number is output.
If MODE begins with a digit, it is interpreted as an octal number,
otherwise it is a symbolic mode string like that accepted by chmod(1).
==============================================================

or better description (user comments!):

http://www.php.net/manual/en/function.umask.php

the umask just applies to newly created files or directories.

> Basically I just want to grant exe permission to the world ONLY on new 
> files created in the USERS web directorys, just to save them the hassle 
> of manually changing it, I DON'T want to give .exe status to any new 
> file created on my linux box by default.

as described above only the fopen, mkdir,... calls AFTER the umask are
influenced. and it depends on the server side language you are using, if
you have to reset the umask before the end of the script.

and: i am not sure if the umask works for uploads. because i.e. php
creates a tmp-file. but this happens before the php-code is reached. so
setting the umask is only working if you copy the files by hand.

but i think for a better help you should consult a mailinglist/news
group which discusses problems for the specific language.

cu



Reply to: