You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
My /dev/pts/ inside a toolbox have the owner set as root. Outside of toolbox they are owned by my user.
Steps how to reproduce the behaviour
Enter a running toolbox with at least two sessions.
Start python3.
Enter: "import io; tty=io.TextIOWrapper(open("/dev/pts/x", "r+b", buffering=0))" (replace x with one of the session numbers).
Expected behaviour
No error.
Actual behaviour
"PermissionError: [Errno 13] Permission denied: '/dev/pts/x'.
Output of toolbox --version (v0.0.90+) toolbox version 0.0.99.3
Toolbox package info (Github)
tag 0.0.99.3
Output of podman version
e.g.,
Version: 3.0.1
RemoteAPI Version: ?
Go Version: ?
OS/Arch: linux/amd64
``
**Info about your OS**
Debian 11 (bullseye)
**Additional context**
I noticed this problem when using the python debugger module pudb, wanting to display the tui in another terminal.
Reacted by Maximilian Ehlers, Casey Link, Blue and Tomasz Hołubowicz
$ emacsclient --tty
*ERROR*: Could not open file: /dev/pts/1
$ sudo chown ramblurr /dev/pts/1
$ emacsclient --tty
<emacs opens>
I suspect that this is similar to the problem @dustymabe has been facing with gpg-agent and pinentry in #568
Even if you fix the user ownership of the pseudo-terminal device (ie., the output of tty(1)), running emacsclient --tty inside the container doesn't open Emacs in the same terminal. Instead it opens it on a different host terminal whose tty(1) accidentally happens to match the container's.
I use Emacs, but not in a server-client mode, so I am not entirely sure, but I think that the client should open in the same terminal where I typed emacsclient --tty. At least that's what happens on the host.
It's an accident because the pseudo-terminal devices inside the container aren't the same as on the host. They are totally different because the container has it's own devpts file system at /dev/pts within its mount and user namespaces.
Activity
Ramblurr commentedon Dec 8, 2022
This also prevents the use of
emacsclient --tty:For my system:
swick commentedon Feb 20, 2023
This also prevents the mutter kvm test suit from running:
qemu-system-x86_64: -chardev file,id=console,path=/proc/self/fd/2@debarshiray
debarshiray commentedon Mar 6, 2023
I filed containers/crun#1158 for some clarifications and advice.
cmd/create, cmd/initContainer: Mount the devpts file system at runtime
cmd/create, cmd/initContainer: Mount the devpts file system at runtime
cmd/create, cmd/initContainer: Mount the devpts file system at runtime
debarshiray commentedon Mar 8, 2023
That got renamed to containers/crun#1158
debarshiray commentedon Mar 8, 2023
The original problem reported with Python does appear to be solved by PR containers/crun#1159 that's linked from the above podman/crun issue:
debarshiray commentedon Mar 8, 2023
I suspect that this is similar to the problem @dustymabe has been facing with
gpg-agentandpinentryin #568Even if you fix the user ownership of the pseudo-terminal device (ie., the output of
tty(1)), runningemacsclient --ttyinside the container doesn't open Emacs in the same terminal. Instead it opens it on a different host terminal whosetty(1)accidentally happens to match the container's.I use Emacs, but not in a server-client mode, so I am not entirely sure, but I think that the client should open in the same terminal where I typed
emacsclient --tty. At least that's what happens on the host.It's an accident because the pseudo-terminal devices inside the container aren't the same as on the host. They are totally different because the container has it's own
devptsfile system at/dev/ptswithin its mount and user namespaces.debarshiray commentedon Mar 8, 2023
Does containers/crun#1159 help?
I can try to run the mutter test suite myself, but it will take some time. :)
swick commentedon Mar 8, 2023
Always fun to test stuff like this on silverblue. Yes, works like a charm. Thanks!
debarshiray commentedon Mar 9, 2023
Yes, I can imagine. I locally rebuild the RPM with the relevant patch and force it onto my base image. :P
Thanks for testing it, @swick !
debarshiray commentedon Mar 9, 2023
I am closing this on the assumption that the
emacsclient --ttyproblem is unrelated to the other two problems reported here.Please leave a comment or open an issue if you have reason to believe otherwise.