Home | History | Annotate | Download | only in libutil
History log of /src/lib/libutil/pty.c
RevisionDateAuthorComments
 1.32  24-Jun-2018  kamil Fix stack use after scope in libutil/pty

The pt variable's elements are used after the end of the pt scope.
A move of pt to outer scope fixes this.

Detected with MKSANITIZER/ASan with tmux(1), a forkpty(3) user.
 1.31  20-Feb-2009  christos branches: 1.31.38; 1.31.44;
remove pointless static.
 1.30  18-Jan-2009  lukem branches: 1.30.2;
fix -Wsign-compare issues
 1.29  14-Sep-2005  christos Use the re-entrant getgr*_r functions. From John Nemeth.
 1.28  19-Jan-2005  mycroft If TIOCPTMGET fails, close /dev/ptm.
 1.27  25-Nov-2004  christos Don't give write privileges at all if the tty group is missing.
 1.26  24-Nov-2004  christos I really want to kill the hard-coding of _TTY_GID. Set the group to the
primary group of the user if the group tty does not exist.
 1.25  18-Sep-2004  christos KNF; Simplify some logic, so that lines don't wrap. Explain why we
break, continue, or return from the tty scanning loops.
 1.24  18-Sep-2004  yamt openpty: just check errors of syscalls,
instead of checking permission beforehand in userland.
 1.23  18-Jun-2004  christos Don't allow openpty to succeed if the caller is non-superuser.
XXX: we cross-reference ptm 4 which does not exist (yet)
 1.22  27-May-2004  christos use the pty multiplexor if it exists.
 1.21  25-Oct-2003  christos remove unused variable
 1.20  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.19  09-Mar-2002  atatat Fix openpty() so that it correctly scans the entire list of possible
ttys. The new ttys (g-zA-Z) are "optional", since they may not be
present, and their absence is not a "fatal" error.
 1.18  02-Feb-2002  tls Add support for up to 930 pty devices (instead of the current 256).

The openpty() routine has been modified to use the extra pty names
before the "traditional" names, so that programs too dumb to use
openpty() will, hopefully, find one of the "traditional" ptys free
even if many others are in use. The modifications to MAKEDEV are
courtesy Andrew Brown, and are pretty clever: the unit numbers used
by the "traditional" names stay the same, to avoid trouble when
upgrading existing systems. The unusual use of "dd" to index an
array in MAKEDEV is because no other simple method seemed feasible
using only the programs on the install media for all ports.
 1.17  10-May-2001  lukem revert over-zealous pcvt cull; we still need to skip ttyv* whilst pccons uses
ttyv0 on some ports (currently; arm32, bebox, i386, prep). should fix PR 12862.
 1.16  10-Jul-2000  ad Remove PCVT hack.
 1.15  05-Jul-2000  ad - __RCSID() police.
- ANSIfy.
- Miscellaneous style changes.
- Shutup lint(1) in one or two cases.
 1.14  20-Sep-1999  lukem branches: 1.14.8;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12  02-Jul-1999  simonb More trailing white space.
 1.11  09-Dec-1998  christos Delint
 1.10  22-Jan-1998  perry unregisterify
 1.9  22-Jan-1998  perry merge with lite-2
 1.8  29-Jun-1997  christos - RCSID police
- Add ttymsg.3
 1.7  12-Nov-1996  mycroft Make openpty() work more than once.
 1.6  15-May-1996  jtc branches: 1.6.4;
Minor reorganization of libutil, including the addition of passward
locking and editing functions.
From Greg Hudson <ghudson@MIT.EDU>
 1.5  05-Jun-1995  pk Prototypes (PR#1100).
 1.4  04-May-1994  cgd minor cleanup; kill unnecessary casts
 1.3  06-Apr-1994  andrew Support up to 256 ptys.
 1.2  01-Aug-1993  mycroft Add RCS identifiers.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  22-Jan-1998  perry import lite-2 onto vendor branch
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.4.1  10-Dec-1996  mycroft From trunk:
Make openpty(3) work more than once.
 1.14.8.2  15-May-2001  he Pull up revision 1.17 (requested by dogcow):
Since pccons is still used on a few ports, ttyv* should be skipped
in pty allocation.
 1.14.8.1  26-Jul-2000  ad Pull up revision 1.16 (approved by releng):
PCVT is dead.
 1.30.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.31.44.1  25-Jun-2018  pgoyette Sync with HEAD
 1.31.38.1  12-Jul-2018  martin Pull up following revision(s) (requested by kamil in ticket #901):

lib/libutil/pty.c: revision 1.32

Fix stack use after scope in libutil/pty

The pt variable's elements are used after the end of the pt scope.

A move of pt to outer scope fixes this.

Detected with MKSANITIZER/ASan with tmux(1), a forkpty(3) user.

RSS XML Feed