[darcs-devel] Any answers for IsiSetup's concerns?
droundy at darcs.net
Thu Dec 20 12:10:44 UTC 2007
On Thu, Dec 13, 2007 at 06:53:07PM +0000, Ian Lynagh wrote:
> On Wed, Dec 12, 2007 at 12:14:15PM -0500, David Roundy wrote:
> > I don't think so, I think that having darcs manage permissions would
> > be like having it manage file ownership. We could do that, but file
> > ownership is meaningless on most other computers. Similarly the
> > meaning of "g" and "o" are different on each computer, since the group
> > is different, and the set of users with access to the computer are
> > different.
> I think we can do this with a layer of indirection. For example,
> "darcs init/get/put" could make a file _darcs/prefs/permissions which
> for me (on Linux with uid=ian, gid=ian) contains something like
> default ian ian 0600
> executable ian ian 0700
> On Windows it would probably look different, and perhaps we could also
> support Linux ACLs, SE Linux, etc. You'd be able to do something like
> darcs addpermissiongroup executable anotherExecutableGroup
> to make a new line in _darcs/prefs/permissions that would initially be
> a copy of executable (you couldn't just alter it by hand, as then other
> repos wouldn't know which one to copy (unless they defaulted to copying
This sounds scary to me. It looks like it'd have all the problems that
setpref has, and I'd rather not repeat that mistake (or at least keep using
the same implementation of that mistake).
I'd say that (if we went with this idea) we should not define this command,
but instead use the existing setpref mechanism, perhaps to work like
boring, where they can point the permissions at a file of their choice
(e.g. one in the repository).
> You could then "darcs setpermissions executable myScript; darcs rec".
> The permission group for a file would have to be stored under _darcs
> somwehere. "darcs rec" could either warn if you change the permissions
> with chmod, and it could even try to guess which group you wanted it in.
This is the problem with your approach. Because we're now storing "extra"
information, we are required to implement an extra database. Yuck. Just
for people who want to use darcs for something other than source code. Not
only that, but it complicates the UI for the one permissions feature that
generally makes sense, which is the execute bit. As long as we restrict
ourselves to the execute bit, it's very easy to treat it just like any
other file modification, and users can use chmod as usual. It's easy on
users and easy on us. That seems like just the right combination.
Perhaps what we really need is someone to develop a simple posthook script
to manage a permissions database. There are lots of nice programming
languages in the world in which one could write a very short script that
implemented all of this functionality *outside of darcs*. Darcs is good at
managing files, such as simple text file databases, and I don't see the
benefit is in putting all this complexity into darcs itself.
> Has anyone looked at what other RCSs, BTW?
I know git takes the standpoint that managing anything but the execute bit
Department of Physics
Oregon State University
More information about the darcs-devel