util-lib/systemd-run: implement race-free PTY peer opening (#34953)
This makes use of the new TIOCGPTPEER pty ioctl() for directly opening a PTY peer, without going via path names. This is nice because it closes a race around allocating and opening the peer. And also has the nice benefit that if we acquired an fd originating from some other namespace/container, we can directly derive the peer fd from it, without having to reenter the namespace again.
This commit is contained in:
@@ -154,3 +154,6 @@ int terminal_get_size_by_dsr(int input_fd, int output_fd, unsigned *ret_rows, un
|
||||
int terminal_fix_size(int input_fd, int output_fd);
|
||||
|
||||
int terminal_is_pty_fd(int fd);
|
||||
|
||||
int pty_open_peer_racefree(int fd, int mode);
|
||||
int pty_open_peer(int fd, int mode);
|
||||
|
||||
Reference in New Issue
Block a user