Configuring nearest.hconf to include a printer that doesn't exist makes tl-limit-printers crash. > root@dhcp-254-8:~# USER=cendio tl-limit-printers -v > Waiting for lock on /var/opt/thinlinc/utils/tl-printer/tl-limit-printers.lock > Acquired lock > Hardware addresses associated with user: ['52:54:00:D7:5C:66'] > Current list of printers: ['nearest', 'thinlocal'] > Traceback (most recent call last): > File "/opt/thinlinc/sbin/tl-limit-printers", line 73, in <module> > sys . exit ( II1i ( sys . argv [ 1 : ] ) ) > File "/opt/thinlinc/sbin/tl-limit-printers", line 59, in II1i > limit_printers ( IIIiI11ii , os . environ [ 'USER' ] , verbose = II ) > File "/opt/thinlinc/modules/thinlinc/tlprinter.py", line 610, in limit_printers > oOOoo ) > File "/opt/thinlinc/modules/thinlinc/tlprinter.py", line 538, in construct_printer_acl > ( oOO00O , iiIi1i ) = build_printer_access_map ( hive ) > File "/opt/thinlinc/modules/thinlinc/tlprinter.py", line 396, in build_printer_access_map > oOO00O [ oO0o0Ooooo ] . append ( 'unknown' ) > KeyError: 'lolfinnsinte'
This is a problem for non-existing printers defined on the locations used for unknown terminals.
It's easiest to reproduce this by manually configuring a location in /opt/thinlinc/etc/conf.d/nearest.hconf and specifying a printer that doesn't exist and make sure to set "useforunknown" to true. tlwebadm seems to get a list of valid printers automatically.
Fixed now, a log msg will be written for such printers. Tested using nighly build on RHEL 8. The following conf was used: > [/printing/nearest] > > [/printing/nearest/locations/New location] > printers=nowhere > useforunknown=false > description= > > [/printing/nearest/locations/hej] > printers=finnsinte > useforunknown=true > description=ojoj > > [/printing/nearest/terminals/00:50:56:B0:07:F0] > printers= > location=New location > name=New terminal It gives the following line in the vsmserver log: > 2020-11-04 15:12:55 WARNING vsmserver.extproc: ['/opt/thinlinc/etc/sessionreconnect.d/tl-limit-printers'] wrote to stderr: The printer 'finnsinte' was not found.
Tested on Fedora 32, looks good. Reproduced the crash by using the tl-limit-printers script, and it does no longer crash after the fix. The warning was also added to the vsmserver log. However, the non-existing printers are incorrectly added to the list of existing printers. This is already reported as a separate bug (bug 7588).