From a7ffe0d77f263b592f470dba6dac86aaa0d6b423 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 18 Jul 2008 00:13:17 +0000 Subject: [PATCH] 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 --- pym/portage/dbapi/vartree.py | 31 +++++++++++++++++++++---------- 1 file 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): """ -- 2.26.2