Skip to content

Commit

Permalink
--user=RETAIN: Fix mkdir HOME #109
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Jan 29, 2019
1 parent db1681c commit 5bbe227
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -4063,21 +4063,28 @@ create_dockerrc() { # create dockerrc: This script runs as root (or
echo "{"
echo " echo ''"
echo " echo '# x11docker variable settings'"
[ "$Createcontaineruser" = "yes" ] && {
echo " echo 'export USER=\"$Containeruser\"'"
echo " echo 'export HOME=\"$Containeruserhome\"'"
}

[ "$Sharehosthome" = "no" ] && echo " echo mkdir -p $Containeruserhome"

echo " echo '# Copy files from /etc/skel into empty HOME'"
echo " echo '[ -d /etc/skel ] && {'"
echo " echo ' [ \"\$(find $Containeruserhome -mindepth 1 -print)\" ] || cp -R /etc/skel/. $Containeruserhome'"
echo " echo '}'"
echo " echo 'Containeruser=\"\$(cat $Cshare/container.user)\"'"
case $Createcontaineruser in
yes)
echo " echo 'Containeruserhome=\"$Containeruserhome\"'"
;;
no)
echo " echo 'Containeruserhome=\$(getent passwd \$Containeruser | cut -d: -f6)'"
echo " echo 'Containeruserhome=\${Containeruserhome:-/tmp/\$Containeruser}'"
;;
esac
echo " echo 'export USER=\"\$Containeruser\"'"
echo " echo 'export HOME=\"\$Containeruserhome\"'"

[ "$Sharehosthome" = "no" ] && echo " echo mkdir -p \$Containeruserhome"
echo " echo '# Copy files from /etc/skel into empty HOME'"
echo " echo '[ -d /etc/skel ] && {'"
echo " echo ' [ \"\$(find \$Containeruserhome -mindepth 1 -print)\" ] || cp -R /etc/skel/. \$Containeruserhome'"
echo " echo '}'"
[ "$Sharehosthome" = "no" ] && {
while read -r Line; do
echo " echo '# create soft links of shared folders to fake home'"
echo " echo 'ln -s \"$Line\" \"$Containeruserhome\"'"
echo " echo 'ln -s \"$Line\" \"\$Containeruserhome\"'"
done < <(store_runoption dump volume)
}

Expand Down

0 comments on commit 5bbe227

Please sign in to comment.