feat: add ALT Linux compatibility improvements#1989
feat: add ALT Linux compatibility improvements#1989liannnix wants to merge 3 commits into89luca89:mainfrom
Conversation
|
Hi @liannnix is |
Hi, In ALT Linux The actual problem is that That’s why the opt-in |
|
Got it now it's more clear I'm open to find a way to make it work that does not involve additional options, env variables, or flags. ALT Linux has a dedicated setup section in the init (about line 967) you can use that to put in some logic in order to make it compliant. Had this problem before with Alpine and Chimera where |
Thanks for the detailed explanation, that makes your concerns much clearer. I agree that a per-distro flag is not ideal, and it’s better to handle ALT Linux specifics in its dedicated init section instead. I’ll rework the PR to move the |
0a45c12 to
681d314
Compare
Following your feedback, I've reworked the PR to handle ALT Linux compatibility inside Changes Made1. ALT Linux-specific
2. Guarded the generic
3. PATH ordering fix in
Why a Separate Wrapper?The existing wrapper only removes
|
Use mkdir -p in setup_aptrpm() to prevent command failure if /etc/tcb/$user already exists. Signed-off-by: Andrey Limachko <liannnix@altlinux.org>
Private tmp directory is not needed as /tmp is mounted from host system. Using pam_mktemp would break the PAM stack. Signed-off-by: Andrey Limachko <liannnix@altlinux.org>
681d314 to
efad878
Compare
ALT Linux ships its own su(1) implementation incompatible with util-linux su flags. distrobox-enter passes -m, --pty, -s, -c when unshare_groups is enabled (--init containers). These flags are rejected by ALT's su, causing instant failure. Add /usr/local/bin/su wrapper that delegates to /usr/sbin/runuser (from util-linux, always present in ALT). The wrapper is placed in /usr/local/bin to survive package updates, and the existing generic --pty-stripping wrapper is guarded to not overwrite it. Fix PATH ordering in distrobox-enter to ensure /usr/local/bin precedes /usr/bin when host PATH is passed through. This follows FHS conventions and guarantees the wrapper is found first. Signed-off-by: Andrey Limachko <liannnix@altlinux.org>
efad878 to
d0e9406
Compare
This PR fixes ALT Linux container compatibility issues, specifically addressing problems with
--initcontainers.Problem
ALT Linux ships its own
suimplementation that is incompatible with util-linuxsuflags. Whendistrobox-enterruns withunshare_groupsenabled (i.e.,--initcontainers), it passes flags like-m,--pty, and-cthat ALT'ssurejects, causing immediate failure:Changes Made
ALT Linux-specific
suwrapper indistrobox-init:if command -v control), creates/usr/local/bin/su→/usr/sbin/runuserwrapperrunuser(fromutil-linux, always present in ALT) accepts the same flags as util-linuxsu/usr/local/binto surviveapt-getupgrades (no package owns it)Guarded the generic
--ptywrapper:[ ! -e /usr/local/bin/su ]check to prevent overwriting ALT-specific wrappersuimplementationsPATH ordering fix in
distrobox-enter:/usr/local/binprecedes/usr/binwhen host PATH is passed through/usr/localshould override/usr)Additional ALT Linux fixes:
control pam_mktemp disabled– PAM stack compatibility fixmkdir -pfor TCB directory – prevents errors when directory existsWhy a Separate Wrapper?
The existing generic wrapper only strips
--ptyflag for old util-linux versions. ALT Linuxsuhas broader incompatibilities – it rejects-m,-cflags entirely. A simple--pty-stripping wrapper won't help; we need a complete replacement that understands all util-linuxsuflags.Solution Characteristics
/usr/local/binsurvives package updatescontrol)su-exec/doasreplacements)The fix ensures ALT Linux containers work seamlessly with
--init, maintaining distrobox's POSIX compliance while handling distro-specific incompatibilities internally.