generic-poky/meta
André Draszik 7ca04fef1b useradd-staticids: don't create username-group if gid is specified
Adding distcc to an image, and having staticids enabled,
doesn't work as it causes a a superfluous 'distcc' group
being added using a conflicting  GID, thus failing the
build:
 | ERROR: distcc-3.2-r0 do_prepare_recipe_sysroot: distcc: groupadd command did not succeed.

Compared to other recipes, the distcc recipe only
specifies --gid for the primary group, and doesn't specify
--no-user-group, but when --gid is given, it doesn't make
sense to create a matching username-group in addition,
even if --no-user-group was not specified, and 'useradd'
actually complains if --gid and --user-group are given
both.

If only --gid is given, the current code in here
effectively behaves as if --user-group was specified,
taking the group-id of the username-group from the
--gid parameter. This causes the error above, as we try
to add a new group (distcc) with an existing group-id
(nogroup).

This is contrary to the comment in this file just above,
contrary to what useradd can do, contrary to behaviour
without the useradd-staticids bbclass, and non-intuitive.

Change the code such that a username-group is only created
- if a primary group using --gid was not specified, or
- if --no-user-group was not specified

To be in line with useradd, if gid is not given, and
--no-user-group is given, we add the user to the group
'users', which mimics useradd's behaviour.

(From OE-Core rev: b1843e60ebe534243b49f3685540fa5ea49d5f35)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

(cherry picked from commit fc3a86ae68919cec72c1a8ae0f9ba1f98ae13f0d)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:39:48 +00:00
..
classes useradd-staticids: don't create username-group if gid is specified 2017-11-05 22:39:48 +00:00
conf bitbake.conf: add bzr to HOSTTOOLS_NONFATAL 2017-09-13 22:13:00 +01:00
files ext-sdk-prepare.py: use quiet mode when preparing sysroot 2017-04-19 10:38:37 +01:00
lib selftest/archiver: only execute deploy_archives task 2017-11-05 22:39:47 +00:00
recipes-bsp grub: Fix build with gcc7 2017-09-11 22:15:59 +01:00
recipes-connectivity openssh: allow to override OpenSSL HostKeys when read-only-rootfs 2017-11-05 22:39:47 +00:00
recipes-core busybox: add backported patch to support iproute 'scope' 2017-11-05 22:39:47 +00:00
recipes-devtools gdb: fix gdbserver not working in musl/mips context 2017-11-05 22:39:47 +00:00
recipes-extended bash: memleak bug fix for builtin command read 2017-09-11 22:15:59 +01:00
recipes-gnome gtk+3: Update the patches to work with old versions of patch 2017-08-31 17:57:11 +01:00
recipes-graphics waffle: fix REQUIRED_DISTRO_FEATURES and PACKAGECONFIG virtual/libgl dependencies 2017-09-21 16:55:57 +01:00
recipes-kernel linuux-yocto/4.1: update to 4.1.43 plus bluetooth CVE-2017-1000251 2017-09-21 16:55:58 +01:00
recipes-lsb4 libpng12: Use rm instead of unlink 2017-03-10 14:50:11 +00:00
recipes-multimedia alsa-utils: Do not hardcode path to /lib/udev 2017-09-21 16:55:57 +01:00
recipes-rt meta: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
recipes-sato webkitgtk: Fix build on aarch64 2017-03-17 16:53:05 +00:00
recipes-support curl: enable threaded resolver 2017-11-05 22:39:48 +00:00
site siteinfo.bbclass: Add mipsisa{32, 64}r6{el, } support 2016-10-07 16:43:57 +01:00
COPYING.GPLv2 Fix license notices for OE-Core 2014-01-02 12:58:54 +00:00
COPYING.MIT
recipes.txt qt4: remove recipes and classes 2016-01-07 13:40:14 +00:00