aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-23 14:28:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-23 14:28:02 +0000
commite019482551d0498560952392fedc4eb2683df194 (patch)
tree245ec8ca186d04b253052e802e8d7f6b5e1bac17
parent30bef260190fd8a1488bce7d9e99338dbe2d1198 (diff)
downloadpaludis-e019482551d0498560952392fedc4eb2683df194.tar.gz
paludis-e019482551d0498560952392fedc4eb2683df194.tar.xz
Better error message
-rw-r--r--paludis/environments/paludis/paludis_config.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 01aa5bc..ed6d8ed 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -506,25 +506,29 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
FSPath tty_0("/dev/pts/0");
FSStat tty_0_stat(tty_0);
- bool tty_ok(true);
+ std::string tty_error;
if (tty_0_stat.exists())
{
::gid_t gids[100];
int g(100);
if ((g = ::getgrouplist(reduced_username().c_str(), reduced_gid(), gids, &g)) != -1)
- tty_ok = (gids + g != std::find(gids, gids + g, tty_0_stat.group()));
+ {
+ if (! (gids + g != std::find(gids, gids + g, tty_0_stat.group())))
+ tty_error = " (user " + reduced_username() + " is not in group " + stringify(tty_0_stat.group()) + ")";
+ }
else
- tty_ok = false;
+ tty_error = " (could not determine group list for user " + reduced_username() + ")";
}
else
- tty_ok = false;
+ tty_error = " (unable to stat /dev/pts/0)";
- if (! tty_ok)
+ if (! tty_error.empty())
{
Log::get_instance()->message("paludis_environment.userpriv.tty", ll_warning, lc_context)
<< "Cannot verify that we have sufficient permissions to use PTYs properly "
- "using userpriv. Strange breakages may occur. You should ensure that the '"
+ "using userpriv"
+ << tty_error << ". Strange breakages may occur. You should ensure that the '"
<< reduced_username() << "' user is in the group to which /dev/pts/0 belongs";
}