Skip to contentSkip to conversation

Tinylogin or shadow?

DISCUSSION Martin Jansa 3 participants 4 messages Sep 6, 2011 – Dec 1, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

if someone wants to use only shadow as login manager, then all postinst calling adduser (instead of useradd) are failing ie:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-connectivity/openssh/openssh_5.8p2.bb: adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb: adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup -s ${sbindir}/ppp-dialin ppp
recipes-core/dbus/dbus.inc: adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc
recipes-graphics/x11-common/xserver-nodm-init.bb: adduser --disabled-password $username
recipes-multimedia/pulseaudio/pulseaudio.inc: adduser --disabled-password --home=/var/run/pulse --system \
recipes-support/hal/hal.inc: grep haldaemon /etc/passwd || adduser --disabled-password --system --home /var/run/hald --no-create-home haldaemon --ingroup haldaemon -g HAL

What is preferred fix, I plan to add u-a to shadow to provide adduser alternative or add RCONFLICT between tinylogin and shadow as we don't want some passwd entries from tinylogin and some from shadow (when both installed at the same time. Someone with better idea or even patches for it?

Just in case, list of files provided by both login managers:

bash-4.1# opkg files shadow
Package shadow (4.1.4.3-r4) is installed on root and has the following files:
/usr/sbin/useradd
/usr/sbin/groupadd
/usr/sbin/groupmems
/usr/sbin/pwck
/etc/securetty
/usr/bin/newgrp.shadow
/usr/sbin/usermod
/usr/bin/chsh.shadow
/usr/sbin/groupmod
/etc/default/useradd
/usr/bin/chfn.shadow
/usr/sbin/nologin
/usr/bin/expiry
/usr/bin/passwd.shadow
/usr/sbin/userdel
/usr/sbin/groupdel
/usr/bin/sg
/usr/bin/su
/usr/sbin/newusers
/etc/login.access
/sbin/vigr.shadow
/usr/bin/groups
/usr/sbin/grpconv
/usr/sbin/logoutd
/usr/sbin/chgpasswd
/usr/sbin/grpck
/usr/sbin/chpasswd.shadow
/usr/bin/gpasswd
/bin/login.shadow
/usr/sbin/grpunconv
/sbin/vipw.shadow
/usr/bin/faillog
/usr/sbin/pwconv
/var/spool/mail/
/usr/bin/chage
/usr/bin/lastlog
/etc/login.defs
/etc/limits
/usr/sbin/pwunconv

bash-4.1# opkg files tinylogin
Package tinylogin (1.4-r7) is installed on root and has the following files:
/bin/login
/bin/su
/bin/addgroup
/sbin/sulogin
/usr/bin/passwd
/bin/delgroup
/usr/bin/vlock
/bin/tinylogin
/bin/deluser
/sbin/getty
/bin/adduser

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#1 lore raw
Quoted 15 lines · Martin Jansa

Hi,

if someone wants to use only shadow as login manager, then all postinst calling adduser (instead of useradd) are failing ie:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-connectivity/openssh/openssh_5.8p2.bb: adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb: adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup -s ${sbindir}/ppp-dialin ppp
recipes-core/dbus/dbus.inc: adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc
recipes-graphics/x11-common/xserver-nodm-init.bb: adduser --disabled-password $username
recipes-multimedia/pulseaudio/pulseaudio.inc: adduser --disabled-password --home=/var/run/pulse --system \
recipes-support/hal/hal.inc: grep haldaemon /etc/passwd || adduser --disabled-password --system --home /var/run/hald --no-create-home haldaemon --ingroup haldaemon -g HAL

Quoted 1 line

What is preferred fix,

I guess the first part of any preferred fix is going to have to be to get the postinsts to be consistent about what mechanism they use for adding users, rather than the mélange of different approaches that we seem to have today. Ideally I think that would be by means of making the recipes in question use useradd.bbclass. It might also be reasonable to extend useradd.bbclass to work with tinylogin and/or busybox's implementations of useradd if it doesn't already.

If there are recipes which can't use useradd.bbclass for whatever reason then I guess they should be adjusted to call useradd rather than adduser, since the former is the more standardized of the two.

As for tinylogin's adduser, I am inclined to say that it should probably just go away in favour of a wrapper around (ideally a generic) useradd.

Quoted 4 lines

I plan to add u-a to shadow to provide adduser alternative
or add RCONFLICT between tinylogin and shadow as we don't want some passwd entries from tinylogin and some from shadow (when both installed at the same time. Someone with better idea or even patches for it?

