You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael W Thelen <mi...@pietdepsi.com> on 2005/08/18 17:23:14 UTC
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Chris Leishman wrote:
> The '[' character is a legitimate start to a regular expression - for
> example in '[^/]+/tags' to match a tags directory inside any single
> parent directory. Unfortunately, the regex match for section headers
> treats such a regex as the start of a new section (named '^/').
>
> This patch fixes that behaviour by making the section match check that
> nothing follows the section header on the line.
Thanks for the patch. It looks like no one has reviewed or commented on
this patch since it was posted. I don't know Python, but knowing Perl
regular expressions, it looks like this change simply allows regular
expressions beginning with [ not to be misrecognized as section headers.
Of course, regular expressions consisting entirely of a single
character class will still be interpreted as section headers. But that
doesn't seem like a very likely regular expression to be used in the
permissions config file.
Any objections to this patch being applied? I'll file it as a patch
issue in a day or two if no one comments.
--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes. -- Douglas Adams
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Posted by Branko Čibej <br...@xbc.nu>.
Michael W Thelen wrote:
>Chris Leishman wrote:
>
>
>>The '[' character is a legitimate start to a regular expression - for
>>example in '[^/]+/tags' to match a tags directory inside any single
>>parent directory. Unfortunately, the regex match for section headers
>>treats such a regex as the start of a new section (named '^/').
>>
>>This patch fixes that behaviour by making the section match check that
>>nothing follows the section header on the line.
>>
>>
>
>Thanks for the patch. It looks like no one has reviewed or commented on
>this patch since it was posted. I don't know Python, but knowing Perl
>regular expressions, it looks like this change simply allows regular
>expressions beginning with [ not to be misrecognized as section headers.
> Of course, regular expressions consisting entirely of a single
>character class will still be interpreted as section headers. But that
>doesn't seem like a very likely regular expression to be used in the
>permissions config file.
>
>Any objections to this patch being applied? I'll file it as a patch
>issue in a day or two if no one comments.
>
>
Why can't one just write ([x]) instead of [x]? It matches the same thing.
Also, I can't help wondering why svnperms.py parses its config file
itself instead of using Python's ConfigParser...
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Posted by David James <ja...@gmail.com>.
On 8/18/05, Marc Sherman <ms...@projectile.ca> wrote:
> > Since you already have magic section names, i.e., [section groups], you
> > could define inheritance in a similar way. For example:
> >
> > [parent]
> > ...
> > [section extends parent]
> > [section]
> > ...
>
> Well, the problem there is that it breaks backwards compatibility.
> "section extends parent" was previously a valid section name, and this
> change will make it silently behave differently. I suppose its very
> unlikely that someone would name a section that without intending
> inheritance, though. Any other thoughts?
I think Brane's suggested syntax is good. I don't think we need to
worry about breaking compatibility -- this is a very safe change.
Cheers,
David
--
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Posted by Marc Sherman <ms...@projectile.ca>.
Branko Čibej wrote:
>
> I don't like that. I'd really prefer it if svnperms.py started using
> ConfigParser for parsing the config file. There's nothing in the current
> config file that would prevent that, but if you add this syntax, the
> game's over.
>
> I'm not saying you should make this change yourself, only that any
> syntax change should maintain ConfigParser compatiblity.
Ok, that's a good point.
> Since you already have magic section names, i.e., [section groups], you
> could define inheritance in a similar way. For example:
>
> [parent]
> ...
> [section extends parent]
> [section]
> ...
Well, the problem there is that it breaks backwards compatibility.
"section extends parent" was previously a valid section name, and this
change will make it silently behave differently. I suppose its very
unlikely that someone would name a section that without intending
inheritance, though. Any other thoughts?
- Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Posted by Branko Čibej <br...@xbc.nu>.
Marc Sherman wrote:
> Michael W Thelen wrote:
>
>>
>> Any objections to this patch being applied? I'll file it as a patch
>> issue in a day or two if no one comments.
>
>
> Well, the patch would conflict with my pending patch to add section
> inheritance... is that grounds for an objection? How are conflicting
> patches for unreleated issues usually handled on this list? Is it up
> to the submitter of whichever one doesn't get applied first to
> resubmit a new patch?
In general, yes. Of course, that doesn't mean that patch contributors
shouldn't talk to each other and coordinate their changes. :)
Anyway, as I said before, I don't see a good reason why this patch
should be applied, given that there's a simple workaround.
Regarding section inheritance: I see you proposed a syntax that looks
like this:
[parent]
...
[section] inherits [parent]
...
I don't like that. I'd really prefer it if svnperms.py started using
ConfigParser for parsing the config file. There's nothing in the current
config file that would prevent that, but if you add this syntax, the
game's over.
I'm not saying you should make this change yourself, only that any
syntax change should maintain ConfigParser compatiblity.
Since you already have magic section names, i.e., [section groups], you
could define inheritance in a similar way. For example:
[parent]
...
[section extends parent]
[section]
...
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix to svnperms.py to allow regex's that start with '['
Posted by Marc Sherman <ms...@projectile.ca>.
Michael W Thelen wrote:
>
> Any objections to this patch being applied? I'll file it as a patch
> issue in a day or two if no one comments.
Well, the patch would conflict with my pending patch to add section
inheritance... is that grounds for an objection? How are conflicting
patches for unreleated issues usually handled on this list? Is it up to
the submitter of whichever one doesn't get applied first to resubmit a
new patch?
- Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org