aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-22 20:10:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-22 20:10:00 +0000
commit151ee7688bf59f888b2ef02345e7e8c2c4c67c40 (patch)
treeb36e8a1f51867da636ac6931e28196dc49cbc316
parent33cb9b45032db2c5a814e850c0d46ad5f22ed695 (diff)
downloadpaludis-151ee7688bf59f888b2ef02345e7e8c2c4c67c40.tar.gz
paludis-151ee7688bf59f888b2ef02345e7e8c2c4c67c40.tar.xz
More userpriv work
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc60
1 files changed, 36 insertions, 24 deletions
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index 51cc0a5..978b883 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -246,6 +246,8 @@ void
EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
const InstallOptions & o, std::tr1::shared_ptr<const PortageRepositoryProfile> p) const
{
+ Context context("When installing '" + stringify(q) + "-" + stringify(v) + "':");
+
if (! _imp->portage_repository->has_version(q, v))
{
throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
@@ -467,19 +469,24 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
if (fetch_userpriv_ok)
{
FSEntry f(_imp->params.distdir);
- if (f.group() != _imp->environment->reduced_gid())
- {
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(_imp->params.buildroot) + "' not owned by group '" +
- stringify(getgrgid(_imp->environment->reduced_gid())->gr_name) + "', cannot enable userpriv");
- fetch_userpriv_ok = false;
- }
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
+
+ if (f.exists())
{
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(_imp->params.buildroot) + "' does not group write permission," +
- "cannot enable userpriv");
- fetch_userpriv_ok = false;
+ if (f.group() != _imp->environment->reduced_gid())
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(_imp->params.buildroot) + "' not owned by group '" +
+ stringify(getgrgid(_imp->environment->reduced_gid())->gr_name) + "', cannot enable userpriv");
+ fetch_userpriv_ok = false;
+ }
+ else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(_imp->params.buildroot) + "' does not group write permission," +
+ "cannot enable userpriv");
+ fetch_userpriv_ok = false;
+ }
}
}
@@ -510,19 +517,24 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
if (userpriv_ok)
{
FSEntry f(_imp->params.buildroot);
- if (f.group() != _imp->environment->reduced_gid())
- {
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(_imp->params.buildroot) + "' not owned by group '" +
- stringify(getgrgid(_imp->environment->reduced_gid())->gr_name) + "', cannot enable userpriv");
- userpriv_ok = false;
- }
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
+
+ if (f.exists())
{
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(_imp->params.buildroot) + "' does not group write permission," +
- "cannot enable userpriv");
- userpriv_ok = false;
+ if (f.group() != _imp->environment->reduced_gid())
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(_imp->params.buildroot) + "' not owned by group '" +
+ stringify(getgrgid(_imp->environment->reduced_gid())->gr_name) + "', cannot enable userpriv");
+ userpriv_ok = false;
+ }
+ else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(_imp->params.buildroot) + "' does not group write permission," +
+ "cannot enable userpriv");
+ userpriv_ok = false;
+ }
}
}