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

Re: Valid Syntax for commit-access-control.cfg

From: David Weintraub <qazwart_at_gmail.com>
Date: Mon, 8 Feb 2010 13:21:36 -0500

In the commit-access-control.pl program itself, the user name is just
treated as a text string. However, I found your error message in the
near the top of the commit-access-control.pl program:

> my $cfg = Config::IniFiles->new(-file => $cfg_filename);
> unless ($cfg)
>  {
>    die "$0: error in loading configuration file `$cfg_filename'",
>         @Config::IniFiles::errors ? ":\n_at_Config::IniFiles::errors\n"
>                                   : ".\n";
>  }

This is the Config::IniFiles module giving an error in an attempt to
read the configuration file itself.

I just tested the latest version of the Config::IniFiles module
(version 2.52) and it is able to handle periods in user names. I
suspect that you are using an older version of this Perl module which
is having problems.

If you were comfortable with Perl, I'd suggest you install the latest
version of the Config::IniFiles module and see if that takes care of
the error. However, since you're not a Perl hacker, you're better
using the supported svnperms.py script which can do a lot more than
the older commit-access-control.pl script could.

On Sun, Feb 7, 2010 at 12:03 PM, Steven Hansen <runner_at_berkeley.edu> wrote:
>
> Hi David,
>
> I get an error like this:
>
> svn: 'pre-commit' hook failed with error output:
> /svn/repo/hooks/commit-access-control.pl: error in loading configuration
> file `/svn/repo/hooks/commit-access-control.cfg':
> Line 308 in file /svn/repo/hooks/commit-access-control.cfg is mal-formed:
>
> This has happened 3-4 times when various people have updated the file.  It
> is always a result of using a '.' in a user's name.
> I don't know perl very well and assumed it has to do with the '.' being
> interpreted as a regex character instead of a literal '.'
>
> I wasn't aware that svnperms.py is a replacement script.  I'll take a look
> and see if I can replace.
>
> Thanks!
> ~Steven
>
>
>
> David Weintraub wrote:
>>
>> What type of "error" are you getting? Is the script running, but not
>> giving you the results you expect (i.e., it rejects a commit that it
>> should accept or visa versa), or is the script erroring out with a
>> message?
>>
>> I'm looking at the code, and I really don't see an issue with periods
>> in the name since user names are white space separated. However, it
>> could be due to an error in the module "Config::IniFiles".
>>
>> Have you tried running the script by hand to see what you get? Have
>> you tried adding a few debug lines in the script to see why the user
>> ID isn't what you expect?
>>
>> This hook script has been replaced by the "svnperms.py" script, a
>> Python script. Have you tried that script.
>>
>> If you prefer a Perl script, you're also welcome to try my
>> configuration script which I wrote to specifically replace the
>> commit-access-control.pl script. You can get that here:
>> http://dl.dropbox.com/u/433257/hooks.zip.
>>
>> This does work with periods in the user names.
>>
>> On Wed, Feb 3, 2010 at 5:49 PM, Steven Hansen <runner_at_berkeley.edu> wrote:
>>
>>>
>>> Hi,
>>>
>>> I'm trying to find some documentation describing "valid" syntax for the
>>> commit-access-control.cfg
>>> file.  I've been bitten in the past by using something like:
>>>
>>> [SVN - config modification permissions]
>>> match   = ^SVN
>>> access  = read-write
>>> users   = first.lastname
>>>
>>> Having a '.' in the username causes errors.
>>>
>>> Also, does anyone know why does this cause errors?  If possible I'd like
>>> to
>>> include usernames that
>>> include the '.'
>>>
>>> Thanks,
>>> Steven
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>

--
David Weintraub
qazwart_at_gmail.com
Received on 2010-02-08 19:22:12 CET

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.