Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691478 - acct-user.eclass may fail to set HOME directory permissions due to INSTALL_MASK or FEATURES=noman
Summary: acct-user.eclass may fail to set HOME directory permissions due to INSTALL_MA...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
: 692160 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-05 08:59 UTC by A Blamey
Modified: 2019-08-18 05:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (build.log,1.83 KB, text/plain)
2019-08-05 08:59 UTC, A Blamey
Details
Eclass debug log (eclass-debug.log,706 bytes, text/plain)
2019-08-05 09:00 UTC, A Blamey
Details
Environment (environment,41.80 KB, text/plain)
2019-08-05 09:00 UTC, A Blamey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description A Blamey 2019-08-05 08:59:36 UTC
Created attachment 585752 [details]
Build log

The latest man-db pulls in the new account management packages acct-group/man and acct-user/man.
acct-group/man installs fine, but acct-user/man fails at the merge stage as follows:

====
>>> Emerging (3 of 14) acct-user/man-0::gentoo
>>> Unpacking source...
>>> Source unpacked in /var/tmp/portage/acct-user/man-0/work
>>> Preparing source in /var/tmp/portage/acct-user/man-0/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/acct-user/man-0/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/acct-user/man-0/work ...
>>> Source compiled.
>>> Test phase [not enabled]: acct-user/man-0

>>> Install acct-user/man-0 into /var/tmp/portage/acct-user/man-0/image
>>> Completed installing acct-user/man-0 into /var/tmp/portage/acct-user/man-0/image

 * Final size of build directory: 0 KiB
 * Final size of installed tree:  0 KiB


>>> Installing (3 of 14) acct-user/man-0::gentoo
 * checking 0 files for package collisions
