Bug 8033 - pam silently disables debug-tweaks and other image configuration
Summary: pam silently disables debug-tweaks and other image configuration
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.9 M3
Assignee: Leonardo Sandoval Gonzalez
QA Contact: Cristina Agurida
URL:
Whiteboard: TC needed
: 8094 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-20 20:30 UTC by Richard Purdie
Modified: 2015-08-10 14:58 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2015-07-20 20:30:58 UTC
Currently, if you enable pam in a distro (e.g. use poky-lsb), IMAGE_FEATURES like debug-tweaks, empty-root-password, allow-empty-password suddenly have no effect. There should be an error shown when building an image with pam enabled and such features are also set.
Comment 1 Benjamin Esquivel 2015-07-23 14:48:54 UTC
Adding a warning/error message is a priority for this bug, once that is in place it can be lowered in priority and perhaps to a next release. In the end it is required to investigate why PAM is behaving like this.

According to Paul, this worked in the past so it is required to know whether this is a regression.
Comment 2 Paul Eggleton 2015-07-28 12:39:34 UTC
Right, I'm certain this used to work; last time I fixed it was poky revision .e2d24f517206f6b8d9767c5d6d24795be5969a96.
Comment 3 Leonardo Sandoval Gonzalez 2015-08-02 02:17:14 UTC
would it be enough to remove related image features when pam distro feature is enable?

-IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging"
+IMAGE_FEATURES[validitems] += "${@bb.utils.contains("DISTRO_FEATURES", "pam", "", "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging", d)}"


The above is done on image.bbclass.
Comment 4 Paul Eggleton 2015-08-02 22:23:41 UTC
I'd rather we fix the problem itself if at all practical.
Comment 5 Paul Eggleton 2015-08-05 08:26:44 UTC
*** Bug 8094 has been marked as a duplicate of this bug. ***
Comment 6 Leonardo Sandoval Gonzalez 2015-08-05 22:19:53 UTC
Paul,

Reading [1], I believe I have a better idea. The patch that I have right now just replace the *nullok_secure* for *nullok* in case of PAM is present on DISTRO features (you already done it on e2d24f517206f6b8d9767c5d6d24795be5969a96, so I just wrapped that code into a function).

Is that all that needs to be change?

I do not think other image features need to change behavior if PAM is present. Let me know if I am wrong.

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8094
Comment 7 Paul Eggleton 2015-08-06 17:23:12 UTC
I'm a bit confused - surely ssh_allow_empty_password is already being called in this case?
Comment 8 Leonardo Sandoval Gonzalez 2015-08-06 18:16:05 UTC
(In reply to comment #7)
> I'm a bit confused - surely ssh_allow_empty_password is already being called
> in this case?

No. What I have implemented so far, and currently being tested is that what you did in the mentioned patch ('s/nullok_secure/nullok') also applies when PAM is enabled (indirectly enabled by poky-lsb distro, or when building lsb images). This way, debug-tweaks & PAM works as expected (i.e. no password is asked to the user).
Comment 9 Leonardo Sandoval Gonzalez 2015-08-07 04:18:09 UTC
I have not found the root cause yet (I focused too much on PAM but seems that is not related at all). 

My conclusions so far is that this issue is not related with PAM; this is how I found the latter: I have created two images (with the poky-lsb distro and debug-tweaks image feature) , a core-image-minimal and a core-image-lsb-sdk, both including PAM, and the first works as expected (no password being asked) and the second doesn't.

One interesting point I am seeing is that the /etc/password on these two rootfs  are different

core-image-minimal: 
    
    root::0:0:root:/home/root:/bin/sh

core-image-lsb-sdk:

    root:x:0:0:root:/home/root:/bin/sh

So, one of the lsd-sdk packages or post scripts are touching /etc/password and setting a password for root, so this is the reason why pwd is being asked.
Comment 10 Aníbal Limón 2015-08-07 21:48:43 UTC
It appears that something going wrong when upgrade to 1.2.1,

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-extended/pam/libpam_1.2.1.bb?id=88dd997d9941b63ae9eead6690ecf2b785c0740c

If you revert that commit all works as expected.
Comment 11 Richard Purdie 2015-08-09 21:48:37 UTC
I have a suspicion that we need to be careful which images we test here since openssh uses pam whilst dropbear does not.
Comment 12 Richard Purdie 2015-08-09 23:12:47 UTC
I think I noticed the problem in the 1.2.1 upgrade patch. I've merged a fix into master for this: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c75cefe8a382a63f625123c156137782db118f64
Comment 13 Alexandru Georgescu 2015-08-10 05:22:01 UTC
Dainel,
please work with Lenoardo and RP to create QA tests to make sure we don't encounter this type of issue again.
Comment 14 Cristina Agurida 2015-08-10 14:58:36 UTC
Verified on master: c75cefe8a382a63f625123c156137782db118f64