On 2020-04-03 10:22:54+0200, SZEDER Gábor <szeder.dev@xxxxxxxxx> wrote: > On Thu, Apr 02, 2020 at 08:04:01PM +0700, Đoàn Trần Công Danh wrote: > > We're using "su -m" to preserve environment variables in the shell run > > by "su". But, that options will be ignored while "-l" (aka "--login") is > > specified. > > This is not true. See any previous runs of the 32 bit Linux job, > which worked as expected, because none of these environment variables > were cleared. Different su have different behavior when combine "-m" and "-l" util-linux's su has this as far as 60541961f, (docs: improve grammar, wording and formatting of su man page, 2013-10-12) -m, -p, --preserve-environment Preserve the entire environment, i.e., it does not set HOME, SHELL, USER nor LOGNAME. This option is ignored if the option --login is specified. https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/login-utils/su.1#n120 Ubuntu (our Linux32 builder), ships su by shadow-utils: Note that the default behavior for the environment is the following: The $HOME, $SHELL, $USER, $LOGNAME, $PATH, and $IFS environment variables are reset. If --login is not used, the environment is copied, except for the variables above. If --login is used, the $TERM, $COLORTERM, $DISPLAY, and $XAUTHORITY environment variables are copied if they were set. There're no mentions of other variables, I _think_ our Linux32 works by accident. Alpine ships su from busybox, this su ignores "-m" if "-l" is set. -- Danh