>>> Merging acct-user/man-0 to /
chown: cannot access '/var/tmp/portage/acct-user/man-0/image/usr/share/man': No such file or directory
 * ERROR: acct-user/man-0::gentoo failed (preinst phase):
 *   fowners failed
 *
 * If you need support, post the output of `emerge --info '=acct-user/man-0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=acct-user/man-0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/acct-user/man-0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/acct-user/man-0/temp/environment'.
 * Working directory: '/var/tmp/portage/acct-user/man-0/homedir'
 * S: '/var/tmp/portage/acct-user/man-0/work'
!!! FAILED preinst: 1

>>> Failed to install acct-user/man-0, Log file:

>>>  '/var/tmp/portage/acct-user/man-0/temp/build.log'

====

Note: My portage tmp dir is /var/tmp/portage mounted on tmpfs .

The image tree at this point is:

root @ orion:20 /var/tmp/portage/acct-user/man-0
# ls -laR image
image:
total 0
drwxr-xr-x 3 root    root     60 Aug  5 09:47 .
drwxr-xr-x 8 portage portage 360 Aug  5 09:47 ..
drwxr-xr-x 3 root    root     60 Aug  5 09:47 usr

image/usr:
total 0
drwxr-xr-x 3 root root 60 Aug  5 09:47 .
drwxr-xr-x 3 root root 60 Aug  5 09:47 ..
drwxr-xr-x 2 root root 40 Aug  5 09:47 share

image/usr/share:
total 0
drwxr-xr-x 2 root root 40 Aug  5 09:47 .
drwxr-xr-x 3 root root 60 Aug  5 09:47 ..

No man subfolder was created by the ebuild.

I'll attach the logs.
Comment 1 A Blamey 2019-08-05 09:00:11 UTC
Created attachment 585754 [details]
Eclass debug log
Comment 2 A Blamey 2019-08-05 09:00:34 UTC
Created attachment 585756 [details]
Environment
Comment 3 Mike Gilbert gentoo-dev 2019-08-05 13:56:07 UTC
Do you have /usr/share/man in INSTALL_MASK?
Comment 4 A Blamey 2019-08-05 14:22:26 UTC
Good call - yes I do.  My install mask is:

INSTALL_MASK="
/usr/share/locale
-/usr/share/locale/en
-/usr/share/locale/en@IPA
-/usr/share/locale/en@boldquot
-/usr/share/locale/en@quot
-/usr/share/locale/en@shaw
-/usr/share/locale/en_GB
-/usr/share/locale/en_GB.UTF-8
-/usr/share/locale/en_US
-/usr/share/locale/en_US.UTF-8
-/usr/share/locale/locale.alias
/usr/share/man
-/usr/share/man/cat*
-/usr/share/man/man*
"

The idea here is to only install english man pages.  It's worked for years, but I can see how this might break things in this instance.
Comment 5 A Blamey 2019-08-05 14:27:05 UTC
I just changed the mask as below, and acct-user/man now installs correctly.  Thanks for the insight!

INSTALL_MASK="
/usr/share/locale/*
-/usr/share/locale/en
-/usr/share/locale/en@IPA
-/usr/share/locale/en@boldquot
-/usr/share/locale/en@quot
-/usr/share/locale/en@shaw
-/usr/share/locale/en_GB
-/usr/share/locale/en_GB.UTF-8
-/usr/share/locale/en_US
-/usr/share/locale/en_US.UTF-8
-/usr/share/locale/locale.alias
/usr/share/man/*
-/usr/share/man/cat*
-/usr/share/man/man*
"
Comment 6 Mike Gilbert gentoo-dev 2019-08-05 14:34:55 UTC
I guess we should account for possibly missing directories in ${D} due to install mask.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-08-05 17:02:38 UTC
Maybe INSTALL_MASK is applied too early.  It's weird to assume that preinst would have different contents than install just ensured...
Comment 8 Mike Gilbert gentoo-dev 2019-08-14 20:02:25 UTC
*** Bug 692160 has been marked as a duplicate of this bug. ***
Comment 9 Zac Medico gentoo-dev 2019-08-14 20:37:20 UTC
(In reply to Michał Górny from comment #7)
> Maybe INSTALL_MASK is applied too early.  It's weird to assume that preinst
> would have different contents than install just ensured...

The current order of operations makes it possible to use INSTALL_MASK to resolve file collisions (file collision detection occurs prior to preinst). Related commits:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=02522e5755ab369c2d9a9f712bb0c1e7b882ad98

https://gitweb.gentoo.org/proj/portage.git/commit/?id=93b654199a32fc3df1299b030317720b9294b0c3
Comment 10 Mike Gilbert gentoo-dev 2019-08-14 21:16:23 UTC
Patch sent for review.

https://archives.gentoo.org/gentoo-dev/message/05fa77fba350f0b759c4041c4f1a74cc
Comment 11 Larry the Git Cow gentoo-dev 2019-08-15 18:15:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee0b97b10ce02d42e608e477d97629c6591e3489

commit ee0b97b10ce02d42e608e477d97629c6591e3489
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2019-08-15 15:41:25 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-08-15 18:15:29 +0000

    acct-user.eclass: die explicitly if HOME is missing in preinst
    
    Closes: https://bugs.gentoo.org/691478
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/acct-user.eclass | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 12 Pavol Cupka 2019-08-18 05:25:04 UTC
Well, frankly I would call this a WORKAROUND more than a FIX. It doesn't fix it for me at all and it doesn't even account for the situation if you are using FEATURES=noman as also originally noted in the bug name/title.

If there are situations where this directory might be missing (noman, INSTALL_MASK - because the user wants it that way) then it would make more sense to skip this step of changing ownership of non-existing dir and dying at the emerge process, or then there needs to be a different order of doing exclusions according to noman or INSTALL_MASK.

Is this HOME directory even needed?

NOT FIXED for me.
Comment 13 Mike Gilbert gentoo-dev 2019-08-18 05:43:31 UTC
See bug 692222.
Comment 14 Pavol Cupka 2019-08-18 05:44:34 UTC
I also like the patch from here:
https://archives.gentoo.org/gentoo-dev/message/e784a1548b87a7bced4be5a4ac482fa4

And, yes I have seen the comment from ulm, but this directory gets created somewhere above in the eclass with keepdir, it is just missing in case user has opted for it. So I don't think this should be of a problem then.

Just my 2c.
Comment 15 Pavol Cupka 2019-08-18 05:47:01 UTC
OK, I missed the changes to the ebuild acct-user/man

Going to try if that fixes-it-for-me-too.

Thank you