File 0001-fix-add-newline-when-manually-adding-user.patch of Package distrobox
From 89d6e0cb8d2244bf96124aec4b4b5f114d24b879 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Thu, 29 Jan 2026 12:15:02 +0100
Subject: [PATCH] fix: add newline when manually adding user
---
distrobox-init | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/distrobox-init b/distrobox-init
index ba6eb41..fb6e482 100755
--- a/distrobox-init
+++ b/distrobox-init
@@ -2343,7 +2343,7 @@ if ! grep -q "^${container_user_name}:" /etc/group; then
if ! groupadd --force --gid "${container_user_gid}" "${container_user_name}"; then
# It may occur that we have users with unsupported user name (eg. on LDAP or AD)
# So let's try and force the group creation this way.
- printf "%s:x:%s:" "${container_user_name}" "${container_user_gid}" >> /etc/group
+ printf "%s:x:%s:\n" "${container_user_name}" "${container_user_gid}" >> /etc/group
fi
fi
###############################################################################
@@ -2405,7 +2405,7 @@ if ! grep -q "^$(printf '%s' "${container_user_name}" | tr '\\' '.'):" /etc/pass
printf "Warning: There was a problem setting up the user with usermod, trying manual addition\n"
- printf "%s:x:%s:%s:%s:%s:%s" \
+ printf "%s:x:%s:%s:%s:%s:%s\n" \
"${container_user_name}" "${container_user_uid}" \
"${container_user_gid}" "${container_user_name}" \
"${container_user_home}" "${SHELL:-"/bin/bash"}" >> /etc/passwd
@@ -2439,7 +2439,7 @@ elif [ ! -e /etc/passwd.done ]; then
# Modify the user
printf "distrobox: Setting up existing user: /etc/passwd...\n"
sed -i "s|^${container_user_name}.*||g" /etc/passwd
- printf "%s:x:%s:%s:%s:%s:%s" \
+ printf "%s:x:%s:%s:%s:%s:%s\n" \
"${container_user_name}" "${container_user_uid}" \
"${container_user_gid}" "${container_user_name}" \
"${container_user_home}" "${SHELL:-"/bin/bash"}" >> /etc/passwd
--
2.52.0