toolbox/src
Debarshi Ray 5cdd30efd3 pkg/utils: Preserve environment variables for Bash's history facility
Any system-wide customization to Bash's history facilities done through
a custom /etc/profile.d configuration snippet on the host operating
system gets lost inside the Toolbx container.

This is because Toolbx doesn't know what name to expect for the custom
/etc/profile.d snippet on the host, and, hence, can't give access to it
through a bind mount or symbolic link inside the container.  The user
can definitely set up their own symbolic link inside the container to a
snippet inside /run/host/etc/profile.d.  However, it's tedious to do
that for all containers, and the user may not even know that they are
missing the customization until they notice something wrong with the
history, which is shared across all containers and the host, and at that
point they might have already lost commands that they can't easily
reconstruct.

Therefore, it's worth trying to improve the situation by default.

This tries to preserve the environment variables used to customize
Bash's history facilities [1] across the host operating system and
Toolbx container.  It assumes that the Bash start-up scripts inside the
container won't overwrite any of the propagated variables, which might
not always be the case [2].

[1] https://www.gnu.org/software/bash/manual/html_node/Bash-History-Facilities.html
    https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html

[2] https://pagure.io/setup/pull-request/48

https://github.com/containers/toolbox/issues/1359
2023-09-30 14:22:31 +02:00
..
cmd cmd/initContainer: Simplify removing the user's password 2023-08-24 21:03:52 +02:00
pkg pkg/utils: Preserve environment variables for Bash's history facility 2023-09-30 14:22:31 +02:00
go-build-wrapper build: Wire go-build-wrapper's output to Meson's 2022-09-08 22:01:16 +02:00
go.mod build: Make it build on riscv64 2023-06-13 16:04:47 +02:00
go.sum build: Bump golang.org/x/sys to 0.1.0 for CVE-2022-29526 2023-03-02 10:12:03 +01:00
meson.build build: Make it build on riscv64 2023-06-13 16:04:47 +02:00
meson_generate_completions.py build: Merge 'completion' into 'src' 2023-01-27 01:48:56 +01:00
meson_go_fmt.py build: Fix indentation 2023-01-27 20:09:37 +01:00
toolbox.go Update copyright notices 2022-11-28 21:01:18 +01:00