From da3c537d80fa90c27a3ff9f2c80082a51d1dbd2c Mon Sep 17 00:00:00 2001 From: SARL ENR 68 Date: Fri, 28 Aug 2015 20:18:29 +0200 Subject: Use systemctl instead of consolehelper (mga#16084) - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6935 --- src/msec/plugins/msec.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/msec/plugins/msec.py b/src/msec/plugins/msec.py index fa8a41d..390a637 100755 --- a/src/msec/plugins/msec.py +++ b/src/msec/plugins/msec.py @@ -65,6 +65,7 @@ SYSLOGCONF = '/etc/syslog.conf' XDM = '/etc/pam.d/xdm' XSERVERS = '/etc/X11/xdm/Xservers' EXPORT = '/root/.xauth/export' +SYSTEMCTL = '../bin/systemctl' # regexps # X server @@ -75,8 +76,6 @@ GDMCONF_REGEXP = '(\s*command=.*/X.*?) -nolisten tcp(.*)$' KDMRC_REGEXP = re.compile('(.*?)-nolisten tcp(.*)$') # ctrl-alt-del CTRALTDEL_REGEXP = '^ca::ctrlaltdel:/sbin/shutdown.*' -# consolehelper -CONSOLE_HELPER = 'consolehelper' # ssh PermitRootLogin PERMIT_ROOT_LOGIN_REGEXP = '^\s*PermitRootLogin\s+(no|yes|without-password|forced-commands-only)' # tcp_wrappers @@ -330,10 +329,10 @@ class msec: if val_shutdownallow or not val_shutdown or not val_poweroff or not val_reboot or not val_halt: self.log.info(_('Allowing reboot and shutdown to the console user')) shutdownallow.exists() and shutdownallow.move(SUFFIX) - shutdown.exists() or shutdown.symlink(CONSOLE_HELPER) - poweroff.exists() or poweroff.symlink(CONSOLE_HELPER) - reboot.exists() or reboot.symlink(CONSOLE_HELPER) - halt.exists() or halt.symlink(CONSOLE_HELPER) + shutdown.exists() or shutdown.symlink(SYSTEMCTL) + poweroff.exists() or poweroff.symlink(SYSTEMCTL) + reboot.exists() or reboot.symlink(SYSTEMCTL) + halt.exists() or halt.symlink(SYSTEMCTL) if val_sysctlconf == '0': self.log.info(_('Allowing SysRq key to the console user')) sysctlconf.set_shell_variable('kernel.sysrq', 1) -- cgit v1.2.1