Skip to content

Commit

Permalink
fix: cd before exec for argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu1nness committed Oct 3, 2024
1 parent 6a0792e commit 75e34c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions snap/local/drop_priv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 75e34c5

Please sign in to comment.