aboutsummaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/paludis/info.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 032ef2510..ec58c0a36 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -33,6 +33,9 @@
#include <iomanip>
#include <libebt/libebt.hh>
#include <libwrapiter/libwrapiter.hh>
+#include <sys/types.h>
+#include <pwd.h>
+#include <grp.h>
using namespace paludis;
using std::endl;
@@ -122,6 +125,22 @@ do_info(const tr1::shared_ptr<const Environment> & env)
cout << endl;
+ cout << " " << colour(cl_heading, "Reduced Privs:") << endl;
+ cout << " " << std::setw(22) << std::left << "reduced_uid:" << std::setw(0) << " "
+ << env->reduced_uid() << endl;
+ const struct passwd * const p(getpwuid(env->reduced_uid()));
+ cout << " " << std::setw(22) << std::left << "reduced_uid->name:" << std::setw(0) << " "
+ << (p ? p->pw_name : "???") << endl;
+ cout << " " << std::setw(22) << std::left << "reduced_uid->dir:" << std::setw(0) << " "
+ << (p ? p->pw_dir : "???") << endl;
+ cout << " " << std::setw(22) << std::left << "reduced_gid:" << std::setw(0) << " "
+ << env->reduced_gid() << endl;
+ const struct group * const g(getgrgid(env->reduced_gid()));
+ cout << " " << std::setw(22) << std::left << "reduced_gid->name:" << std::setw(0) << " "
+ << (g ? g->gr_name : "???") << endl;
+
+ cout << endl;
+
cout << " " << colour(cl_heading, "Paths:") << endl;
cout << " " << std::setw(22) << std::left << ("DATADIR:") << std::setw(0) << " " << DATADIR << endl;