New issue
Advanced search Search tips

Issue 873164 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 22
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

enewuser and enewgroup break when switching to pkg_setup

Project Member Reported by ljusten@chromium.org, Aug 10

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.


 
Components: Build
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?
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
Cc: mortonm@chromium.org
What command are you using to build the package?
I usually use emerge for my board, but I tried build_packages as well.
Project Member

Comment 7 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
Cc: ljusten@chromium.org chirantan@chromium.org manojgupta@chromium.org
 Issue 834445  has been merged into this issue.

Sign in to add a comment