mariadb-image/idexec

12 lines
186 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
u=$1
shift
if ! id -u "$u" > /dev/null 2>&1; then
echo "Invalid user: $u"
exit 1
fi
exec setpriv --pdeathsig=keep --reuid="$u" --regid="$u" --clear-groups -- "$@"