projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30bc71e
)
Fix catpkgsplit() to validate the category part. This fixes
author
Zac Medico
<zmedico@gentoo.org>
Sat, 25 Sep 2010 10:10:42 +0000
(
03:10
-0700)
committer
Zac Medico
<zmedico@gentoo.org>
Sat, 25 Sep 2010 10:10:42 +0000
(
03:10
-0700)
vardbapi.cp_all() to reject invalid categories.
pym/portage/versions.py
patch
|
blob
|
history
diff --git
a/pym/portage/versions.py
b/pym/portage/versions.py
index e40866ef6954b3808099ec1c4eb6691d964dfa82..8ac32eb243ada6e97c072d66a607fcc486158c04 100644
(file)
--- a/
pym/portage/versions.py
+++ b/
pym/portage/versions.py
@@
-260,6
+260,7
@@
def _pkgsplit(mypkg):
return (m.group('pn'), m.group('ver'), rev)
+_cat_re = re.compile('^%s$' % _cat)
_missing_cat = 'null'
catcache={}
def catpkgsplit(mydata,silent=1):
@@
-288,7
+289,8
@@
def catpkgsplit(mydata,silent=1):
p_split = _pkgsplit(mydata)
elif len(mysplit)==2:
cat = mysplit[0]
- p_split = _pkgsplit(mysplit[1])
+ if _cat_re.match(cat) is not None:
+ p_split = _pkgsplit(mysplit[1])
if not p_split:
catcache[mydata]=None
return None