#!/bin/sh

. /warewulf/config

# This will eventually be optional
if true; then
    if [ -f "/etc/pam.d/system-auth" ]; then
        echo "FIXING: system-auth"
        sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/system-auth
    fi

    if [ -f "/etc/pam.d/password-auth" ]; then
        echo "FIXING: password-auth"
        sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/password-auth
    fi

    if [ -f "/etc/pam.d/common-account" ]; then
        echo "FIXING: common-account"
        sed -i -e '/^account.*pam_unix\.so\s*$/s/\s*$/\ broken_shadow/' /etc/pam.d/common-account
    fi
fi


chmod 755 /
