History log of /freebsd-current/lib/libutil/pty.c
Revision Date Author Comments
# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# a4aaee21 17-Aug-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

forkpty: Avoid fd leak if fork() fails.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D41491


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 636402a7 23-May-2018 John Baldwin <jhb@FreeBSD.org>

Use __SCCSID() for SCCS IDs.

- Define NO__SCCSID in CFLAGS to preserve existing behavior of omitting
SCCS IDs by default.
- While here, fix the $FreeBSD$ in pw_util.c to use __FBSDID.


# 7e8fba78 27-Dec-2017 Warner Losh <imp@FreeBSD.org>

Close slave on fork error to prevent pty fd leak.

CID: 978209


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# b4d2cfd9 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Add missing header.


# b8cbf1a3 28-Oct-2008 Ed Schouten <ed@FreeBSD.org>

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


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 8d333b3c 03-Oct-2008 Ed Schouten <ed@FreeBSD.org>

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


# c50897c3 15-Jan-2008 John Baldwin <jhb@FreeBSD.org>

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.


# d3f57683 15-Jan-2008 Colin Percival <cperciva@FreeBSD.org>

Back out last commit, since it accidentally broke pts.

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


# 160e7697 14-Jan-2008 Colin Percival <cperciva@FreeBSD.org>

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


# 889befc4 20-Dec-2007 John Baldwin <jhb@FreeBSD.org>

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


# 790c2471 19-Nov-2007 John Baldwin <jhb@FreeBSD.org>

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


# ee7093a6 08-Jan-2007 Warner Losh <imp@FreeBSD.org>

Remove California Regent's clause 3, per letter


# db256336 25-Jan-2006 Olivier Houchard <cognet@FreeBSD.org>

Teach openpty() how to deal with pts.


# 547fa0d9 18-Oct-2003 Mark Murray <markm@FreeBSD.org>

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


# 0ebec5d3 14-Jun-2003 Mark Murray <markm@FreeBSD.org>

Tidy up. Sort headers.


# be04b6d1 21-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove 'register' keyword.


# 8719c58f 30-Sep-2001 Matthew Dillon <dillon@FreeBSD.org>

Add __FBSDID()s to libutil


# f6f1b6b6 10-Mar-2001 Bill Fumerola <billf@FreeBSD.org>

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.


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 5095f191 23-May-1999 John Birrell <jb@FreeBSD.org>

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


# 8b1ef8d4 09-Oct-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

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


# 673b7946 13-Aug-1997 Steve Price <steve@FreeBSD.org>

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>


# 5500fdcd 02-Jul-1997 Bruce Evans <bde@FreeBSD.org>

Import Lite2's src/lib, except for non-i386 machine-dependent directories,
libc/db, libc/gen/crypt.* and libtelnet. All affected files except 3
unimportant ones have already left the vendor branch.


# 51295a4d 12-Jul-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

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


# 3b7e1cc8 01-Jan-1996 Peter Wemm <peter@FreeBSD.org>

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.


# 1b88e35b 22-Oct-1995 Bruce Evans <bde@FreeBSD.org>

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


# 6c06b4e2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 1338e009 09-Feb-1995 Jordan K. Hubbard <jkh@FreeBSD.org>

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


# 58f0484f 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Lib Sources