[cloud][lxc] Prevent hostname to be set (#22246)
If the host .bashrc holds a var named HOSTNAME, the container where the lxc_container module will attach to will inherit from this var, potentially breaking some applications (like rabbitmqctl) due to an incorrect $HOSTNAME reported in the container.pull/4420/head
parent
f53921093f
commit
19b49a9224
|
@ -541,6 +541,7 @@ ATTACH_TEMPLATE = """#!/usr/bin/env bash
|
||||||
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
|
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
|
||||||
if [[ -f ".bashrc" ]];then
|
if [[ -f ".bashrc" ]];then
|
||||||
source .bashrc
|
source .bashrc
|
||||||
|
unset HOSTNAME
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue