Bug 5612

Summary: If no passwd/group files exist in sysroot, users/groups are picked up from /etc
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Peter Kjellerstedt <peter.kjellerstedt>
Component: coreAssignee: Saul Wold <sgw>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium CC: liezhi.yang, meta.mr.watcher, meta.watcher, Qi.Chen, seebs, tomw
Version: 1.5   
Target Milestone: 1.6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Peter Kjellerstedt 2013-11-29 16:55:10 UTC
[ To simplify the description I will only use groups as an example, but everything applies to users as well. ]

If there is no group file in the etc directory of the sysroot, /etc/group will be used instead. This means that one can succeed in building a recipe where a group is used that exists in /etc/group if no group file is in the sysroot, but the recipe will fail to build later when base-passwd has been installed and the group file in the sysroot does not contain the used group.
Comment 1 Chen Qi 2013-12-13 08:00:03 UTC
How about making such recipe dependent on base-passwd?

//Chen Qi
Comment 2 Saul Wold 2013-12-17 19:36:14 UTC
Do you use the useradd.bbclass to modify the user or group files?  It has a 
dependency on base-passwd as Chen Qi suggests.  How are you modifing the group 
file?
Comment 3 Peter Kjellerstedt 2013-12-18 00:16:42 UTC
Well, for recipes that need to add users and/or groups in addition to what base-passwd provides, useradd.bbclass is appropriate. However, I am talking about recipes that only use the users and groups provided by base-passwd. In Poky, there are only two recipes that depend on base-passwd: sysvinit and shadow-sysroot. Any other recipe that installs files (and that should be just about every single recipe) relies on the fact that the users and groups in /etc are similar enough to the ones provided by bass-passwd, most notably that root exists.

That said, this may be more of a theoretical problem as the likelihood of having a host system without a user called "root" is pretty slim...
Comment 4 Seebs 2014-01-15 19:22:57 UTC
It would make sense to change that behavior in pseudo, I would be inclined to have pseudo use a small built-in passwd/group set instead of the host system's in that case.
Comment 5 Peter Kjellerstedt 2014-04-10 11:32:18 UTC
Not sure what more info I am expected to provide...
Comment 6 Robert Yang 2014-04-18 07:54:06 UTC
Duplicated to 6124.

*** This bug has been marked as a duplicate of bug 6124 ***