Bug 5703 - Location names containing '/' aren't handled well by tlwebadm
Summary: Location names containing '/' aren't handled well by tlwebadm
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Web Administration (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Samuel Mannehed
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-02 16:12 CET by Karl Mikaelsson
Modified: 2023-05-30 13:42 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2015-11-02 16:12:19 CET
Each location consists of a name, a description and a list of printers.

When adding an entry called "Linköping/Teknikringen", tlwebadm doesn't know/care that '/' is a reserved character in hiveconf paths, so it'll write a new entry at the hiveconf path "/printing/nearest/locations/Linköping/Teknikringen".

Adding another entry "Linköping/Wallenbergs gata" will result in the entry "/printing/nearest/locations/Linköping/Wallenbergs gata".

When listing the available locations, tlwebadm will then display a single, empty, entry: "Linköping".
Comment 1 Karl Mikaelsson cendio 2015-11-02 16:13:47 CET
Bug 3586 is related to this problem. This looks like a problem throughout tlwebadm.
Comment 2 Pierre Ossman cendio 2018-06-12 13:00:35 CEST
We have something in appservergroups to combat this. Need to have a look at that.
Comment 3 Niko Lehto cendio 2020-12-15 09:35:39 CET
We also get a traceback in tlwebadm.log when trying to delete a location containing /, e.g 'foo/bar' (shown as foo after creation):

>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20] Traceback (most recent call last):
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/thinlinc/tlwebadm/server.py", line 162, in post_or_get
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     OooO0O00o0 , OOo = getattr ( IIiII11I , action ) ( I11ii1IiIii , query , OooO0O00o0 )
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/thinlinc/tlwebadm/main.py", line 143, in do_POST
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     self . _POST_METHODS . get ( page_name , self . error_404 ) ( query ) )
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/thinlinc/tlwebadm/locations.py", line 63, in locations
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     self . delete_location ( query )
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/thinlinc/tlwebadm/locations.py", line 196, in delete_location
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     recursive = 1 )
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/hiveconf.py", line 537, in delete
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     return parentfolder._delete_folder(comps[-1])
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/hiveconf.py", line 549, in _delete_folder
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     self._folders[foldername]._write_delete_section()
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/hiveconf.py", line 449, in _write_delete_section
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     return hfu.delete_section(self.sectionname)
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]   File "/opt/thinlinc/modules/hiveconf.py", line 1060, in delete_section
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20]     f.seek(section_offset)
>2020-12-15 09:27:53 ERROR tlwebadm[18503]: [::ffff:10.47.1.20] TypeError: '<' not supported between instances of 'NoneType' and 'int'

Note You need to log in before you can comment on or make changes to this bug.