From 6c0e41d32efae056cf45b9cb1a6f78d6e9375388 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Thu, 4 Jul 2002 16:57:32 +0000 Subject: allow_root_login: corrected regexp to avoid adding the string at every run. --- share/libmsec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/libmsec.py b/share/libmsec.py index 68d18e1..b2dc631 100644 --- a/share/libmsec.py +++ b/share/libmsec.py @@ -244,7 +244,7 @@ def allow_root_login(arg): if arg: _interactive and log(_('Allowing direct root login')) - sshd_config.exists() and sshd_config.replace_line_matching('^\s*PermitRootLogin\s+no', + sshd_config.exists() and sshd_config.replace_line_matching('^\s*PermitRootLogin\s+(no|yes)', 'PermitRootLogin yes', 1) kde = ConfigFile.get_config_file(KDE) @@ -261,7 +261,7 @@ def allow_root_login(arg): securetty.replace_line_matching(s, s, 1) else: _interactive and log(_('Forbidding direct root login')) - sshd_config.exists() and sshd_config.replace_line_matching('^\s*PermitRootLogin\s+yes', + sshd_config.exists() and sshd_config.replace_line_matching('^\s*PermitRootLogin\s+(no|yes)', 'PermitRootLogin no', 1) bastillenologin = ConfigFile.get_config_file(BASTILLENOLOGIN) -- cgit v1.2.1