Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap Install Tio - Using Classic Confinement #187

Closed
bhass1 opened this issue Jan 28, 2023 · 6 comments
Closed

Snap Install Tio - Using Classic Confinement #187

bhass1 opened this issue Jan 28, 2023 · 6 comments
Labels

Comments

@bhass1
Copy link
Contributor

bhass1 commented Jan 28, 2023

dev1@dev1-desktop:~$ snap install tio
error: This revision of snap "tio" was published using classic confinement and
       thus may perform arbitrary system changes outside of the security
       sandbox that snaps are usually confined to, which may put your system at
       risk.

       If you understand and want to proceed repeat the command including
       --classic.

Is there any work being done to have the tio snap use "strict" confinement instead of "classic," and then use defined snap interfaces ?

Are there technical limitations?

@lundmar
Copy link
Member

lundmar commented Jan 28, 2023

Last time I checked up on the snapcraft framework it was required to specify exactly which serial device to allow connection to. This is of course unacceptable for a tool like tio which needs access to any serial port.

@bhass1
Copy link
Contributor Author

bhass1 commented Jan 29, 2023

Yeah, agreed that is unacceptable to specify exactly which serial device to allow connection to.

I didn't look too deeply into this yet, but I think it could be considered an enhancement of tio to get rid of this error by adhering to "strict" confinement rules.

Could also be helpful for the time being to have a note about this in the README under "4.2 Installation using snap (Linux)."

@lundmar
Copy link
Member

lundmar commented Jan 29, 2023

Pull requests are welcome ;)

@bhass1
Copy link
Contributor Author

bhass1 commented Jan 29, 2023

Yes, of course :)

I'm trying not to make commitments that I won't follow through with, but at the same time provide useful input. I'll see what I can do tomorrow ;)

@KhazAkar
Copy link

KhazAkar commented May 26, 2024

I'd request opening it again, since there's an appropriate plug available right now - raw-usb. I have locally experimental build of tio as snap using strict confinement, and it seems to work fine. To get it to snap store live, there's a simple process on the forum to request auto-connection for such snap, since this plug is a system, privileged one.

Docs:
https://snapcraft.io/docs/raw-usb-interface
https://snapcraft.io/docs/system-interfaces

Output of such snap after building :)

khazakar@msi-bravo-15:~/Projects/tio-strict.snapcraft$ snapcraft
Generated snap metadata                                                                                                                                                                      
Lint warnings:                                                                                                                                                                               
- library: libgthread-2.0.so.0: unused library 'usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0.7200.4'. (https://snapcraft.io/docs/linters-library)                                            
- library: liblua5.2-c++.so.0: unused library 'usr/lib/x86_64-linux-gnu/liblua5.2-c++.so.0.0.0'. (https://snapcraft.io/docs/linters-library)                                                 
Created snap package tio-strict_3.4_amd64.snap                                                                                                                                               
khazakar@msi-bravo-15:~/Projects/tio-strict.snapcraft$ snap install tio-strict_3.4_amd64.snap --dangerous
tio-strict 3.4 installed
khazakar@msi-bravo-15:~/Projects/tio-strict.snapcraft$ snap connect tio-strict:raw-usb
khazakar@msi-bravo-15:~/Projects/tio-strict.snapcraft$ tio-strict.tio /dev/ttyUSB0
[20:42:30.878] tio v3.4
[20:42:30.878] Press ctrl-t q to quit
[20:42:30.886] Connected to /dev/ttyUSB0

@lundmar
Copy link
Member

lundmar commented May 27, 2024

tio is not only about connecting USB tty devices. tio must be able to connect to any tty device and as long as the snap framework has no policy solution for that we will have to continue use classic confinement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants