From 7473298ee692e5ac2e331fab4fac856c99d6e768 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Wed, 1 May 2024 17:13:18 +0200 Subject: [PATCH] enter: Fix support for Active Directory usernames including backslashes. Fix #1360 Signed-off-by: Luca Di Maio --- distrobox-enter | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distrobox-enter b/distrobox-enter index 14aaeb23..4f49b33a 100755 --- a/distrobox-enter +++ b/distrobox-enter @@ -79,7 +79,8 @@ fi # Defaults container_command="" # by default we use getent to get the login shell of the user and use that -container_command_login="/bin/sh -c \"\\\$(getent passwd ${USER} | cut -f 7 -d :) -l\"" +container_command_user="$(echo "${USER}" | sed 's|\\|\\\\|g')" +container_command_login="/bin/sh -c \"\\\$(getent passwd ${container_command_user} | cut -f 7 -d :) -l\"" container_image_default="registry.fedoraproject.org/fedora-toolbox:39" container_manager="autodetect" container_manager_additional_flags=""