History log of /freebsd-9.3-release/lib/libutil/pty.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 184634 04-Nov-2008 des

Add missing header.


# 184389 28-Oct-2008 ed

Remove unneeded call to revoke() inside openpty().

As discussed on the commits list, there is no need to call revoke()
inside openpty(). On RELENG_6 and RELENG_7 unlockpt() will call
revoke(). On HEAD we create pseudo-terminals on demand, so there is no
need to revoke the slave device node.

This change should never be MFC'd, because the implementation we have in
RELENG_6 and RELENG_7 should work flawlessly with older versions of
libc.

Discussed with: jhb
MFC after: never


# 183565 03-Oct-2008 ed

Small cleanups to openpty().

- Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
consistently on implementations that make the PTY the controlling TTY
by default.

- Call unlockpt() before opening the slave device. POSIX mentions that
de slave device should only be opened after grantpt() and unlockpt()
have been called.

- Replace some redundant code by a label.

In theory we could remove a lot of code from openpty() on FreeBSD
-CURRENT, because grantpt(), unlockpt() and revoke() are not needed in
our implementation. We'd better keep them there. This makes the code
still work with older FreeBSD releases and even makes it work on other
non-BSD operating systems.

I've compiled openpty() on Linux. You only need to remove the revoke()
call, because revoke() on Linux always returns -1. Apart from that, it
seems to work like it should.

Reviewed by: jhb


# 175352 15-Jan-2008 jhb

Put back the openpty(3) and ptsname(3) fixes but don't disable ptsname(3)
on pts(4) devices this time. This fixes the issues while leaving pts(4)
enabled on HEAD.


# 175350 15-Jan-2008 cperciva

Back out last commit, since it accidentally broke pts.

The security fix will be re-committed soon, hopefully without breaking
anything.


# 175330 14-Jan-2008 cperciva

Fix issues which allow snooping on ptys. [08:01]

Fix an off-by-one error in inet_network(3). [08:02]

Security: FreeBSD-SA-08:01.pty
Security: FreeBSD-SA-08:02.libc


# 174818 20-Dec-2007 jhb

Invoke revoke(2) on the slave pty in the pts(4) case (new_openpty()) to
kick off any other users on the device line before using it since
openpty(3) is documented to do this. Note that grantpt(3) does not
call revoke(2), it only adjusts permissions and ownership.

MFC after: 3 days


# 173755 19-Nov-2007 jhb

Bump up the number of ttys supported by pty(4) to 512 by making use of
[pt]ty[lmnoLMNO][0-9a-v].

MFC after: 3 days
Reviewed by: rwatson


# 165906 08-Jan-2007 imp

Remove California Regent's clause 3, per letter


# 154835 25-Jan-2006 cognet

Teach openpty() how to deal with pts.


# 121193 18-Oct-2003 markm

ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.


# 116344 14-Jun-2003 markm

Tidy up. Sort headers.


# 92913 21-Mar-2002 obrien

Remove 'register' keyword.


# 84225 30-Sep-2001 dillon

Add __FBSDID()s to libutil


# 74068 10-Mar-2001 billf

In theory it would be perfectly legal for a system administrator to

# cd /dev && ./MAKEDEV pty0 pty3
and/or
# rm -rf /dev/ptyp0

and expect all programs that use openpty() to still try to find available ptys.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 47449 23-May-1999 jb

Remove the static declaration from the line[] variable to allow
openpty() to be called from a threaded application.


# 40117 09-Oct-1998 jkh

Now take stdio.h out of files that don't require it.


# 28179 13-Aug-1997 steve

Protect the copyright comments from reformatting by
indent and make this compile -Wall clean like the
Makefile suggests that it should. :)

Pointed out by: Bruce Evans <bde@zeta.org.au>


# 17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


# 13137 01-Jan-1996 peter

Bump libutil revision after recent addition of setproctitle().

Install (optional) libutil.h with prototypes for the functions and
document this in the man page.

minor cleanups to the various routines, include the prototype file, declare
return codes etc.


# 11681 22-Oct-1995 bde

Update to 4.4lite2 (clean up includes; initialize the name of the master
pty correctly (it was broken for calls to openpty() after the first
successful one)).
Obtained from: 4.4lite2


# 8870 30-May-1995 rgrimes

Remove trailing whitespace.


# 6264 09-Feb-1995 jkh

Support for >32 PTYs.
Submitted by: Heikki Suonsivu <hsu@cs.hut.fi>


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources