[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: subversion authz wildcard

From: Stefan Sperling <stsp_at_elego.de>
Date: Thu, 31 Mar 2011 14:25:25 +0200

On Wed, Mar 30, 2011 at 09:43:27PM -0700, Michael Mac (Palm GBU) wrote:
> Hi,
>
> I'd to query the user community to know if there's been any progress
> in using wildcards with authz? Is there a work around for this? There
> was previous mentioned that version 1.7 may have this feature
> enhancement, but not a guarantee.

See http://subversion.tigris.org/issues/show_bug.cgi?id=2662
You can add yourself to the Cc list there to get progress information
via email.

I took a look at one of the patch submissions we've received for this.
Unfortunately, it didn't qualify, see
http://subversion.tigris.org/issues/show_bug.cgi?id=2662#desc20
If we decide to disallow leading wildcard characters, though,
that patch would work.

There is another patch submission, against an old version of Subversion.
The approach it is taking seems to be workable.
However, applying this patch on top of trunk is a huge chunk of work.
We'll also need to find out whether it's actually usable in practice,
since it needs to crawl a lot of paths in a repository in case of
wildcards such as */tags (as explained in the issue).
So while it might work, performance might turn out to be dismal
for large repositories.

> On related topic others have
> mentioned that svnperms.py can support wildcard. I have confirmed
> svnperms.py can support wildcard,
>

It only seems to support trailing wildcards (i.e. /trunk/* but not */tags).

> but my problem is svnperms.py is it
> only accept single word username. My company is using both first name
> and last name for the user login name with a white space between them.
> i.e "firstname lastname". Svnperms.py doesn't seem to be able to
> support this structure. Does anyone know how I can modify svnperms.py
> to accept white space in user login name?

Does this patch help (untested)?
It should group usernames containing whitespace properly, provided
you use quoting in svnperms.conf:

  [groups]
  group1 = "Arthur Dent" Marvin 'Ford Prefect'

Index: tools/hook-scripts/svnperms.py
===================================================================
--- tools/hook-scripts/svnperms.py (revision 1086745)
+++ tools/hook-scripts/svnperms.py (working copy)
@@ -28,6 +28,8 @@
 
 import sys, os
 import getopt
+import shlex
+
 try:
   # Python >=3.0
   from subprocess import getstatusoutput as subprocess_getstatusoutput
@@ -129,7 +131,7 @@ class Permission:
     def parse_groups(self, groupsiter):
         for option, value in groupsiter:
             groupusers = []
- for token in value.split():
+ for token in shlex.split(value):
                 # expand nested groups in place; no forward decls
                 if token[0] == "@":
                     try:
Received on 2011-03-31 14:26:03 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.