Use EROOT to validate path arguments.
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Oct 2011 03:20:29 +0000 (20:20 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Oct 2011 03:20:29 +0000 (20:20 -0700)
bin/portageq
pym/_emerge/actions.py
pym/_emerge/depgraph.py

index 40cc21d27472a3ffb2016e660d155d03caf6c7db..66f6509d76d017cc6e61059bc1fd4f8d355a69e2 100755 (executable)
@@ -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 <root>!\n")
                        sys.stderr.flush()
                        return 2
index 88f59586665fa0fec315c4467edebcfa4778ce6b..d482e0ba15f7f33bc360a8531ecd593ae94a9d14 100644 (file)
@@ -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.
index fc65f6140d834b29fb88fa3cba0049c166ffc4bc..fcdcc6c4ebf0e2fdecd5f38e74068b9231bd63c5 100644 (file)
@@ -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)