From: Jan Grulich Date: Fri, 3 Jul 2020 11:56:35 +0000 (+0200) Subject: Remove trailing spaces in user name X-Git-Tag: v1.10.90~12^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1056%2Fhead;p=tigervnc.git Remove trailing spaces in user name It's quite easy to make a mistake and add an additional space when configuring users in the vncserver.users config file. You will then get an error that the user doesn't exist and it's hard to spot the mistake. Same applies for a space before the display number. --- diff --git a/unix/vncserver/vncsession-start.in b/unix/vncserver/vncsession-start.in index b20fcdd9..65ee0a81 100644 --- a/unix/vncserver/vncsession-start.in +++ b/unix/vncserver/vncsession-start.in @@ -33,7 +33,7 @@ fi DISPLAY="$1" -USER=`grep "^${DISPLAY}=" "${USERSFILE}" 2>/dev/null | head -1 | cut -d = -f 2-` +USER=`grep "^ *${DISPLAY}=" "${USERSFILE}" 2>/dev/null | head -1 | cut -d = -f 2- | sed 's/ *$//g'` if [ -z "${USER}" ]; then echo "No user configured for display ${DISPLAY}" >&2