summaryrefslogtreecommitdiffstats
path: root/usr.bin/write/write.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-5/+5
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Use user_from_uid(3) if getlogin(2) fails, storing the uid as amillert2018-09-181-9/+5
| | | | string if there is no passwd entry. OK tb@
* Make write explicitly ASCII only by transforming UTF-8 characters and non-ASCIImartijn2016-02-051-15/+24
| | | | | | | | | | bytes to a single '?'. This prevents sending of potentially harmful bytes to terminals who don't support UTF-8. written with help from schwarze@ text suggestions by jmc@ OK schwarze@ and semarie@
* Fix write to other user's tty. The device has to be opened withbluhm2015-10-201-3/+10
| | | | | | O_WRONLY, but without O_CREAT. So freopen(3) has to be replaced with open(2) and dup2(2). from deraadt@
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* unfortunately tame "stdio" can only happen well after the sequence of:deraadt2015-10-061-1/+8
| | | | | | utmp parsing, tty opening, setresgid to drop privs. it only protects a basic io loop. discussed with doug
* Since the dawn of time, this has contained freopen() for the tty pathderaadt2015-10-051-2/+2
| | | | | | | | with mode "w", as root, since "w" implies O_CREAT. That will create the raw file in /dev if it does not yet exist (due to a lie in utmp). It should use "r+", to open it for for O_RDWR only. Oh man this reminds me of 1988, how old is this bug? ok doug
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-5/+5
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* remove casts to time_t * which are not neededderaadt2013-04-161-2/+2
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-14/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* sync synopsis and usage.sobrado2008-07-061-3/+3
|
* if the utmp file is (mysteriously gone) do not assume that the user isderaadt2006-10-041-3/+3
| | | | on the specified tty; problem noted by ilja@suresec.org, ok various
* make these use setres[ug]id for simple privilege dropping;djm2005-07-041-4/+6
| | | | ok deraadt@ millert@ moritz@
* add missing includesdavid2003-07-101-2/+3
| | | | ok deraadt@ tedu@
* mostly ansi cleanup; pval okderaadt2003-06-101-3/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* a few more strlcpyderaadt2003-03-131-8/+8
|
* do not use sys/types.h and sys/param.h together; andrushock@korovino.netderaadt2002-12-091-3/+2
|
* ansi, and revoke privs after opening the ttyderaadt2002-08-041-22/+14
|
* use sizeof w/ defines; niklas@ millert@ ok.fgsch2002-02-211-4/+4
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-8/+8
|
* kill more registersmpech2001-11-191-7/+7
| | | | millert@ ok
* avoid stdio in signal handlerderaadt2001-11-021-3/+3
|
* -Wall cleanup; ok millert@jasoni2001-06-271-5/+8
|
* mark remaining signal races which are difficult to fix, and fix a few partiallyderaadt2001-01-191-7/+10
|
* vis() buf overflowderaadt1999-02-211-3/+3
|
* kill non-POSIX S_IWRITEderaadt1998-07-061-3/+3
|
* missed one change, pointed out by Alex Nash <nash@mcs.net>downsj1996-10-261-3/+3
|
* kill sprintf, use paths.hdownsj1996-10-251-5/+6
|
* VIS_NOSLASHderaadt1996-08-261-3/+3
|
* vis this baby tooderaadt1996-08-261-13/+10
|
* rcsidderaadt1996-06-261-1/+2
|
* handle meta characters; good security idea from freebsdderaadt1995-11-171-5/+10
|
* warn if my permissions are off; but still allow a writederaadt1995-10-231-1/+1
|
* initial import of NetBSD treederaadt1995-10-181-0/+318