You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Alexis Huxley <ah...@gmx.net> on 2006/10/26 09:47:53 UTC
svnperms.py: won't match something it should match!
I've got a repository laid out like this:
foo/trunk/foo.c
foo/tags/release-1.0/foo.c
foo/tags/release-1.1/foo.c
foo/branches/bug-coredump/foo.c
bar/trunk/bar.c
bar/tags/release-0.1/bar.c
bar/branches/bug-crash-on-zero-val/bar.c
etc. I'm using a one line pre-commit hook calling:
svnperms.py -r "$1" -t "$2"
and using svnperms.py's conf file to enforce that
only 'admins' can create top-level directories
(alongside 'foo' and 'bar'). So I did:
[myrepo groups]
admins = alexis
[myrepo]
[^/]+/ = @admins(add,remove,update)
There are no other regexps specified. But this does
not allow 'alexis' to create the create directories:
Adding new-module
svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
error: you don't have enough permissions for this transaction:
you can't add new-module/
By changing the regexp to .* I have verified that
the hook is being called, calling svnperms.py, that
its conf file is being read, that the group is interpreted
correctly and that I am authenticated as a member of
the group, etc.
I cannot find any documentation for svnperms.py, but
have managed by experimentation and examining source
code to work out that:
- directories automatically get /-suffixed before
comparison with the regex
- all regexps are automatically surrounded by ^ and $
The regex does match the path as verified with:
perl -e '"new-module/" =~ m@^[^/]+/$@ && print "match\n";'
svnperms.py is the one available now at
http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/svnperms.py.
Any help/advice appreciated! Thanks!
Alexis
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org