Commit c79e45e
committed
pty: add GetPtyFromFile as safer GetPty
Security-conscious callers may wish to have more control over opening
/dev/ptmx, and so GetPty is not suitable for them. Previously it was not
possible for such users to open /dev/ptmx and then use this package to
create new ptys and manage the console.
On Linux, the intended usage would be for a daemon to get an O_PATH
handle to /dev/ptmx that can then be re-opened (through procfs) to get a
new handle to /dev/ptmx. I suspect on FreeBSD you could use O_EMPTY_PATH
to accomplish something similar.
Signed-off-by: Aleksa Sarai <[email protected]>1 parent 12ba745 commit c79e45e
2 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
| |||
0 commit comments