From: Zac Medico Date: Thu, 18 Jan 2007 20:37:24 +0000 (-0000) Subject: Validate ebuild names inside portdbapi.cp_list() in order to prevent problems later... X-Git-Tag: v2.1.2-r3~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e402103396709dabbb38f7ae0a6707fc6a0477f3;p=portage.git Validate ebuild names inside portdbapi.cp_list() in order to prevent problems later on. Thanks to delusions for reporting on irc. svn path=/main/trunk/; revision=5713 --- diff --git a/pym/portage.py b/pym/portage.py index 4acb1e201..69f636214 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6033,8 +6033,14 @@ class portdbapi(dbapi): mytrees = self.porttrees for oroot in mytrees: for x in listdir(oroot+"/"+mycp,EmptyOnError=1,ignorecvs=1): - if x[-7:]==".ebuild": - d[mysplit[0]+"/"+x[:-7]] = None + if x.endswith(".ebuild"): + pf = x[:-7] + ps = pkgsplit(pf) + if not ps: + writemsg("\nInvalid ebuild name: %s\n" % \ + os.path.join(oroot, mycp, x), noiselevel=-1) + continue + d[mysplit[0]+"/"+pf] = None return d.keys() def freeze(self):