OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=0f9f0ccba04211fcf6c1033807aaaa2b
30 lines
979 B
Bash
30 lines
979 B
Bash
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2004-2006 SuSE
|
|
# Author: Stanislav Brabec <sbrabec@suse.cz>
|
|
|
|
type -p cmp &> /dev/null || {
|
|
echo "${0##*/}: No cmp in PATH ... skipping"
|
|
exit 0
|
|
}
|
|
|
|
r=$ROOT
|
|
DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no"
|
|
test -f $r/etc/sysconfig/displaymanager || {
|
|
echo "${0##*/}: No $r/etc/sysconfig/displaymanager found."
|
|
exit 1
|
|
}
|
|
. $r/etc/sysconfig/displaymanager
|
|
|
|
# Password-less login is implemented by PAM. Do the required change.
|
|
if [ "$DISPLAYMANAGER_PASSWORD_LESS_LOGIN" = "yes" ] ; then
|
|
sed 's/^\(auth[[:space:]][[:space:]]*\)include[[:space:]]\([[:space:]]*\)common-auth/\1required\2pam_permit.so/' <$r/etc/pam.d/gdm >$r/etc/pam.d/gdm.new
|
|
else
|
|
sed 's/^\(auth[[:space:]][[:space:]]*\)required\([[:space:]][[:space:]]*\)pam_permit\.so/\1include \2common-auth/' <$r/etc/pam.d/gdm >$r/etc/pam.d/gdm.new
|
|
fi
|
|
if cmp -s $r/etc/pam.d/gdm $r/etc/pam.d/gdm.new ; then
|
|
rm $r/etc/pam.d/gdm.new
|
|
else
|
|
mv $r/etc/pam.d/gdm.new $r/etc/pam.d/gdm
|
|
fi
|