Up to [local] / src / usr.bin / write
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.36 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:18 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE,
OPENBSD_7_5,
OPENBSD_7_4_BASE,
OPENBSD_7_4,
OPENBSD_7_3_BASE,
OPENBSD_7_3,
OPENBSD_7_2_BASE,
OPENBSD_7_2,
OPENBSD_7_1_BASE,
OPENBSD_7_1,
HEAD
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored) to selected 1.11 (colored)
For open/openat, if the flags parameter does not contain O_CREAT, the 3rd (variadic) mode_t parameter is irrelevant. Many developers in the past have passed mode_t (0, 044, 0644, or such), which might lead future people to copy this broken idiom, and perhaps even believe this parameter has some meaning or implication or application. Delete them all. This comes out of a conversation where tb@ noticed that a strange (but intentional) pledge behaviour is to always knock-out high-bits from mode_t on a number of system calls as a safety factor, and his bewilderment that this appeared to be happening against valid modes (at least visually), but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef. ok millert
Revision 1.35 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:05 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE,
OPENBSD_7_0,
OPENBSD_6_9_BASE,
OPENBSD_6_9,
OPENBSD_6_8_BASE,
OPENBSD_6_8,
OPENBSD_6_7_BASE,
OPENBSD_6_7,
OPENBSD_6_6_BASE,
OPENBSD_6_6
Changes since 1.34: +5 -5 lines
Diff to previous 1.34 (colored) to selected 1.11 (colored)
When system calls indicate an error they return -1, not some arbitrary 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.
Revision 1.34 / (download) - annotate - [select for diffs], Tue Sep 18 03:10:53 2018 UTC (5 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE,
OPENBSD_6_5,
OPENBSD_6_4_BASE,
OPENBSD_6_4
Changes since 1.33: +5 -9 lines
Diff to previous 1.33 (colored) to selected 1.11 (colored)
Use user_from_uid(3) if getlogin(2) fails, storing the uid as a string if there is no passwd entry. OK tb@
Revision 1.33 / (download) - annotate - [select for diffs], Fri Feb 5 19:00:39 2016 UTC (8 years, 4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE,
OPENBSD_6_3,
OPENBSD_6_2_BASE,
OPENBSD_6_2,
OPENBSD_6_1_BASE,
OPENBSD_6_1,
OPENBSD_6_0_BASE,
OPENBSD_6_0,
OPENBSD_5_9_BASE,
OPENBSD_5_9
Changes since 1.32: +24 -15 lines
Diff to previous 1.32 (colored) to selected 1.11 (colored)
Make write explicitly ASCII only by transforming UTF-8 characters and non-ASCII 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@
Revision 1.32 / (download) - annotate - [select for diffs], Tue Oct 20 20:21:18 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.31: +10 -3 lines
Diff to previous 1.31 (colored) to selected 1.11 (colored)
Fix write to other user's tty. The device has to be opened with O_WRONLY, but without O_CREAT. So freopen(3) has to be replaced with open(2) and dup2(2). from deraadt@
Revision 1.31 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:09 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.11 (colored)
Change all tame callers to namechange to pledge(2).
Revision 1.30 / (download) - annotate - [select for diffs], Tue Oct 6 03:25:02 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +8 -1 lines
Diff to previous 1.29 (colored) to selected 1.11 (colored)
unfortunately tame "stdio" can only happen well after the sequence of: utmp parsing, tty opening, setresgid to drop privs. it only protects a basic io loop. discussed with doug
Revision 1.29 / (download) - annotate - [select for diffs], Mon Oct 5 07:09:46 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.11 (colored)
Since the dawn of time, this has contained freopen() for the tty path 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
Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:14 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE,
OPENBSD_5_8,
OPENBSD_5_7_BASE,
OPENBSD_5_7
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored) to selected 1.11 (colored)
Replace <sys/param.h> with <limits.h> and other less dirty headers where 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)
Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 16 19:24:55 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE,
OPENBSD_5_6,
OPENBSD_5_5_BASE,
OPENBSD_5_5,
OPENBSD_5_4_BASE,
OPENBSD_5_4
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored) to selected 1.11 (colored)
remove casts to time_t * which are not needed
Revision 1.26 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:50 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE,
OPENBSD_5_3,
OPENBSD_5_2_BASE,
OPENBSD_5_2,
OPENBSD_5_1_BASE,
OPENBSD_5_1,
OPENBSD_5_0_BASE,
OPENBSD_5_0,
OPENBSD_4_9_BASE,
OPENBSD_4_9,
OPENBSD_4_8_BASE,
OPENBSD_4_8,
OPENBSD_4_7_BASE,
OPENBSD_4_7
Changes since 1.25: +1 -14 lines
Diff to previous 1.25 (colored) to selected 1.11 (colored)
rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and 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
Revision 1.25 / (download) - annotate - [select for diffs], Sun Jul 6 13:42:35 2008 UTC (15 years, 11 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE,
OPENBSD_4_6,
OPENBSD_4_5_BASE,
OPENBSD_4_5,
OPENBSD_4_4_BASE,
OPENBSD_4_4
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored) to selected 1.11 (colored)
sync synopsis and usage.
Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 4 21:13:42 2006 UTC (17 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE,
OPENBSD_4_3,
OPENBSD_4_2_BASE,
OPENBSD_4_2,
OPENBSD_4_1_BASE,
OPENBSD_4_1
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.11 (colored)
if the utmp file is (mysteriously gone) do not assume that the user is on the specified tty; problem noted by ilja@suresec.org, ok various
Revision 1.23 / (download) - annotate - [select for diffs], Mon Jul 4 01:54:11 2005 UTC (18 years, 11 months ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE,
OPENBSD_4_0,
OPENBSD_3_9_BASE,
OPENBSD_3_9,
OPENBSD_3_8_BASE,
OPENBSD_3_8
Changes since 1.22: +6 -4 lines
Diff to previous 1.22 (colored) to selected 1.11 (colored)
make these use setres[ug]id for simple privilege dropping; ok deraadt@ millert@ moritz@
Revision 1.22 / (download) - annotate - [select for diffs], Thu Jul 10 00:06:52 2003 UTC (20 years, 11 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE,
OPENBSD_3_7,
OPENBSD_3_6_BASE,
OPENBSD_3_6,
OPENBSD_3_5_BASE,
OPENBSD_3_5,
OPENBSD_3_4_BASE,
OPENBSD_3_4
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored) to selected 1.11 (colored)
add missing includes ok deraadt@ tedu@
Revision 1.21 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:54 2003 UTC (21 years ago) by deraadt
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored) to selected 1.11 (colored)
mostly ansi cleanup; pval ok
Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:24 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.19: +3 -7 lines
Diff to previous 1.19 (colored) to selected 1.11 (colored)
Remove the advertising clause in the UCB license which Berkeley rescinded 22 July 1999. Proofed by myself and Theo.
Revision 1.19 / (download) - annotate - [select for diffs], Thu Mar 13 15:47:12 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE,
OPENBSD_3_3
Changes since 1.18: +8 -8 lines
Diff to previous 1.18 (colored) to selected 1.11 (colored)
a few more strlcpy
Revision 1.18 / (download) - annotate - [select for diffs], Mon Dec 9 08:15:29 2002 UTC (21 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +2 -3 lines
Diff to previous 1.17 (colored) to selected 1.11 (colored)
do not use sys/types.h and sys/param.h together; andrushock@korovino.net
Revision 1.17 / (download) - annotate - [select for diffs], Sun Aug 4 01:26:40 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE,
OPENBSD_3_2
Changes since 1.16: +14 -22 lines
Diff to previous 1.16 (colored) to selected 1.11 (colored)
ansi, and revoke privs after opening the tty
Revision 1.16 / (download) - annotate - [select for diffs], Thu Feb 21 07:32:55 2002 UTC (22 years, 3 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE,
OPENBSD_3_1
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored) to selected 1.11 (colored)
use sizeof w/ defines; niklas@ millert@ ok.
Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:59 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.14: +8 -8 lines
Diff to previous 1.14 (colored) to selected 1.11 (colored)
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.
Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:18 2001 UTC (22 years, 6 months ago) by mpech
Branch: MAIN
Changes since 1.13: +7 -7 lines
Diff to previous 1.13 (colored) to selected 1.11 (colored)
kill more registers millert@ ok
Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 2 16:25:30 2001 UTC (22 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.11 (colored)
avoid stdio in signal handler
Revision 1.12 / (download) - annotate - [select for diffs], Wed Jun 27 06:53:55 2001 UTC (22 years, 11 months ago) by jasoni
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE,
OPENBSD_3_0
Changes since 1.11: +8 -5 lines
Diff to previous 1.11 (colored)
-Wall cleanup; ok millert@
Revision 1.11 / (download) - annotate - [selected], Fri Jan 19 17:58:21 2001 UTC (23 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE,
OPENBSD_2_9
Changes since 1.10: +10 -7 lines
Diff to previous 1.10 (colored)
mark remaining signal races which are difficult to fix, and fix a few partially
Revision 1.10 / (download) - annotate - [select for diffs], Sun Feb 21 08:28:16 1999 UTC (25 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE,
OPENBSD_2_8,
OPENBSD_2_7_BASE,
OPENBSD_2_7,
OPENBSD_2_6_BASE,
OPENBSD_2_6,
OPENBSD_2_5_BASE,
OPENBSD_2_5
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.11 (colored)
vis() buf overflow
Revision 1.9 / (download) - annotate - [select for diffs], Mon Jul 6 18:35:20 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE,
OPENBSD_2_4
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored) to selected 1.11 (colored)
kill non-POSIX S_IWRITE
Revision 1.8 / (download) - annotate - [select for diffs], Sat Oct 26 22:49:12 1996 UTC (27 years, 7 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE,
OPENBSD_2_3,
OPENBSD_2_2_BASE,
OPENBSD_2_2,
OPENBSD_2_1_BASE,
OPENBSD_2_1
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored) to selected 1.11 (colored)
missed one change, pointed out by Alex Nash <nash@mcs.net>
Revision 1.7 / (download) - annotate - [select for diffs], Fri Oct 25 06:15:03 1996 UTC (27 years, 7 months ago) by downsj
Branch: MAIN
Changes since 1.6: +6 -5 lines
Diff to previous 1.6 (colored) to selected 1.11 (colored)
kill sprintf, use paths.h
Revision 1.6 / (download) - annotate - [select for diffs], Mon Aug 26 10:28:20 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE,
OPENBSD_2_0
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored) to selected 1.11 (colored)
VIS_NOSLASH
Revision 1.5 / (download) - annotate - [select for diffs], Mon Aug 26 10:22:11 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +10 -13 lines
Diff to previous 1.4 (colored) to selected 1.11 (colored)
vis this baby too
Revision 1.4 / (download) - annotate - [select for diffs], Wed Jun 26 05:44:00 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored) to selected 1.11 (colored)
rcsid
Revision 1.3 / (download) - annotate - [select for diffs], Fri Nov 17 12:39:20 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +10 -5 lines
Diff to previous 1.2 (colored) to selected 1.11 (colored)
handle meta characters; good security idea from freebsd
Revision 1.2 / (download) - annotate - [select for diffs], Mon Oct 23 09:44:02 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored) to selected 1.11 (colored)
warn if my permissions are off; but still allow a write
Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:47:00 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.11 (colored)
initial import of NetBSD tree
Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:47:00 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN
Diff to selected 1.11 (colored)
Initial revision