features.in/live: Don't use nopasswdlogin group in all cases.

Use it only for gdm and lightdm and only if it is used
in a PAM config.
This commit is contained in:
Mikhail Efremov 2012-06-29 16:54:32 +04:00
parent 87847ba744
commit bf5fd3f54e
2 changed files with 11 additions and 3 deletions

View File

@ -2,8 +2,7 @@
# * reset password for root
# * add user `altlinux' (without password)
NPG="nopasswdlogin"
GRPLIST="users scanner audio radio proc cdrom cdwriter wheel fuse $NPG"
GRPLIST="users scanner audio radio proc cdrom cdwriter wheel fuse"
verbose()
{
@ -15,7 +14,6 @@ verbose()
add_user()
{
verbose "Add $1 user"
groupadd -r "$NPG"
local groups=
for g in $GRPLIST; do
if groupmod $g 2>/dev/null; then

View File

@ -7,6 +7,14 @@ fi
USER=altlinux
add_nopasswdlogin_group()
{
[ -f "/etc/pam.d/$1" ] &&
egrep -qs '^auth.+user[[:blank:]]+ingroup[[:blank:]]+nopasswdlogin' "/etc/pam.d/$1" &&
groupadd -r nopasswdlogin &&
gpasswd -a "$USER" nopasswdlogin
}
## setup runlevel
INITTAB=/etc/inittab
if [ -f "$INITTAB" ]; then
@ -29,6 +37,7 @@ if [ -f "$LIGHTDM_CONF" ]; then
-e "s/^#\(autologin-user=\).*$/\1$USER/" \
-e "s/^#\(autologin-user-timeout=0\)/\1/" \
"$LIGHTDM_CONF"
add_nopasswdlogin_group lightdm ||:
fi
## gdm2 autologin
@ -36,6 +45,7 @@ GDM_CONF=/etc/X11/gdm/custom.conf
if [ -f "$GDM_CONF" ]; then
sed -i -e '/\[daemon\]/aAutomaticLoginEnable=true\nAutomaticLogin='$USER \
"$GDM_CONF"
add_nopasswdlogin_group gdm ||:
fi
## kdm3 autologin