Skip to content

Commit

Permalink
fix owner of extracted files if you use a different user when launchi…
Browse files Browse the repository at this point in the history
…ng the install.sh script.

before:
If you launch the script as foo, with sudo, extracted files owner is the one who create the archive.
after:
If you launch the script as foo, with sudo, and RTKBASE_USER is basegnss, extracted files owner is basegnss.

Fix #413 and fix #375
  • Loading branch information
Stefal committed Nov 24, 2024
1 parent 5d98bf3 commit ed9b58d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ install_rtkbase_bundled() {
ARCHIVE=$(awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "${0}")
# Check if there is some content after __ARCHIVE__ marker (more than 100 lines)
[[ $(sed -n '/^__ARCHIVE__/,$p' "${0}" | wc -l) -lt 100 ]] && echo "RTKBASE isn't bundled inside install.sh. Please choose another source" && exit 1
sudo -u "${RTKBASE_USER}" tail -n+${ARCHIVE} "${0}" | tar xpJv && \
sudo -u "${RTKBASE_USER}" tail -n+${ARCHIVE} "${0}" | sudo -u "${RTKBASE_USER}" tar xpJv && \
_add_rtkbase_path_to_environment
}

Expand Down

0 comments on commit ed9b58d

Please sign in to comment.