From: Zac Medico Date: Sun, 12 Feb 2012 03:39:10 +0000 (-0800) Subject: xpak.unpackinfo: validate paths, bug #403149 X-Git-Tag: v2.2.0_alpha86~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b3cfb2065ccbeb8f769d630ff997c0327fb2eb35;p=portage.git xpak.unpackinfo: validate paths, bug #403149 --- diff --git a/pym/portage/xpak.py b/pym/portage/xpak.py index b507243c4..db2a2bc9e 100644 --- a/pym/portage/xpak.py +++ b/pym/portage/xpak.py @@ -1,4 +1,4 @@ -# Copyright 2001-2011 Gentoo Foundation +# Copyright 2001-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -246,16 +246,9 @@ def getitem(myid,myitem): return mydata[myloc[0]:myloc[0]+myloc[1]] def xpand(myid,mydest): + mydest = normalize_path(mydest) + os.sep myindex=myid[0] mydata=myid[1] - try: - origdir=os.getcwd() - except SystemExit as e: - raise - except: - os.chdir("/") - origdir="/" - os.chdir(mydest) myindexlen=len(myindex) startpos=0 while ((startpos+8)