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

DirectFB doesn't always need access to /dev/tty0 #14

Open
Mqrius opened this issue Jul 23, 2017 · 2 comments · May be fixed by #22
Open

DirectFB doesn't always need access to /dev/tty0 #14

Mqrius opened this issue Jul 23, 2017 · 2 comments · May be fixed by #22

Comments

@Mqrius
Copy link

Mqrius commented Jul 23, 2017

The information for DirectFB states that the user will always need access to /dev/tty0

Using the single application core you always need access to /dev/tty0, /dev/fb0 and the mouse device (/dev/psaux, /dev/mouse).
You can either run all DirectFB applications as root or allow users to access these devices.

Now I'll readily admit that I don't have a complete understanding of what's going on, but this confuses me. By my understanding, /dev/tty0 is much broader in scope than /dev/tty, as the former refers to "whatever tty is currently on display" while the latter means "the tty that launched the program". For those reasons /dev/tty is has permissions 666 by default.

But if I want to have access to the current terminal, then I should only need access to /dev/tty, I thought. So to try, I recompiled DirectFB, replacing all references to /dev/tty0 with /dev/tty, and ran links2 -g in a virtual terminal

This worked fine. I did have to add myself to the video group for access to /dev/fb0, and to the input group for access to /dev/input for touchpad/mouse control.

As mentioned before, I don't have a full understanding. A blanket replacement of /dev/tty0 with /dev/tty probably broke a whole bunch of other capabilities of DirectFB, perhaps? But it seems to me like there are use cases where only access to /dev/tty is required. It would be nice to limit DirectFB's reach, and only require /dev/tty0 in cases where it can't be avoided.

Thoughts?

Some debugging output:

14:08 ~:\ls -ld /dev/input
drwxr-xr-x 4 root root 400 jul 23 13:59 /dev/input
14:09 ~:\ls -l /dev/tty0
crw-rw---- 1 root tty 4, 0 jul 23 13:59 /dev/tty0
14:09 ~:\ls -l /dev/tty
crw-rw-rw- 1 root tty 5, 0 jul 23 14:00 /dev/tty
14:09 ~:\ls -l /dev/fb0
crw-rw---- 1 root video 29, 0 jul 23 13:59 /dev/fb0
14:09 ~:\ls -ld /dev/input
drwxr-xr-x 4 root root 400 jul 23 13:59 /dev/input
14:09 ~:groups
marius adm cdrom sudo dip video plugdev lpadmin sambashare input
@pleappleappleap
Copy link

I'd like to show my support for this one. I really don't like having to open the permissions up on tty0 for security reasons.

@deniskropp
Copy link
Owner

Thank you for trying /dev/tty which hopefully is enough for the future. Please commit, push and I'll pull that one into main :)

Denis

@Mqrius Mqrius linked a pull request Jul 9, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants