diff options
author | 2011-07-13 19:04:12 +0100 | |
---|---|---|
committer | 2011-07-13 19:04:12 +0100 | |
commit | 79a31da2b8271f688abf286de274cf9ed7929dc8 (patch) | |
tree | 5a4c3f3c85027defa463779056e5a04f324f124e | |
parent | 1be1a4d18cf2089765b7acf9059d0f6f1a91cbde (diff) | |
download | paludis-79a31da2b8271f688abf286de274cf9ed7929dc8.tar.gz paludis-79a31da2b8271f688abf286de274cf9ed7929dc8.tar.xz |
Wrap reduced_uid/gid
-rw-r--r-- | python/environment.cc | 10 | ||||
-rwxr-xr-x | python/environment_TEST.py | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/python/environment.cc b/python/environment.cc index df754c9a2..32a2794c8 100644 --- a/python/environment.cc +++ b/python/environment.cc @@ -514,6 +514,16 @@ void expose_environment() "Return true if the first repository is more important than the second." ) + .def("reduced_uid", &Environment::reduced_uid, + "reduced_uid() -> int\n" + "User id to use when reduced privs are permissible." + ) + + .def("reduced_gid", &Environment::reduced_gid, + "reduced_gid() -> int\n" + "Group id to use when reduced privs are permissible." + ) + .add_property("repositories", bp::range(&Environment::begin_repositories, &Environment::end_repositories), "[ro] Iterable of Repository\n" diff --git a/python/environment_TEST.py b/python/environment_TEST.py index 860a6820f..ce8f5bce1 100755 --- a/python/environment_TEST.py +++ b/python/environment_TEST.py @@ -57,6 +57,10 @@ class TestCase_01_Environments(unittest.TestCase): self.assertRaises(NoSuchPackageError, self.e.fetch_unique_qualified_package_name, "bar", Filter.SupportsUninstallAction()) + def test_25_reduced(self): + self.assert_(self.e.reduced_uid() >= 0) + self.assert_(self.e.reduced_gid() >= 0) + class TestCase_03_TestEnvironment(unittest.TestCase): def test_01_create(self): e = TestEnvironment() |