Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 40530b7

Browse files
author
CI
committed
Automated update for script library changes
1 parent 5c0d3c9 commit 40530b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

repository-containers/images/github.com/microsoft/vscode/.devcontainer/library-scripts/desktop-lite-debian.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ EOF
273273
cat << EOF > /usr/local/share/desktop-init.sh
274274
#!/bin/bash
275275
276-
USERNAME=${USERNAME}
276+
user_name="${USERNAME}"
277+
group_name="$(id -gn ${USERNAME})"
277278
LOG=/tmp/container-init.log
278279
279280
export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-"autolaunch:"}"
@@ -318,8 +319,8 @@ sudoIf()
318319
# Use sudo to run as non-root user if not already running
319320
sudoUserIf()
320321
{
321-
if [ "\$(id -u)" -eq 0 ] && [ "\${USERNAME}" != "root" ]; then
322-
sudo -u \${USERNAME} "\$@"
322+
if [ "\$(id -u)" -eq 0 ] && [ "\${user_name}" != "root" ]; then
323+
sudo -u \${user_name} "\$@"
323324
else
324325
"\$@"
325326
fi
@@ -347,7 +348,7 @@ done
347348
sudo rm -rf /tmp/.X11-unix /tmp/.X*-lock
348349
mkdir -p /tmp/.X11-unix
349350
sudoIf chmod 1777 /tmp/.X11-unix
350-
sudoIf chown root:\${USERNAME} /tmp/.X11-unix
351+
sudoIf chown root:\${group_name} /tmp/.X11-unix
351352
if [ "\$(echo "\${VNC_RESOLUTION}" | tr -cd 'x' | wc -c)" = "1" ]; then VNC_RESOLUTION=\${VNC_RESOLUTION}x16; fi
352353
screen_geometry="\${VNC_RESOLUTION%*x*}"
353354
screen_depth="\${VNC_RESOLUTION##*x}"

0 commit comments

Comments
 (0)