TigerVNC / tigervnc

High performance, multi-platform VNC client and server
https://tigervnc.org
GNU General Public License v2.0
5.04k stars 930 forks source link

Empty config settings for vncserver/vncsession can break service #1791

Open CendioOssman opened 1 month ago

CendioOssman commented 1 month ago

Describe the bug If you specify a setting in one of the vncserver config files, but leave a blank value, then this can for some variables cause the server to fail to start.

To Reproduce Steps to reproduce the behavior:

  1. Enter rendernode= in /etc/tigervnc/vncserver-config-defaults
  2. Start the vncserver@:#.service

Expected behavior Server is running with DRI3 disabled.

Client (please complete the following information): N/A

Server (please complete the following information):

Additional context What happens is that rendernode= gets translated to the argument -rendernode=, but it should be translated to -rendernode "". The reason this works for some variables is that the = form is valid for TigerVNC parameters, but not for Xorg arguments (which -rendernode is).

A workaround in this case it to specify some bogus value instead, as that will also disable DRI3.

CendioOssman commented 1 month ago

The issue seems to be the regexp in vncserver:

        if (my ($k, $v) = /^\s*(\w+)\s*=\s*(.+)$/) {

It requires a non-zero number of characters in the value.