mirror of
https://github.com/minio/minio.git
synced 2025-05-21 01:23:57 -04:00
Added a function which allows passing the UID/GID for suexec from the outside. (#9251)
This commit is contained in:
parent
05cda35b14
commit
b9b1bfefe7
@ -65,8 +65,14 @@ docker_sse_encryption_env() {
|
|||||||
# su-exec to requested user, if service cannot run exec will fail.
|
# su-exec to requested user, if service cannot run exec will fail.
|
||||||
docker_switch_user() {
|
docker_switch_user() {
|
||||||
if [ ! -z "${MINIO_USERNAME}" ] && [ ! -z "${MINIO_GROUPNAME}" ]; then
|
if [ ! -z "${MINIO_USERNAME}" ] && [ ! -z "${MINIO_GROUPNAME}" ]; then
|
||||||
addgroup -S "$MINIO_GROUPNAME" >/dev/null 2>&1 && \
|
|
||||||
adduser -S -G "$MINIO_GROUPNAME" "$MINIO_USERNAME" >/dev/null 2>&1
|
if [ ! -z "${MINIO_UID}" ] && [ ! -z "${MINIO_GID}" ]; then
|
||||||
|
addgroup -S -g "$MINIO_GID" "$MINIO_GROUPNAME" && \
|
||||||
|
adduser -S -u "$MINIO_UID" -G "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
||||||
|
else
|
||||||
|
addgroup -S "$MINIO_GROUPNAME" && \
|
||||||
|
adduser -S -G "$MINIO_GROUPNAME" "$MINIO_USERNAME"
|
||||||
|
fi
|
||||||
|
|
||||||
exec su-exec "${MINIO_USERNAME}:${MINIO_GROUPNAME}" "$@"
|
exec su-exec "${MINIO_USERNAME}:${MINIO_GROUPNAME}" "$@"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user