Bug 8344 - Some tab completions require root
Summary: Some tab completions require root
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: MediumPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-15 13:24 CEST by Tobias
Modified: 2024-07-12 11:18 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Tobias cendio 2024-05-15 13:24:08 CEST
Some tab completions, e.g. agents for tlctl load show <agent>, requires root.

As non-root, executing
> sudo tlctl load show MyAgent 
works perfectly fine, but tab completing the agent value won't work since the script is not run with sudo in that instance. It won't crash, but nothing is returned.

Most scripts exhibit this problem with tab completing dynamic data that has to be queried, such as active user or agent names.
Comment 1 Samuel Mannehed cendio 2024-05-21 16:06:04 CEST
Note that we have to options for solving this:

 1. Use a different way to get the required information. For example, instead of asking vsmserver, configured agent hostnames could be retreived using tl-config, which doesn't need root.

 2. Try asking for sudo permissions for tab completion, perhaps sudorelaunch could work for us here? Perhaps there are saved credentials in the terminal already?
Comment 2 Samuel Mannehed cendio 2024-07-12 10:56:08 CEST
Note that this also applies to hiveconf paths in tl-config:

> $ tl-config -a /tlwebadm
> /tlwebadm: Folder not found
>  
> # tl-config -a /tlwebadm
> username = admin
> password = xxx
> cert = /opt/thinlinc/etc/tlwebadm/server.crt
> certkey = /opt/thinlinc/etc/tlwebadm/server.key
> listen_port = 1010
> gnutls_priority = NORMAL
> logging/

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