aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-03-27 21:16:54 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-03-27 21:16:54 +0000
commit7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d (patch)
treecfb82c779c877a9fff3745e24da17833c9866f41
parentb97f7f64288af693752b54a9df7b51c58692cb18 (diff)
downloadmsec-7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d.tar
msec-7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d.tar.gz
msec-7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d.tar.bz2
msec-7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d.tar.xz
msec-7e2a31dc6262cbeaa2e0090993ff1fbb76a9092d.zip
allow_reboot: only touch the shutdown, poweroff, reboot and halt files if
they don't exist.
-rw-r--r--share/libmsec.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index 3004963..2827ca3 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -209,7 +209,8 @@ def allow_reboot(arg):
_interactive and log(_('Allowing reboot to the console user'))
shutdownallow.exists() and shutdownallow.move(SUFFIX)
for f in [SHUTDOWN, POWEROFF, REBOOT, HALT]:
- ConfigFile.get_config_file(f).touch()
+ cfg = ConfigFile.get_config_file(f)
+ cfg.exists() or cfg.touch()
sysctlconf.set_shell_variable('kernel.sysrq', 1)
kdmrc.exists() and kdmrc.set_shell_variable('AllowShutdown', 'All', 'X-:\*-Greeter', '^\s*$')
gdmconf.exists() and gdmconf.set_shell_variable('SystemMenu', 'true', '\[greeter\]', '^\s*$')