aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2016-04-17 11:35:47 +0200
committerPapoteur <papoteur@mageialinux-online.org>2016-04-17 11:35:47 +0200
commited6bc6f637c308693795fabe1d6fd9cfb095ac69 (patch)
treea925df514e73f4ebec9667985053557c2df98427
parent79a52d9f3740719917e79cac835e7721393763b6 (diff)
downloadmsec-ed6bc6f637c308693795fabe1d6fd9cfb095ac69.tar
msec-ed6bc6f637c308693795fabe1d6fd9cfb095ac69.tar.gz
msec-ed6bc6f637c308693795fabe1d6fd9cfb095ac69.tar.bz2
msec-ed6bc6f637c308693795fabe1d6fd9cfb095ac69.tar.xz
msec-ed6bc6f637c308693795fabe1d6fd9cfb095ac69.zip
Use systemctl instead of consolehelper (mga#16084)
-rwxr-xr-xsrc/msec/plugins/msec.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/msec/plugins/msec.py b/src/msec/plugins/msec.py
index 16deef2..77c9b2c 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)