aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-01-20 15:53:32 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-01-20 15:53:32 +0000
commitdaee653c15a4c7dd65d95fb3d7d83004e0d6ce61 (patch)
tree95c2a77a74ee18eb67d598bb9c6778ebe8e8f53d /src
parent4fc8f778f709920af6afc22156b1865f68694607 (diff)
downloadmsec-daee653c15a4c7dd65d95fb3d7d83004e0d6ce61.tar
msec-daee653c15a4c7dd65d95fb3d7d83004e0d6ce61.tar.gz
msec-daee653c15a4c7dd65d95fb3d7d83004e0d6ce61.tar.bz2
msec-daee653c15a4c7dd65d95fb3d7d83004e0d6ce61.tar.xz
msec-daee653c15a4c7dd65d95fb3d7d83004e0d6ce61.zip
Fixed inittab handling.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/msec/libmsec.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py
index 0b7b26c..c9cc110 100755
--- a/src/msec/libmsec.py
+++ b/src/msec/libmsec.py
@@ -977,7 +977,7 @@ class MSEC:
kdmrc.set_shell_variable('AllowShutdown', 'All', 'X-:\*-Core', '^\s*$')
if not val_inittab:
self.log.info(_('Allowing Ctrl-Alt-Del from console'))
- inittab.replace_line_matching(CTRALTDEL_REGEXP, 'ca::ctrlaltdel:/sbin/shutdown -t3 -r now', 1)
+ inittab.exists() and inittab.replace_line_matching(CTRALTDEL_REGEXP, 'ca::ctrlaltdel:/sbin/shutdown -t3 -r now', 1)
else:
if not val_shutdownallow or val_shutdown or val_poweroff or val_reboot or val_halt:
self.log.info(_('Forbidding reboot and shutdown to the console user'))
@@ -999,7 +999,7 @@ class MSEC:
kdmrc.set_shell_variable('AllowShutdown', 'None', 'X-:\*-Core', '^\s*$')
if val_inittab:
self.log.info(_('Forbidding Ctrl-Alt-Del from console'))
- inittab.remove_line_matching(CTRALTDEL_REGEXP)
+ inittab.exists() and inittab.remove_line_matching(CTRALTDEL_REGEXP)
def allow_user_list(self, arg):
''' Allow/Forbid the list of users on the system on display managers (kdm and gdm).'''