added tagfile and make use of it in modules

This commit is contained in:
2021-12-15 10:55:18 +01:00
parent 925d32c2b6
commit a79d079cac
15 changed files with 81 additions and 31 deletions

View File

@@ -20,7 +20,7 @@
# * DEFAULT_SHELL: The shell to use when creating new users
# ------------------------------------------------------------------------------
export VER_authnz=0.1.4
export VER_authnz=0.1.5
export DEP_authnz="upgrade_dist"
# Users (from Ldap)
@@ -42,6 +42,7 @@ create_user()
{
if [[ $(noerror --noout id $1) != 0 ]]; then
prnt I "Creating user $1..."
# The following should be replaced by a more universal version
useradd --create-home --shell $DEFAULT_SHELL --user-group $1
else
prnt W "The user $1 already exists. Nothing to do..."
@@ -52,6 +53,7 @@ create_user()
authnz()
{
backupdist /etc/passwd /etc/shadow /etc/group
tagfile /etc/passwd /etc/shadow /etc/group
for usr in $REMOVE_USERS; do
prnt I "Removing user $usr..."
remove_user $usr
@@ -67,18 +69,18 @@ authnz()
installfile authnz/krb5.conf authnz/libnss-ldap.conf \
authnz/pam_ldap.conf authnz/nsswitch.conf /etc
tagfile /etc/krb5.conf /etc/libnss-ldap.conf /etc/pam-ldap.conf
sed -i -e "s/@REALM@/${REALM^^}/g" -e "s/@DOMAIN@/$REALM/g" \
-e "s/@KDC_SERVER@/$KDC_SERVER/" -e "s/@KADM_SERVER@/$KADM_SERVER/" \
/etc/krb5.conf
sed -i -e "s/@BASE_CD@/$BASE_DC@/" -e "s/@LDAP_SERVER@/$LDAP_SERVER/" \
/etc/libnss-ldap.conf
sed -i -e "s/@BASE_CD@/$BASE_DC@/g" -e "s/@LDAP_SERVER@/$LDAP_SERVER/" \
-e "s/@LDAP_ADM@/$LDAP_ADM/" /etc/libnss-ldap.conf
-e "s/@LDAP_ADM@/$LDAP_ADM/" /etc/pam-ldap.conf
installfile authnz/common-session authnz/common-account \
authnz/common-password authnz/common-auth \
/etc/pam.d
installfile authnz/common-{session,account,password,auth} /etc/pam.d
tagfile /etc/pam.d/common-{session,account,password,auth}
scv_restart nscd