busybox: fix login applet on selinux
authorPetr Štetiar <[email protected]>
Mon, 9 Jun 2025 15:44:44 +0000 (15:44 +0000)
committerHauke Mehrtens <[email protected]>
Sat, 26 Jul 2025 16:22:30 +0000 (18:22 +0200)
commit5809bfaaacca1d10c2e77bd073065d1d3b77527e
tree466b2269292cfccd0b1f5a4b69e111f39b6c69be
parente805d8bac94d0d52221a3cf328ecc2078ca5cfbd
busybox: fix login applet on selinux

Currently the system boots up, but is unusable because pressing enter
does not provide login with error:

  login: can't get SID for root

This is happenning, because login.c passes the Linux username directly
to get_default_context(), while libselinux expects an SELinux user
identity, causing the call to fail for users without a matching SELinux
name (e.g., root) and aborting login on SELinux-enabled systems.

Fixes: #19075
Upstream-Status: Submitted [https://lists.busybox.net/pipermail/busybox/2025-April/091407.html]
Signed-off-by: Petr Štetiar <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19080
Signed-off-by: Hauke Mehrtens <[email protected]>
package/utils/busybox/patches/600-loginutils-login.c-libselinux-get_default_context-ex.patch [new file with mode: 0644]