<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/useradd-staticids.bbclass, branch rocko-next</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=rocko-next</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=rocko-next'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2017-12-04T17:23:56+00:00</updated>
<entry>
<title>useradd-staticids: explain how to fix the the problem</title>
<updated>2017-12-04T17:23:56+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-10-19T07:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=23ee931b9d51d9aa7584461a24638ac6599afdd2'/>
<id>urn:sha1:23ee931b9d51d9aa7584461a24638ac6599afdd2</id>
<content type='text'>
When a distro uses useradd-staticids.bbclass and some developer
unfamiliar with the static ID mechanism tries to add a recipe which
needs new IDs, the resulting error or warning is typically not
something that the developer will understand.

Even experienced developers do not get enough information. They first
must find out whether the missing ID is for a system user or group,
then locate the file(s) in which the ID could be added. Both of this
is now part of the message:

ERROR: .../meta/recipes-extended/cronie/cronie_1.5.1.bb: cronie -
cronie: system groupname crontab does not have a static ID defined.
Add crontab to one of these files: /.../conf/distro/include/my-distro-group

The case that no file was found is also handled:

ERROR: .../meta/recipes-extended/cronie/cronie_1.5.1.bb: cronie -
cronie: system groupname crontab does not have a static ID defined.
USERADD_GID_TABLES file(s) not found in BBPATH: files/group

It would be nice if the error message could also list the range in
which a new ID needs to be allocated, but /etc/login.defs isn't
available at the time of creating the message, so that part is still
something that a developer needs to know.

(From OE-Core rev: 29c12b147ef85db4ebb0f86a911db5f90ae11c0a)

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Armin Kuster &lt;akuster@mvista.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids: skip recipes without static IDs</title>
<updated>2017-12-04T17:23:56+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-09-26T07:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e4f256000f9c5b67e910244ff1175d31ce948cbf'/>
<id>urn:sha1:e4f256000f9c5b67e910244ff1175d31ce948cbf</id>
<content type='text'>
When enabling useradd-staticids.bbclass, one has to define static IDs
for all recipes in a world build, otherwise those without static IDs
generate parse errors or warnings, depending on USERADD_ERROR_DYNAMIC.

Defining unused IDs is a lot of work and clutters the passwd/group
file of a distro.

Distros which want to avoid this can now set USERADD_ERROR_DYNAMIC =
"skip" and recipes which would have triggered a message then silently
get disabled. Only trying to build them shows the error message:

$ bitbake apt
...
ERROR: Nothing PROVIDES 'apt'
ERROR: apt was skipped: apt - apt: username _apt does not have a static ID defined.

(From OE-Core rev: a2766b99a763874d469d34b84109553f68f5aaac)

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Armin Kuster &lt;akuster@mvista.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids: don't create username-group if gid is specified</title>
<updated>2017-09-25T13:14:17+00:00</updated>
<author>
<name>André Draszik</name>
<email>adraszik@tycoint.com</email>
</author>
<published>2017-09-22T09:00:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=1b00c47aca3c6602af44b18ee6e208750ef3b16b'/>
<id>urn:sha1:1b00c47aca3c6602af44b18ee6e208750ef3b16b</id>
<content type='text'>
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: fc3a86ae68919cec72c1a8ae0f9ba1f98ae13f0d)

Signed-off-by: André Draszik &lt;adraszik@tycoint.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd: Create lib/oe/useradd function library</title>
<updated>2017-05-16T13:08:28+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2017-05-12T10:05:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a11e87f179409d7f8581db73f636190e428ae849'/>
<id>urn:sha1:a11e87f179409d7f8581db73f636190e428ae849</id>
<content type='text'>
The code in useradd-staticids is generally useful for user addition
functionality but is not reusable in its current form. Refactor the
code into a set of library functions.

(From OE-Core rev: a638ef304b1f1acb4c88f4f90b1ef22526cb8d2f)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-statids.bbclass: Add support for -P / --clear-password option</title>
<updated>2017-04-29T10:17:22+00:00</updated>
<author>
<name>Mark Hatle</name>
<email>mark.hatle@windriver.com</email>
</author>
<published>2017-04-27T19:41:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d4dafce19bd198bde11c567bf3fc4786e5eadf3f'/>
<id>urn:sha1:d4dafce19bd198bde11c567bf3fc4786e5eadf3f</id>
<content type='text'>
The commit 31dee7946340bf0f1e94e4e714191d3d6ca3bf6a added a new useradd and
groupadd option to specify a clear text password.  The parsing logic in the
useradd-staticid class did not understand this new option.  If the
meta-skeleton examples were run with the class enabled an error would be
generated, as an example uses the -P option.

