Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699930 - sys-apps/util-linux: provide su instead of sys-apps/shadow
Summary: sys-apps/util-linux: provide su instead of sys-apps/shadow
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2019-11-12 08:38 UTC by fling
Modified: 2023-02-13 19:35 UTC (History)
2 users (show)

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


Attachments
sys-apps/shadow-4.6-r1.ebuild with 'su' use flag (shadow-4.6-r1.ebuild,5.43 KB, text/plain)
2019-11-14 05:48 UTC, fling
Details
sys-apps/util-linux-2.33.2-r1.ebuild with 'su' use flag (util-linux-2.33.2-r1.ebuild,8.44 KB, text/plain)
2019-11-14 05:49 UTC, fling
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fling 2019-11-12 08:38:55 UTC
It is expected to have util-linux su on gnu/linux system.
For some reason an inferior su implementation is provided by shadow package instead.


Reproducible: Always




1. More than half of the flags are not supported:
-f, -g, -G, -P, -w, and -V
2. Does not allow to login with high limits.
But it does allow when run with strace, making it hard to debug.
Comment 1 fling 2019-11-12 08:45:44 UTC
The ebuilds could be fixed with USE="shadow-su" set (by the default?) for musl and others if they need it.
Comment 2 fling 2019-11-14 05:48:35 UTC
Created attachment 596036 [details]
sys-apps/shadow-4.6-r1.ebuild with 'su' use flag
Comment 3 fling 2019-11-14 05:49:18 UTC
Created attachment 596038 [details]
sys-apps/util-linux-2.33.2-r1.ebuild with 'su' use flag
Comment 4 Larry the Git Cow gentoo-dev 2019-11-19 10:37:09 UTC
The bug has been referenced in the following commit(s):

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

commit 30c4a8ad9c4fc913b0fc0b2530d9d03ded040852
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-11-19 10:36:19 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-11-19 10:37:04 +0000

    sys-apps/shadow: Introduced "su" USE flag
    
    Moved passwd from /usr/bin to /bin (again) as it breaks at least
    one package that has passwd path hardcoded (net-misc/scponly)
    
    Thanks-to: fling <fling@member.fsf.org>
    Bug: https://bugs.gentoo.org/699930
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-apps/shadow/files/shadow-4.7-optional_su.patch | 130 ++++++++++++
 sys-apps/shadow/metadata.xml                       |   3 +
 sys-apps/shadow/shadow-4.7-r2.ebuild               | 234 +++++++++++++++++++++
 3 files changed, 367 insertions(+)

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

commit fd7f284c1cbc22e582e72528318da31d59571ea7
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-11-19 08:42:52 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-11-19 10:37:03 +0000

    sys-apps/util-linux: Introduced "logger" and "su" USE flags
    
    Thanks-to: fling <fling@member.fsf.org>
    Bug: https://bugs.gentoo.org/699930
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-apps/util-linux/metadata.xml           |  2 ++
 sys-apps/util-linux/util-linux-9999.ebuild | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
Comment 5 Maciej S. Szmigiero 2019-11-23 15:41:25 UTC
Please also have a look at bug #622666.
Thanks.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-30 07:24:15 UTC
We actually migrated a little while ago.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-30 07:24:25 UTC
We now default to util-linux[su].
Comment 8 Guido Jäkel 2023-02-13 19:22:03 UTC
Caveat emptor!

This is *no drop-in replacement*, the respected options and behavior of the commands are *different*.

The one from util-linux *don't* pass the whole environment in login mode but will strip it down to a few variables. One have to use the option -w (or --whitelist) to pass others.

In the other hand, the one from shadow isn't aware of this options and will fail. In addition, it don't support a version option like -V. Therefore it's very unhandy to write a robust scripts supporting both versions of su.
Comment 9 Mike Gilbert gentoo-dev 2023-02-13 19:35:47 UTC
(In reply to Guido Jäkel from comment #8)

Both variants of su are out in the wild, so a "robust" script would need to account for them anyway.

Also, util-linux provides better alternatives in "runuser" and "setpriv".