diff --git a/snap/local/drop_priv.sh b/snap/local/drop_priv.sh index a258b23..f0b4034 100755 --- a/snap/local/drop_priv.sh +++ b/snap/local/drop_priv.sh @@ -3,15 +3,15 @@ export PBM_MONGODB_URI="$(snapctl get pbm-uri)" + + if [[ $(id -u) == "0" ]]; then - exec bash -c "cd ${SNAP} && \ - ${SNAP}/usr/bin/setpriv \ + cd ${SNAP} && exec "${SNAP}"/usr/bin/setpriv \ --clear-groups \ --reuid snap_daemon \ --regid snap_daemon \ -- \ - ${SNAP}/usr/bin/$*" + "${SNAP}/usr/bin/$@" else - exec bash -c "cd ${SNAP} && \ - ${SNAP}/usr/bin/$*" + cd ${SNAP} && exec "${SNAP}/usr/bin/$@" fi