From ba19740f182144e65bae523f5bb8d66a080ad5f5 Mon Sep 17 00:00:00 2001 From: kettenis <> Date: Fri, 28 Aug 2015 19:54:06 +0000 Subject: [PATCH] Remove lies about openpty(4) searching for a free pseudo-tty by iterating through all existing pseudo-tty devices in /dev. --- src/lib/libutil/openpty.3 | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/lib/libutil/openpty.3 b/src/lib/libutil/openpty.3 index 562e89c9..a49e533a 100644 --- a/src/lib/libutil/openpty.3 +++ b/src/lib/libutil/openpty.3 @@ -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