Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 769380 - sys-apps/systemd[homed]: using sys-apps/shadow[-pam], `login` and `su` are non-functional for homed users
Summary: sys-apps/systemd[homed]: using sys-apps/shadow[-pam], `login` and `su` are no...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-08 02:03 UTC by Peter Levine
Modified: 2021-02-08 22:18 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2021-02-08 02:03:08 UTC
Having built sys-apps/systemd[homed] and correctly edited /etc/nsswitch.conf for homed usage, `su` as a homed user emits "You are not authorized to su" regardless of wheel membership. And both `login` and `machinectl login` don't work for the homed user, emitting "no shadow password for '<homed_user>'" and "invalid password for '<homed_user>'" in journald, though sddm login works.

These issues are resolved after rebuilding sys-apps/shadow with USE=pam.

'homed? ( sys-apps/shadow[pam] )' should probably be added to systemd's RDEPEND.
Comment 1 Mike Gilbert gentoo-dev 2021-02-08 16:12:15 UTC
A dependency on sys-apps/shadow[pam] is not quite right here.

The "su" command may be alternatively be provided by util-linux[su]. At some point we might add support for having the "login" command provided by util-linux as well. I don't think adding a dependency in systemd for either of these commands is appropriate.

I'm more interested in the "machinectl login" failure case. Exactly what does that do and how does it fail without sys-apps/shadow[pam]?
Comment 2 Peter Levine 2021-02-08 22:05:00 UTC
(In reply to Mike Gilbert from comment #1)
> I'm more interested in the "machinectl login" failure case. Exactly what
> does that do and how does it fail without sys-apps/shadow[pam]?

When logging as the homed user, it emits:
> Login incorrect

In the journal:
> Feb 08 16:57:01 Home-PC login[1444730]: no shadow password for 'peter' on '/dev/pts/5'
> Feb 08 16:57:04 Home-PC login[1444730]: invalid password for 'peter'  on '/dev/pts/5'

It would appear that "machinectl login" uses shadow's login, which doesn't use PAM and thus doesn't use PAM's pam_systemd_home.so module.
Comment 3 Mike Gilbert gentoo-dev 2021-02-08 22:18:09 UTC
So it is just calling login in the container.

Mixing and matching the pam use flag on different packages is weird. I don’t really want to add deps to systemd just to keep people from doing weird things.