Note, the code has a check that we do not attempt to set both a crypt and
clear text password.  It is not allowed that these two options are set
at the same time, so we prefer the crypt option if they happen to be.

(From OE-Core rev: a1715970d5c454dd24d04972ffb9cf735b5d1338)

Signed-off-by: Mark Hatle &lt;mark.hatle@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids.bbclass: Always fail/warn for missing IDs</title>
<updated>2017-03-22T11:35:20+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2017-03-15T00:27:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=b2cd8759b16167d1a983d72a5494f5a213de9b54'/>
<id>urn:sha1:b2cd8759b16167d1a983d72a5494f5a213de9b54</id>
<content type='text'>
Previously, with USERADD_ERROR_DYNAMIC set to error/warn, if a static
UID/GID was specified in the recipe, then no error/warning would be
issued even if no ID was specified in the passwd/groups files.

(From OE-Core rev: 8e4b4e28a7c3a9dbd6b9298bea5d2c1328b3f24a)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids.bbclass: Support recipes specifying static IDs</title>
<updated>2017-03-22T11:35:20+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2017-03-15T00:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6b5502566fa9e3b6313cf40cd62b4e846f1e5103'/>
<id>urn:sha1:6b5502566fa9e3b6313cf40cd62b4e846f1e5103</id>
<content type='text'>
If this bbclass is used and a recipe specifies a static ID for a
user/group as part of the USERADD_PARAM_${PN} or GROUPADD_PARAM_${PN},
the build would fail with and error like this if there was no
corresponding ID in the passwd/group files specified via
USERADD_UID_TABLES/USERADD_GID_TABLES:

  ERROR: meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb:
  meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb inherits
  useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or
  GROUPMEMS_PARAM for package postgresql

(From OE-Core rev: e744fac05fc5cc19cabc59c1e79ff4c1b3ee396d)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids: fix typo for '--expiredate'</title>
<updated>2017-02-23T20:49:48+00:00</updated>
<author>
<name>Peter Bergin</name>
<email>peter@berginkonsult.se</email>
</author>
<published>2017-02-19T20:30:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=42d6b7818d3472941d130cb2e05f1cac3291fcdc'/>
<id>urn:sha1:42d6b7818d3472941d130cb2e05f1cac3291fcdc</id>
<content type='text'>
There is a typo in the useradd-staticids.bbclass that
causes error during do_install.

If build was configured to use usedadd-staticids and
the recipe included (for example):

USERADD_PARAM_${PN} = "--expiredate '' testUser"

Due to the typo this added the wrong option '--expiredata '
that caused an error.

(From OE-Core rev: 9d26a2f9f52ae9df6aa5e0ee20683ada35c32af1)

Signed-off-by: Peter Bergin &lt;peter@berginkonsult.se&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>useradd-staticids: Fix groupadd</title>
<updated>2017-01-26T10:44:27+00:00</updated>
<author>
<name>David Vincent</name>
<email>freesilicon@gmail.com</email>
</author>
<published>2017-01-23T13:55:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=fdaa2d181d29dd2198248b011279e2b6acb12f2d'/>
<id>urn:sha1:fdaa2d181d29dd2198248b011279e2b6acb12f2d</id>
<content type='text'>
When a group name is duplicated between USERADD_PARAM and
GROUPADD_PARAM, this class tries to add it twice which results in
failure of the groupadd command.

(From OE-Core rev: 5b84cc895500c28674d2a7b7c2dd618cf8fb30e9)

Signed-off-by: David Vincent &lt;freesilicon@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>extrausers: Use static ids when available</title>
<updated>2017-01-19T22:47:20+00:00</updated>
<author>
<name>David Vincent</name>
<email>freesilicon@gmail.com</email>
</author>
<published>2017-01-16T14:30:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=f4fedefe49d4724d6086e41bfc49753eab15d3e1'/>
<id>urn:sha1:f4fedefe49d4724d6086e41bfc49753eab15d3e1</id>
<content type='text'>
When creating users at the image level using extrausers class, the
current behavior is to ignore the status of USERADDEXTENSION. This could
lead to undefined behavior when static ids are expected but the system
falls back to dynamic ones.

(From OE-Core rev: 331140e892f84b70bced44a0b5d14f32ec95042e)

Signed-off-by: David Vincent &lt;freesilicon@gmail.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
