aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-25 23:29:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-25 23:29:01 +0000
commitd68ac062d7db4c56ad144008aeb5a1ac668e7930 (patch)
tree3a00a6948223a4c5b3802f6558d03d063ac6a08b
parent94cb55dfd0c230172979134824ed9c22cf11deb7 (diff)
downloadpaludis-d68ac062d7db4c56ad144008aeb5a1ac668e7930.tar.gz
paludis-d68ac062d7db4c56ad144008aeb5a1ac668e7930.tar.xz
More verbose paludis --info output
-rw-r--r--NEWS6
-rw-r--r--src/clients/paludis/info.cc19
2 files changed, 25 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index ca25e3f..c4096fe 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,12 @@ News for Paludis
This file lists the major changes between versions. For a more detailed list
of every change, see the ChangeLog.
+trunk/:
+ * STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
+ dep specs.
+
+ * More verbose paludis --info output.
+
0.26.0_alpha2:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
dep specs.
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 032ef25..ec58c0a 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;