aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-02-20 21:50:00 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-02-20 21:50:00 +0000
commitd5ec6785ed351e8083cb394011bbc631cd46a438 (patch)
tree0e7cef17bcbabd0b185b97adcdbd4b0ab9ab4515
parent4814fadb5503a467f007ad36df6f70b8f10cbc27 (diff)
downloadmsec-d5ec6785ed351e8083cb394011bbc631cd46a438.tar
msec-d5ec6785ed351e8083cb394011bbc631cd46a438.tar.gz
msec-d5ec6785ed351e8083cb394011bbc631cd46a438.tar.bz2
msec-d5ec6785ed351e8083cb394011bbc631cd46a438.tar.xz
msec-d5ec6785ed351e8083cb394011bbc631cd46a438.zip
added enable_password
-rw-r--r--share/libmsec.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index ef07195..068867a 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -71,6 +71,7 @@ STARTX = '/usr/X11R6/bin/startx '
SU = '/etc/pam.d/su'
SYSCTLCONF = '/etc/sysctl.conf'
SYSLOGCONF = '/etc/syslog.conf'
+SYSTEM_AUTH = '/etc/pam.d/system-auth'
XDM = '/etc/pam.d/xdm'
XSERVERS = '/etc/X11/xdm/Xservers'
@@ -490,6 +491,18 @@ def password_length(length, ndigits=0, nupper=0):
passwd.replace_line_matching('^password\s+required\s+/lib/security/pam_cracklib.so.*',
'@0 ucredit=%s ' % nupper))
+def enable_password(arg):
+ ''' Use password to authenticate users.'''
+ system_auth = ConfigFile.get_config_file(SYSTEM_AUTH)
+
+ if arg:
+ _interactive and log(_('Using password to authenticate users'))
+ system_auth.remove_line_matching('^\s*auth\s+sufficient\s+/lib/security/pam_permit.so')
+ else:
+ _interactive and log(_('Don\'t use password to authenticate users'))
+ system_auth.replace_line_matching('^\s*auth\s+sufficient\s+/lib/security/pam_permit.so', 'auth sufficient /lib/security/pam_permit.so') or \
+ system_auth.insert_before('auth\s+sufficient', 'auth sufficient /lib/security/pam_permit.so')
+
def enable_sulogin(arg):
''' Enable/Disable sulogin(8) in single user level.'''
inittab = ConfigFile.get_config_file(INITTAB)