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=989491eb4b325f980e94d27e0ad1a7bee63b6ebd;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