From: Zac Medico Date: Sat, 29 Oct 2011 03:20:29 +0000 (-0700) Subject: Use EROOT to validate path arguments. X-Git-Tag: v2.2.0_alpha72~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b30bb192825fbc4f35225aa2334655b4ba7329f5;p=portage.git Use EROOT to validate path arguments. --- diff --git a/bin/portageq b/bin/portageq index 40cc21d27..66f6509d7 100755 --- a/bin/portageq +++ b/bin/portageq @@ -271,7 +271,7 @@ def owners(argv): return 2 f = os.path.join(cwd, f) f = portage.normalize_path(f) - if not is_basename and not f.startswith(root): + if not is_basename and not f.startswith(eroot): sys.stderr.write("ERROR: file paths must begin with !\n") sys.stderr.flush() return 2 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 88f595866..d482e0ba1 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2559,7 +2559,7 @@ def action_uninstall(settings, trees, ldpath_mtimes, elif x.startswith(os.sep): if not x.startswith(eroot): writemsg_level(("!!! '%s' does not start with" + \ - " $ROOT.\n") % x, level=logging.ERROR, noiselevel=-1) + " $EROOT.\n") % x, level=logging.ERROR, noiselevel=-1) return 1 # Queue these up since it's most efficient to handle # multiple files in a single iter_owners() call. diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index fc65f6140..fcdcc6c4e 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2045,9 +2045,9 @@ class depgraph(object): args.append(PackageArg(arg=x, package=pkg, root_config=root_config)) elif x.startswith(os.path.sep): - if not x.startswith(root): + if not x.startswith(eroot): portage.writemsg(("\n\n!!! '%s' does not start with" + \ - " $ROOT.\n") % x, noiselevel=-1) + " $EROOT.\n") % x, noiselevel=-1) self._dynamic_config._skip_restart = True return 0, [] # Queue these up since it's most efficient to handle @@ -2056,9 +2056,9 @@ class depgraph(object): elif x.startswith("." + os.sep) or \ x.startswith(".." + os.sep): f = os.path.abspath(x) - if not f.startswith(root): + if not f.startswith(eroot): portage.writemsg(("\n\n!!! '%s' (resolved from '%s') does not start with" + \ - " $ROOT.\n") % (f, x), noiselevel=-1) + " $EROOT.\n") % (f, x), noiselevel=-1) self._dynamic_config._skip_restart = True return 0, [] lookup_owners.append(f)