Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 871501 - sys-apps/policycoreutils: features/merged-usr causes a file collision
Summary: sys-apps/policycoreutils: features/merged-usr causes a file collision
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: usrmerge, usrmerge-fixes
  Show dependency tree
 
Reported: 2022-09-18 16:47 UTC by David Sardari
Modified: 2022-11-30 00:48 UTC (History)
3 users (show)

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


Attachments
builg.log (build.log,25.48 KB, text/plain)
2022-09-18 16:50 UTC, David Sardari
Details
emerge --info (emerge_info.txt,5.83 KB, text/plain)
2022-09-18 16:51 UTC, David Sardari
Details
build.log (build.log,25.48 KB, text/plain)
2022-09-18 16:53 UTC, David Sardari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Sardari 2022-09-18 16:47:33 UTC
features/merged-usr causes a file collision, because upstream creates a symlink:

https://github.com/SELinuxProject/selinux/blob/master/policycoreutils/sestatus/Makefile#L22-L25

But, /usr/bin and /usr/sbin point to the same location with features/merged-usr being used:

❯ ls -ld /usr/bin /usr/sbin
drwxr-xr-x 1 root root 29164 18. Sep 17:29 /usr/bin/
lrwxrwxrwx 1 root root     3 18. Sep 04:05 /usr/sbin -> bin/

Reproducible: Always

Steps to Reproduce:
1. Create a profile such as:

❯ find /var/db/repos/localrepo/{metadata,profiles} -type f -exec head {} +
==> /var/db/repos/localrepo/metadata/layout.conf <==
masters = gentoo
thin-manifests = true
profile-formats = portage-2

==> /var/db/repos/localrepo/profiles/merged-usr_selinux/eapi <==
8

==> /var/db/repos/localrepo/profiles/merged-usr_selinux/parent <==
gentoo:default/linux/amd64/17.1/selinux
gentoo:features/merged-usr

==> /var/db/repos/localrepo/profiles/profiles.desc <==
amd64 merged-usr_selinux dev

==> /var/db/repos/localrepo/profiles/repo_name <==
localrepo

2. Execute "merge-usr":

❯ env ACCEPT_KEYWORDS="~amd64" emerge -1a sys-apps/merge-usr
❯ merge-usr

3. Select above profile while following the SELinux installation steps:
https://wiki.gentoo.org/wiki/SELinux/Installation
Actual Results:  
A file collision:

 * Package 'sys-apps/policycoreutils-3.4' has internal collisions between
 * non-identical files (located in separate directories in the
 * installation image (${D}) corresponding to merged directories in the
 * target filesystem (${ROOT})):
 *
 * 	/usr/bin/sestatus
 * 		/usr/bin/sestatus
 * 		/usr/sbin/sestatus
 * 			Differences: type, mode
 *
 * Package 'sys-apps/policycoreutils-3.4' NOT merged due to internal
 * collisions between non-identical files. If necessary, refer to your
 * elog messages for the whole content of the above message.

Expected Results:  
Successful installation
Comment 1 David Sardari 2022-09-18 16:50:25 UTC
Created attachment 812086 [details]
builg.log
Comment 2 David Sardari 2022-09-18 16:51:34 UTC
Created attachment 812089 [details]
emerge --info
Comment 3 David Sardari 2022-09-18 16:53:46 UTC
Created attachment 812092 [details]
build.log

Renamed "builg.log" to "build.log"
Comment 4 Larry the Git Cow gentoo-dev 2022-09-19 17:21:47 UTC
The bug has been closed via the following commit(s):

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

commit 942fc9d97da6e465797296154b66e86687f30f51
Author:     Kenton Groombridge <concord@gentoo.org>
AuthorDate: 2022-09-19 17:14:48 +0000
Commit:     Kenton Groombridge <concord@gentoo.org>
CommitDate: 2022-09-19 17:20:59 +0000

    sys-apps/policycoreutils: fix install on merged-usr
    
    Upstream sestatus Makefile installs a compatibility symlink for
    the sestatus binary. Remove this symlink when USE=merged-usr to
    fix an internal file collision.
    
    Closes: https://bugs.gentoo.org/871501
    Signed-off-by: Kenton Groombridge <concord@gentoo.org>

 sys-apps/policycoreutils/policycoreutils-3.3.ebuild  | 7 ++++++-
 sys-apps/policycoreutils/policycoreutils-3.4.ebuild  | 7 ++++++-
 sys-apps/policycoreutils/policycoreutils-9999.ebuild | 7 ++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)