Browse code

Do not pass -U to useradd

The -U option doesn't have the same meaning on all distributions,
unfortunately: in some cases, it means "create a group for the user with
the same name", and in others, it means "default umask for the user".

Instead, manually create a stack group with groupadd.

Change-Id: I32f4c0603785e54a465c2d3b47a1852b8635fde0

Vincent Untz authored on 2012/06/12 21:21:18
Showing 1 changed files
... ...
@@ -171,9 +171,13 @@ if [[ $EUID -eq 0 ]]; then
171 171
     else
172 172
         rpm -qa | grep sudo || install_package sudo
173 173
     fi
174
+    if ! getent group stack >/dev/null; then
175
+        echo "Creating a group called stack"
176
+        groupadd stack
177
+    fi
174 178
     if ! getent passwd stack >/dev/null; then
175 179
         echo "Creating a user called stack"
176
-        useradd -U -s /bin/bash -d $DEST -m stack
180
+        useradd -g stack -s /bin/bash -d $DEST -m stack
177 181
     fi
178 182
 
179 183
     echo "Giving stack user passwordless sudo priviledges"