Skip to content

Commit

Permalink
Check if auth-minimum-user-id is already set to zero on rootless (#709)
Browse files Browse the repository at this point in the history
Closes #653

The patch does some minimal grep/sed parsing of
`/etc/rstudio/rserver.conf`, which may not be super robust, but good and
simple enough for our use case

---------

Co-authored-by: eitsupi <[email protected]>
  • Loading branch information
zeehio and eitsupi authored Oct 29, 2023
1 parent 0821d1b commit 8e7b4cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/init_userconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ elif [ -z "$PASSWORD" ]; then
fi

if [ "${RUNROOTLESS}" = "true" ]; then
check_user_id=$(grep -F "auth-minimum-user-id" /etc/rstudio/rserver.conf)
if [[ -n $check_user_id ]]; then
check_user_id="$(grep -F auth-minimum-user-id /etc/rstudio/rserver.conf | sed -e 's/^.*= *//')"
if [[ "$check_user_id" = "0" ]]; then
echo "root user already authorized in /etc/rstudio/rserver.conf: $check_user_id, not changed"
elif [[ -n $check_user_id ]]; then
echo "minimum authorised user already exists in /etc/rstudio/rserver.conf: $check_user_id"
echo "RUNROOTLESS=true mode requires setting minimum authorised user to 0. Exiting"
exit 1
Expand Down

0 comments on commit 8e7b4cf

Please sign in to comment.