Browse Source

Remove lies about openpty(4) searching for a free pseudo-tty by iterating

through all existing pseudo-tty devices in /dev.
OPENBSD_5_9
kettenis 9 years ago
parent
commit
ba19740f18
1 changed files with 6 additions and 12 deletions
  1. +6
    -12
      src/lib/libutil/openpty.3

+ 6
- 12
src/lib/libutil/openpty.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: openpty.3,v 1.16 2013/06/05 03:40:26 tedu Exp $
.\" $OpenBSD: openpty.3,v 1.17 2015/08/28 19:54:06 kettenis Exp $
.\" Copyright (c) 1995
.\" The Regents of the University of California. All rights reserved.
.\"
@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: June 5 2013 $
.Dd $Mdocdate: August 28 2015 $
.Dt OPENPTY 3
.Os
.Sh NAME
@ -79,21 +79,15 @@ is non-null, the window size of the slave will be set to the values in
.Pp
The
.Fn openpty
function works in the following way:
first it attempts to allocate the pseudo-tty through the
function allocates the pseudo-tty through the
.Pa /dev/ptm
device (see
.Xr pty 4
for details) and if that fails it searches for a free pseudo-tty by iterating
through all existing pseudo-tty devices in
.Pa /dev .
When a free pseudo-tty is found, its ownership is changed to
the UID of the caller, permissions are set to correct values,
and all earlier uses of that device are revoked (see
for details) which means that its ownership is changed to the UID of
the caller, permissions are set to correct values, and all earlier
uses of that device are revoked (see
.Xr revoke 2
for details).
The first method can work for any user, the second method requires
super-user privileges in most cases.
.Pp
The
.Fn login_tty


Loading…
Cancel
Save