Possibly over-cautious check in workingtree_4.py?

Blake Winton bwinton at latte.ca
Thu Aug 23 00:08:19 BST 2007


John Arbash Meinel wrote:
>> I'm trying to add a file named "rcp2pr... #segment.0020#".
>>
>> I've changed the assert on my local copy to:
>>             assert not f.startswith( '..' )
>>             assert '//..' not in f
>> Which I think should be good enough, but I'ld like confirmation that
>> this seems like a semi-sane thing to do before I go ahead and submit a
>> bundle/bug report.
>
> I think that should be:
> 
> assert not f.startswith('../')
> assert '/../' not in f

I was thinking that, but I seem to remember a system that let you type 
"cd ..." to get to the parent's parent, (and "cd ...." to get to the 
parent's parent's parent,) and I didn't want to let that slip through, 
on the off chance that that system still exists...

should we move to regular expressions?
assert not re.match( '..+/', f )
assert not re.search( '/..+/', f )

Later,
Blake.





More information about the bazaar mailing list