[dokuwiki] Re: dmode permissions and 2006-09-28 rc1

  • From: Reinhold Kainhofer <reinhold@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 6 Oct 2006 00:49:13 +0200

Am Donnerstag, 5. Oktober 2006 23:34 schrieb Chris Smith:
> Maybe I am missing something here.
>
> Directory permissions are traditionally expressed in octal, hence the
> starting zero[1].

Nope, the starting zero does not come from the fact that the number is octal, 
but from the fact that the first three bits are not set in many cases!

> In *nix at least, the three bits in the triplet  
> correspond to execute, x; read, r; write w.  There are three triplets,
> owner/user (u), group (g), other/everyone else (o).  To try to express a
> value higher than octal 777 is meaningless.  

No, it's not, as you forget the set User ID, set Group ID and the sticky bit 
which is the first digit in the four-digitfirst bitfield.

See e.g. the manpage of chmod:

"A numeric mode is from one to four octal digits (0-7), derived by adding up 
the bits with values 4, 2, and 1.  Any omitted digits are assumed to be 
leading zeros.  The first digit selects the set user ID (4) and set group ID 
(2)  and  sticky  (1)  attributes. The second digit selects permissions for 
the user who owns the file: read (4), write (2), and execute (1); the third 
selects permissions for other users in the fileâs group, with the same 
values; and the fourth for other users not in the fileâs group,  with the 
same values."

In particular for shared hosts the set guid  attribute (2770) for directories 
is VERY, VERY handy, as it means that all files created in it are group-owned 
by the group of the directory. That means that you don't have to make the 
files in that dir world-writable to be able to write-access the file as a 
user other than the httpd user!

See also http://www.greenend.org.uk/rjk/2004/perms.html


> In fact if you attempted to 
> enter 4770 in the admin plugin/config settings, you would get an error.

But if you chmod a file to 4770, it means it has the setuid bit set 

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold@xxxxxxxxxxxxx, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: