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

Re: standard filepermissions



Lo, on Tuesday, June 19, bernd b did write:

> Hi,
> 
> In DEBIAN new directories are made
> drwxr-sr-x. Of course this can be changed with umask
> But where is the default file permission and the setgid bit set?
> How should i create dirs which are default drwxr-xr-x; without the gid bit 
> set?

Actually, this applies only to home directories and a few others, not in
general.  (Be aware that if you're creating a directory within a directory
that has the setgid bit set, the new one will also have the setgid bit set.)

> Also some dirs do not have execute permission for group and then have
> drwxr-S***. Why is this "S", and why have the setgid on anyway when group 
> itself cannot execute, thus groupid cannot be set?

Well, this would mean that any files created within the directory would
have their gid set to the directory's gid, but that members of that group
could not search the directory (unless they happen to be the owner of the
directory).  I must admit, I can't really think of an application for this
right off-hand.

If they're normal files, not directories, then (for instance) -rw-r-Sr--
indicates to the kernel that mandatory file locking is in place---see
stat(2) for details.  Well, on Linux, anyway; other Unices interpret this
differently.

Richard



Reply to: