[darcs-users] group repo page on wiki

Wolfgang Jeltsch g9ks157k at acme.softbase.org
Thu Jul 26 16:25:57 UTC 2012


Am Donnerstag, den 26.07.2012, 16:34 +0100 schrieb Eric Kow:
> On 24 Jul 2012, at 09:02, Wolfgang Jeltsch wrote:
> > 
> >    • In step 4, you assume that the user uses an umask which grants the
> >      group read rights (and execution rights for directories) by
> >      default. This is not necessarily the case, since 077 is also a
> >      typical umask, especially in environments where the default group
> >      of a user is “users“ instead of a dedicated group for the user.
> 
> Are you referring to
> 
>    chmod -R g+ws /srv/repos/cool-project
> 
> and saying we should throw an 'r' in there as well?

Yes, and you should also include a capital X, so that directories get
execution permissions (but ordinary files don’t). So the command would
be this:

    chmod -R g+rwXs /srv/repos/cool-project

Or without the -R (see below).

> >    • I would swap steps 3 and 4. That way, you do not need the -R
> >      switch for chmod.
> 
> Alas! I don't think this works. Perhaps the fault of Darcs?

Indeed it doesn’t work if your umask doesn’t grant the group all
permissions. Unfortunately I only considered inheritance of the SGID
flag and the group (cool-people). This works.

> >    • In step 5, you do not need the chown/chgrp, as the SGID bit of the
> >      enclosing directory has already been set. 
> 
> This might be Darcs being bad again, sorry!

No, the file _darcs/prefs/defaults is created using echo and redirection
of stdout. This is entirely done by the shell (no darcs involved), and
it works.

> It needs a more thorough approach of trying to following instructions
> verbatim (maybe script them) and seeing what happens (or of course,
> deeply understanding how darcs behaves wrt permissions, etc)

I always supposed that darcs just uses ordinary file opening library
functions and such and cares only about permissions insofar as it
interprets the umask option. This should be sensible. In particular,
default OS behavior will ensure that the group ID and the SGID flag for
directories are inherited.

Best wishes,
Wolfgang



More information about the darcs-users mailing list