enewuser and enewgroup break when switching to pkg_setup |
||||
Issue description
If enewuser runs in pkg_setup, it adds the user to both /etc/passwd and /build/${BOARD}/etc/passwd. However, it earlies out if the user is in /build/${BOARD}/etc/passwd. Thus, the following situation leads to a compile error since the user is not added to /etc/passwd:
1. Compile project with an ebuild that adds a user in pkg_postinst
2. Change pkg_postinst to pkg_setup and add
3. Add an fowners command to src_install using that user
4. Compile again.
The build will fail since user is already in /build/${BOARD}/etc/passwd, so enewuser earlies out without adding it to /etc/passwd.
Similar for enewgroup.
See comments in CL:1165354.
,
Aug 14
IIRC, the scenario in (1) corresponds to a package being emerged to the build root (i.e. /build/$BOARD) while the scenario in (2) corresponds to the package being emerged to the SDK root (i.e. /). Is this what you are trying to do? Move a package from being emerged to the build root to being emerged to the SDK root?
,
Aug 14
No, I'm trying to use fowners in src_install, which requires me to create the user in pkg_setup. Apparently, fowners looks at the users installed in the SDK root, not the board root. Here's the CL: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1165354/3/chromeos-base/authpolicy/authpolicy-9999.ebuild
,
Aug 16
,
Aug 16
What command are you using to build the package?
,
Aug 17
I usually use emerge for my board, but I tried build_packages as well.
,
Aug 21
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/eclass-overlay/+/0f82aa5d820cf465777f822834b97e055bf025e8 commit 0f82aa5d820cf465777f822834b97e055bf025e8 Author: Lutz Justen <ljusten@chromium.org> Date: Tue Aug 21 17:33:48 2018 user.eclass: Fix bug in enewuser and enewgroup During the pkg_setup phase, early out if user is in both /etc/passwd and in /build/${BOARD}/etc/passwd. This fixes the issue described in the bug. BUG= chromium:873164 TEST=CL:1165354 compiles fine with authpolicyd defined in /build/${BOARD}/etc/passwd only. Change-Id: I375c85e63b3e0d7d6aebe83309fa4eaa4dd13282 Reviewed-on: https://chromium-review.googlesource.com/1170839 Commit-Ready: Lutz Justen <ljusten@chromium.org> Tested-by: Lutz Justen <ljusten@chromium.org> Reviewed-by: Lutz Justen <ljusten@chromium.org> [modify] https://crrev.com/0f82aa5d820cf465777f822834b97e055bf025e8/eclass/user.eclass
,
Aug 22
,
Aug 22
Issue 834445 has been merged into this issue. |
||||
►
Sign in to add a comment |
||||
Comment 1 by lhchavez@chromium.org
, Aug 10