aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-07-13 19:04:12 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-07-13 19:04:12 +0100
commit79a31da2b8271f688abf286de274cf9ed7929dc8 (patch)
tree5a4c3f3c85027defa463779056e5a04f324f124e
parent1be1a4d18cf2089765b7acf9059d0f6f1a91cbde (diff)
downloadpaludis-79a31da2b8271f688abf286de274cf9ed7929dc8.tar.gz
paludis-79a31da2b8271f688abf286de274cf9ed7929dc8.tar.xz
Wrap reduced_uid/gid
-rw-r--r--python/environment.cc10
-rwxr-xr-xpython/environment_TEST.py4
2 files changed, 14 insertions, 0 deletions
diff --git a/python/environment.cc b/python/environment.cc
index df754c9..32a2794 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 860a682..ce8f5bc 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()