Bug 6698 - Root with password cannot login in rescue mode
Summary: Root with password cannot login in rescue mode
Status: RESOLVED FIXED
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 1.7
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.8
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-09-09 02:12 UTC by Chen Qi
Modified: 2015-04-13 02:00 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Qi 2014-09-09 02:12:13 UTC
If the root has a password, and we boot the system up to make it enter rescue mode, the root cannot login. This is because in rescue mode, `sulogin' is invoked as the login manager.

How to reproduce:
1. Add in local.conf:
   INHERIT += "extrausers"
   EXTRA_USERS_PARAMS = "usermod -P 'root' root; \
                      useradd -P 'test' test;"
2. bitbake core-image-minimal
3. runqemu qemux86 nographic bootparams="-s"

P.S.
Both sysvinit and systemd have the this problem.

//Chen Qi
Comment 1 Chen Qi 2015-04-13 02:00:55 UTC
Module: openembedded-core.git
Branch: master
Commit: 9b45b990d2fc870df556f05908dcb48b9ebcfc02
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9b45b990d2fc870df556f05908dcb48b9ebcfc02

Author: Chen Qi <Qi.Chen@windriver.com>
Date:   Thu Apr  9 13:49:29 2015 +0800

shadow: add 'util-linux-sulogin' to RDEPENDS

If shadow is installed, sulogin from busybox cannot work correctly because
it still assumes that /etc/shadow is not there. This leads to the problem
when booting into rescue mode in an image with shadow installed but not
sulogin from util-linux.

To fix this problem, we add 'util-linux-sulogin' to RDEPENDS of shadow.
This runtime dependency is specific to OE, because we have to ensure
that sulogin can work correctly and sulogin from busybox cannot because
FEATURE_SHADOWPASSWORDS is not enabled by default. And we cannot enable
it by default for busybox, because that would lead to utilities in busybox
to assume the existence of /etc/shadow which is not always true in OE.

[YOCTO #6698]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>


Module: openembedded-core.git
Branch: master
Commit: 4bde182ed236243547929dd98763f1c09eddd097
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=4bde182ed236243547929dd98763f1c09eddd097

Author: Chen Qi <Qi.Chen@windriver.com>
Date:   Thu Apr  9 13:49:28 2015 +0800

util-linux: split out util-linux-sulogin

[YOCTO #6698]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>