Commit bf5fd3f5 authored by Mikhail Efremov's avatar Mikhail Efremov

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.
parent 87847ba7
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment