summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-18 00:13:17 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-18 00:13:17 +0000
commita7ffe0d77f263b592f470dba6dac86aaa0d6b423 (patch)
tree646e33a197c96984d4976bc3717823fe609f8ad9 /pym
parentf88ccbcd7f42c880e6f2c741d114ba049064f904 (diff)
downloadportage-a7ffe0d77f263b592f470dba6dac86aaa0d6b423.tar.gz
portage-a7ffe0d77f263b592f470dba6dac86aaa0d6b423.tar.bz2
portage-a7ffe0d77f263b592f470dba6dac86aaa0d6b423.zip
If an problem is detected in dblink._security_check(), log it via elog so
that it's properly displayed in the foreground even when in background mode. svn path=/main/trunk/; revision=11118
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 0d6ae32eb..a52946942 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2344,20 +2344,31 @@ class dblink(object):
suspicious_hardlinks.append(path_list)
if not suspicious_hardlinks:
return 0
- from portage.output import colorize
- prefix = colorize("SECURITY_WARN", "*") + " WARNING: "
- showMessage(prefix + "suid/sgid file(s) " + \
- "with suspicious hardlink(s):\n",
- level=logging.ERROR, noiselevel=-1)
+
+ msg = []
+ msg.append("suid/sgid file(s) " + \
+ "with suspicious hardlink(s):")
+ msg.append("")
for path_list in suspicious_hardlinks:
for path, s in path_list:
- showMessage(prefix + " '%s'\n" % path,
- level=logging.ERROR, noiselevel=-1)
- showMessage(prefix + "See the Gentoo Security Handbook " + \
- "guide for advice on how to proceed.\n",
- level=logging.ERROR, noiselevel=-1)
+ msg.append("\t%s" % path)
+ msg.append("")
+ msg.append("See the Gentoo Security Handbook " + \
+ "guide for advice on how to proceed.")
+
+ self._eerror("preinst", msg)
+
return 1
+ def _eerror(self, phase, lines):
+ from portage.elog.messages import eerror as _eerror
+ if self._scheduler is None:
+ for l in lines:
+ _eerror(l, phase=phase, key=self.settings.mycpv)
+ else:
+ self._scheduler.dblinkElog(self,
+ phase, _eerror, lines)
+
def treewalk(self, srcroot, destroot, inforoot, myebuild, cleanup=0,
mydbapi=None, prev_mtimes=None):
"""