From daee653c15a4c7dd65d95fb3d7d83004e0d6ce61 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Tue, 20 Jan 2009 15:53:32 +0000 Subject: Fixed inittab handling. --- src/msec/libmsec.py | 4 ++-- 1 file 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).''' -- cgit v1.2.1