From the list of files you mentioned, it sounds as though the packages do conflict with each other at the moment (e.g. on ${bindir}/su) so adding RCONFLICTS is probably reasonable.

p.

#2 lore raw
Quoted 26 lines · Phil Blundell
Quoted 15 lines · Martin Jansa

Hi,

if someone wants to use only shadow as login manager, then all postinst calling adduser (instead of useradd) are failing ie:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-connectivity/openssh/openssh_5.8p2.bb: adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb: adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup -s ${sbindir}/ppp-dialin ppp
recipes-core/dbus/dbus.inc: adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc
recipes-graphics/x11-common/xserver-nodm-init.bb: adduser --disabled-password $username
recipes-multimedia/pulseaudio/pulseaudio.inc: adduser --disabled-password --home=/var/run/pulse --system \
recipes-support/hal/hal.inc: grep haldaemon /etc/passwd || adduser --disabled-password --system --home /var/run/hald --no-create-home haldaemon --ingroup haldaemon -g HAL

Quoted 1 line

What is preferred fix,

I guess the first part of any preferred fix is going to have to be to get the postinsts to be consistent about what mechanism they use for adding users, rather than the mélange of different approaches that we seem to have today. Ideally I think that would be by means of making the recipes in question use useradd.bbclass. It might also be reasonable to extend useradd.bbclass to work with tinylogin and/or busybox's implementations of useradd if it doesn't already.

Quoted 6 lines

If there are recipes which can't use useradd.bbclass for whatever reason then I guess they should be adjusted to call useradd rather than adduser, since the former is the more standardized of the two.

As for tinylogin's adduser, I am inclined to say that it should probably just go away in favour of a wrapper around (ideally a generic) useradd.

just small update on this, from my original list only 2 recipes are still not using useradd.bbclass:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc

Is someone using them? Any volunteer to migrate them and test them?

Cheers,

Quoted 17 lines
Quoted 4 lines

I plan to add u-a to shadow to provide adduser alternative
or add RCONFLICT between tinylogin and shadow as we don't want some passwd entries from tinylogin and some from shadow (when both installed at the same time. Someone with better idea or even patches for it?

From the list of files you mentioned, it sounds as though the packages do conflict with each other at the moment (e.g. on ${bindir}/su) so adding RCONFLICTS is probably reasonable.

p.

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw

Op 1 dec. 2011, om 14:01 heeft Martin Jansa het volgende geschreven:

Quoted 34 lines · Phil Blundell
Quoted 26 lines · Martin Jansa
Quoted 15 lines

Hi,

if someone wants to use only shadow as login manager, then all postinst calling adduser (instead of useradd) are failing ie:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-connectivity/openssh/openssh_5.8p2.bb: adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb: adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup -s ${sbindir}/ppp-dialin ppp
recipes-core/dbus/dbus.inc: adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc
recipes-graphics/x11-common/xserver-nodm-init.bb: adduser --disabled-password $username
recipes-multimedia/pulseaudio/pulseaudio.inc: adduser --disabled-password --home=/var/run/pulse --system \
recipes-support/hal/hal.inc: grep haldaemon /etc/passwd || adduser --disabled-password --system --home /var/run/hald --no-create-home haldaemon --ingroup haldaemon -g HAL

Quoted 1 line

What is preferred fix,

I guess the first part of any preferred fix is going to have to be to get the postinsts to be consistent about what mechanism they use for adding users, rather than the mélange of different approaches that we seem to have today. Ideally I think that would be by means of making the recipes in question use useradd.bbclass. It might also be reasonable to extend useradd.bbclass to work with tinylogin and/or busybox's implementations of useradd if it doesn't already.

Quoted 6 lines

If there are recipes which can't use useradd.bbclass for whatever reason then I guess they should be adjusted to call useradd rather than adduser, since the former is the more standardized of the two.

As for tinylogin's adduser, I am inclined to say that it should probably just go away in favour of a wrapper around (ideally a generic) useradd.

Quoted 8 lines

just small update on this, from my original list only 2 recipes are still not using useradd.bbclass:

recipes-connectivity/avahi/avahi.inc: grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
recipes-connectivity/avahi/avahi.inc: grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
recipes-devtools/distcc/distcc_2.18.3.bb: grep distcc /etc/passwd || adduser --system --home /dev/null --no-create-home --empty-password --ingroup nogroup distcc

Is someone using them? Any volunteer to migrate them and test them?

I'm in java hell right now, but I'll try to fix those after that. But it would be nice if someone beats me to it :)

regards,

Koen