[OE-core] [PATCH 0/2] useradd-staticids

Mark Hatle mark.hatle at windriver.com
Mon Feb 10 19:28:24 UTC 2014


Someone found a bug with the code already, see the bug information below:

> I'm testing with our current recipes which creates a user has a uid 
> overridden in a configured passwd table file.
> 
> Snippet from somepkg.bb:
> USERADD_PACKAGES = "${PN}"
> USERADD_PARAM_${PN} = "--system -s /bin/sh --user-group somename"
> 
> It does not contain any GROUPADD_PARAM_${PN}.
> This build fails since when adding the user 'somename', the group 
> 'somename' can't be found. Activating some commented debugging in the 
> bbclass, you can see these printouts:
> 
> WARNING: Before: 'USERADD_PARAM_somepkg' - '--system -s /bin/sh 
> --user-group somename'
> WARNING: After:  'USERADD_PARAM_somepkg' - '--gid somename --system 
> --shell /bin/sh --uid XX somename'
> 
> What can be seen is that the uid is fetched from the static passwd-file 
> that is configured, however the --user-group flag is lost and no group 
> is created (GROUPADD_PARAM is set to "" (blank) in the 
> run.do_install.useradd_sysroot.<pid>).

As noted above the --user-group flag was being cleared, even in cases where
we did not have enough information to properly clear it.  Refactor the code
in this section of the class..  (The above was used to verify functionality.)

In addition, a second patch cleaned up the error checking and added an
easier way for a developer of this code to see what is happening during initial
parse.

The following changes since commit b5b4898cd409036161c62891e9618d9ab3f891f9:

  python-pycurl: upgrade to 7.19.3 (2014-02-08 21:03:27 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib mhatle/uidgid
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mhatle/uidgid

Mark Hatle (2):
  useradd-staticids: Fix groupadd when --user-group is selected
  useradd-staticids: Adjust USERADD_ERROR_DYNAMIC condition and error
    message

 meta/classes/useradd-staticids.bbclass | 58 ++++++++++++++++++++--------------
 1 file changed, 35 insertions(+), 23 deletions(-)

-- 
1.8.5.3




More information about the Openembedded-core mailing list