Fix hard-coded user and group IDs
Thanks to dth202 for the fix here: https://github.com/coppit/docker-filebot/issues/17
This commit is contained in:
8
runas.sh
8
runas.sh
@@ -42,9 +42,9 @@ function create_user {
|
|||||||
USER="user_${USER_ID}_$GROUP_ID"
|
USER="user_${USER_ID}_$GROUP_ID"
|
||||||
GROUP="group_${USER_ID}_$GROUP_ID"
|
GROUP="group_${USER_ID}_$GROUP_ID"
|
||||||
|
|
||||||
if grep -q '^[^:]*:[^:]*:99:100:' /etc/passwd >/dev/null 2>&1
|
if grep -q "^[^:]*:[^:]*:$USER_ID:$GROUP_ID:" /etc/passwd >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//')
|
USER=$(grep "^[^:]*:[^:]*:$USER_ID:$GROUP_ID:" /etc/passwd | sed 's/:.*//')
|
||||||
|
|
||||||
if [[ $USER == *$'\n'* ]]
|
if [[ $USER == *$'\n'* ]]
|
||||||
then
|
then
|
||||||
@@ -56,9 +56,9 @@ function create_user {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q '^[^:]*:[^:]*:99:' /etc/passwd >/dev/null 2>&1
|
if grep -q "^[^:]*:[^:]*:$USER_ID:" /etc/passwd >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//')
|
USER=$(grep "^[^:]*:[^:]*:$USER_ID:" /etc/passwd | sed 's/:.*//')
|
||||||
|
|
||||||
if [[ $USER == *$'\n'* ]]
|
if [[ $USER == *$'\n'* ]]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user