OpenBSD CVS

CVS log for src/usr.bin/sdiff/sdiff.c


[BACK] Up to [local] / src / usr.bin / sdiff

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.39 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:17 2021 UTC (2 years, 6 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.38: +2 -2 lines
Diff to previous 1.38 (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.38 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:20 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Sep 28 18:21:52 2018 UTC (5 years, 7 months ago) by mestre
Branch: MAIN
CVS Tags: 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, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.36: +18 -4 lines
Diff to previous 1.36 (colored)

Add unveil(2) to sdiff(1) to the following files:

filename1 - given via args - read permission
filename2 - same as above
tmpdir - if TMPDIR env var is changed, or _PATH_TMP by default -
read/write/create/delete permissions
/usr/bin/diff - the default diff program - execute permission
_PATH_BSHELL - to spawn an EDITOR/VISUAL if -o is used - execute
permission

this diff only applies unveil(2) if -F is not used, meaning that we are not
changing the default diff program to be used since that way we would need to
find where the binary is whereas by default we are sure that the path is
/usr/bin/diff. this will be revisited at a later stage to cover all cases.

feedback and OK millert@ deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Dec 29 19:04:46 2015 UTC (8 years, 4 months ago) by gsoares
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.35: +2 -2 lines
Diff to previous 1.35 (colored)

fix exit status on pledge(2) failure.

OK tb@ jsg@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Oct 18 04:18:41 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +1 -4 lines
Diff to previous 1.34 (colored)

sorry, sdiff -o interactive mode does another spawn

Revision 1.34 / (download) - annotate - [select for diffs], Thu Oct 15 23:06:46 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +4 -1 lines
Diff to previous 1.33 (colored)

After spawning, the parent can pledge "stdio rpath wpath cpath"
from rob pierce

Revision 1.33 / (download) - annotate - [select for diffs], Sat Oct 10 19:03:08 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +4 -1 lines
Diff to previous 1.32 (colored)

pledge "stdio rpath wpath cpath proc exec". there is some potential
for dropping some path attributes in between, but i will let someone
else do that.
ok doug

Revision 1.32 / (download) - annotate - [select for diffs], Thu Feb 5 12:59:58 2015 UTC (9 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Include stdint.h, not limits.h to get SIZE_MAX.  OK guenther@

Revision 1.31 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:11 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Tue Nov 26 21:08:12 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.29: +5 -5 lines
Diff to previous 1.29 (colored)

unsigned char casts for ctype
ok okan

Revision 1.29 / (download) - annotate - [select for diffs], Mon Apr 1 16:08:00 2013 UTC (11 years, 1 month ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.28: +6 -3 lines
Diff to previous 1.28 (colored)

Avoid memory leak while parsing diff's output.

ok lteo

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jun 7 13:29:50 2009 UTC (14 years, 11 months ago) by ray
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, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.27: +13 -11 lines
Diff to previous 1.27 (colored)

Don't leak FILE * if multiple -o flags are given.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jun 7 13:15:13 2009 UTC (14 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

Use SIZE_MAX, not SIZE_T_MAX.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jun 7 13:09:24 2009 UTC (14 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Don't use $TMPDIR if it is empty.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jun 7 13:06:02 2009 UTC (14 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored)

Plug file descriptor leak when diffing regular files.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jun 7 12:39:40 2009 UTC (14 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

Remove outdated comment.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:34 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jun 28 02:14:41 2007 UTC (16 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.21: +5 -3 lines
Diff to previous 1.21 (colored)

Alias `1' and `2' to `l' and `r', making interactive merges easier
on the fingers.  This was recently added to GNU sdiff:

	http://www.nabble.com/sdiff-UI-enhancement-t3877253.html

Initial diff from Steven Kreuzer <skreuzer (at) exit2shell dot com>.

OK jmc, millert, sobrado, deraadt.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jun 27 04:29:40 2007 UTC (16 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

Add missing undocumented --ignore-case flag, to improve compatibility
with GNU sdiff.

From Steven Kreuzer <skreuzer () exit2shell ! com>

Revision 1.20 / (download) - annotate - [select for diffs], Tue Sep 19 05:52:23 2006 UTC (17 years, 8 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Use S_IS* macros insted of masking with S_IF* flags. The latter may
have multiple bits set, which lead to surprising results. Spotted by
Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@

Revision 1.19 / (download) - annotate - [select for diffs], Thu May 25 03:20:32 2006 UTC (17 years, 11 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.18: +9 -3 lines
Diff to previous 1.18 (colored)

Remove xmktemp() and uses plain old mkstemp(3), avoiding race
conditions.

OK moritz@, otto@

Revision 1.18 / (download) - annotate - [select for diffs], Wed May 10 14:32:51 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.17: +2 -5 lines
Diff to previous 1.17 (colored)

Now that lint is smarter, remove /* NOTREACHED */ comments.

OK jaredy@

Revision 1.17 / (download) - annotate - [select for diffs], Sun Mar 5 07:12:26 2006 UTC (18 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.16: +112 -19 lines
Diff to previous 1.16 (colored)

Handle stdin as arg; from Ray Lai; ok jaredy@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Feb 20 08:29:44 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.15: +6 -12 lines
Diff to previous 1.15 (colored)

refactor processq() loop. From Rai Lay; ok jaredy@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Feb 15 15:27:38 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.14: +10 -7 lines
Diff to previous 1.14 (colored)

Fix bug introduced by previous delint and rename a var. From Ray.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Feb 15 06:58:06 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.13: +40 -46 lines
Diff to previous 1.13 (colored)

delint; from Ray with input from me and jaredy@; ok jaredy@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Feb 14 08:26:20 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.12: +121 -86 lines
Diff to previous 1.12 (colored)

Fix -I and some cleanup, from Ray Lai in PR 5002; ok jaredy@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Dec 28 05:57:46 2005 UTC (18 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

spacing

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 27 05:13:14 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.10: +32 -59 lines
Diff to previous 1.10 (colored)

remove xstrtonum

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 27 05:04:27 2005 UTC (18 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +4 -11 lines
Diff to previous 1.9 (colored)

shorten main initialization

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 27 04:46:32 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.8: +3 -4 lines
Diff to previous 1.8 (colored)

INT_MAX should be big enough for a width

Revision 1.8 / (download) - annotate - [select for diffs], Tue Dec 27 04:43:01 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.7: +3 -130 lines
Diff to previous 1.7 (colored)

remove debug mode

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 27 04:35:22 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

sizeof char is always 1

Revision 1.6 / (download) - annotate - [select for diffs], Tue Dec 27 04:33:31 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.5: +6 -6 lines
Diff to previous 1.5 (colored)

if an allocation function fails, err will print "cannot allocate memory"
for us, just add the name of the function

Revision 1.5 / (download) - annotate - [select for diffs], Tue Dec 27 04:31:06 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.4: +7 -13 lines
Diff to previous 1.4 (colored)

close can't really fail, don't bother checking

Revision 1.4 / (download) - annotate - [select for diffs], Tue Dec 27 04:28:08 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.3: +7 -10 lines
Diff to previous 1.3 (colored)

remove broken assert on argc, and put argc check in right place

Revision 1.3 / (download) - annotate - [select for diffs], Tue Dec 27 04:18:07 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.2: +9 -8 lines
Diff to previous 1.2 (colored)

variables in header should be extern, defined in a c file.
if cast for free is needed because of const nastiness, at least cast to void *

Revision 1.2 / (download) - annotate - [select for diffs], Tue Dec 27 04:06:16 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

OpenBSD tags

Revision 1.1 / (download) - annotate - [select for diffs], Tue Dec 27 04:04:56 2005 UTC (18 years, 4 months ago) by tedu
Branch: MAIN

add a public domain sdiff implementation contributed by ray lai

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.