git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 2/6] ci/lib-docker: preserve required environment variables

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Apr 3, 2020, 19:55 UTC
Message-ID
<20200403195551.GB7859@szeder.dev>
In-Reply-To
<20200403100931.GA32101@danh.dev>
On Fri, Apr 03, 2020 at 05:09:31PM +0700, Danh Doan wrote:
Show 36 quoted lines
> On 2020-04-03 10:22:54+0200, SZEDER Gábor <szeder.dev@gmail.com> 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.

We do know which image we use, and we do know how its 'su' behaves. I think relying on that is fine, and it's not just "works by accident".

> Alpine ships su from busybox, this su ignores "-m" if "-l" is set.

Then the commit message should specifically mention these behavior differences between different 'su' variants.

Previous: Danh DoanNext: Đoàn Trần Công Danh
Message 26 of 42 in “add travis job for linux with musl libc”
  1. 0/3 add travis job for linux with musl libcĐoàn Trần Công Danh, Mar 26, 2020
  2. 1/3 ci: libify logic for usage and checking CI_USERĐoàn Trần Công Danh, Mar 26, 2020
  3. 2/3 ci: refactor docker runner scriptĐoàn Trần Công Danh, Mar 26, 2020
  4. Eric SunshineMar 26, 2020
  5. SZEDER GáborMar 28, 2020
  6. Danh DoanMar 29, 2020
  7. 3/3 travis: build and test on Linux with musl libc and busyboxĐoàn Trần Công Danh, Mar 26, 2020
  8. Junio C HamanoMar 29, 2020
  9. 0/4 Travis + Azure jobs for linux with musl libcĐoàn Trần Công Danh, Mar 29, 2020
  10. 1/4 ci: libify logic for usage and checking CI_USERĐoàn Trần Công Danh, Mar 29, 2020
  11. 2/4 ci: refactor docker runner scriptĐoàn Trần Công Danh, Mar 29, 2020
  12. SZEDER GáborApr 1, 2020
  13. 3/4 travis: build and test on Linux with musl libc and busyboxĐoàn Trần Công Danh, Mar 29, 2020
  14. SZEDER GáborApr 1, 2020
  15. Danh DoanApr 2, 2020
  16. Johannes SchindelinApr 7, 2020
  17. Junio C HamanoApr 7, 2020
  18. Johannes SchindelinApr 10, 2020
  19. 4/4 t3402: use POSIX compliant regex(7)Đoàn Trần Công Danh, Mar 29, 2020
  20. Junio C HamanoMar 29, 2020
  21. 0/6 Travis + Azure jobs for linux with musl libcĐoàn Trần Công Danh, Apr 2, 2020
  22. 1/6 ci: make MAKEFLAGS available inside the Docker container in the Linux32 jobĐoàn Trần Công Danh, Apr 2, 2020
  23. 2/6 ci/lib-docker: preserve required environment variablesĐoàn Trần Công Danh, Apr 2, 2020
  24. SZEDER GáborApr 3, 2020
  25. Danh DoanApr 3, 2020
  26. SZEDER GáborApr 3, 2020
  27. 3/6 ci/linux32: parameterise command to switch archĐoàn Trần Công Danh, Apr 2, 2020
  28. 4/6 ci: refactor docker runner scriptĐoàn Trần Công Danh, Apr 2, 2020
  29. 5/6 ci/linux32: libify install-dependencies stepĐoàn Trần Công Danh, Apr 2, 2020
  30. 6/6 travis: build and test on Linux with musl libc and busyboxĐoàn Trần Công Danh, Apr 2, 2020
  31. Junio C HamanoApr 2, 2020
  32. Danh DoanApr 3, 2020
  33. 0/6 Travis jobs for linux with musl libcĐoàn Trần Công Danh, Apr 4, 2020
  34. 1/6 ci: make MAKEFLAGS available inside the Docker container in the Linux32 jobĐoàn Trần Công Danh, Apr 4, 2020
  35. 2/6 ci/lib-docker: preserve required environment variablesĐoàn Trần Công Danh, Apr 4, 2020
  36. 3/6 ci/linux32: parameterise command to switch archĐoàn Trần Công Danh, Apr 4, 2020
  37. 4/6 ci: refactor docker runner scriptĐoàn Trần Công Danh, Apr 4, 2020
  38. 5/6 ci/linux32: libify install-dependencies stepĐoàn Trần Công Danh, Apr 4, 2020
  39. 6/6 travis: build and test on Linux with musl libc and busyboxĐoàn Trần Công Danh, Apr 4, 2020
  40. Junio C HamanoApr 5, 2020
  41. Johannes SchindelinApr 7, 2020
  42. Junio C HamanoApr 7, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.