Skip to content

Commit 177088c

Browse files
committed
decrease chance of collision if we are setting multiple group names
1 parent baa3494 commit 177088c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/etc/cont-init.d/50-gid-video

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ do
2121
if [ ! "${VIDEO_GID}" == '0' ]; then
2222
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
2323
if [ -z "${VIDEO_NAME}" ]; then
24-
VIDEO_NAME="video$(head /dev/urandom | tr -dc 0-9 | head -c4)"
24+
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
2525
groupadd "$VIDEO_NAME"
2626
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
2727
fi
@@ -33,4 +33,4 @@ done
3333

3434
if [ ! -z "${FILES}" ] && [ ! -f "/groupadd" ]; then
3535
usermod -a -G root abc
36-
fi
36+
fi

0 commit comments

Comments
 (0)