mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
Fix grep match of very short user or group names. (#197)
This commit is contained in:
+2
-2
@@ -510,11 +510,11 @@ if ! grep -q "${container_user_name} ALL = (root) NOPASSWD:ALL" /etc/sudoers.d/s
|
||||
fi
|
||||
|
||||
# If not existing, ensure we have a group for our user.
|
||||
if ! grep -q "${container_user_name}" /etc/group; then
|
||||
if ! grep -q "^${container_user_name}:" /etc/group; then
|
||||
groupadd --force --gid "${container_user_gid}" "${container_user_name}"
|
||||
fi
|
||||
# Let's add our user to the container. if the user already exists, enforce properties.
|
||||
if ! grep -q "${container_user_name}" /etc/passwd; then
|
||||
if ! grep -q "^${container_user_name}:" /etc/passwd; then
|
||||
if ! useradd \
|
||||
--home-dir "${container_user_home}" \
|
||||
--no-create-home \
|
||||
|
||||
Reference in New Issue
Block a user