OpenBSD CVS

CVS log for src/usr.bin/file/Attic/apprentice.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.35, Fri Apr 24 16:24:11 2015 UTC (9 years ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.34: +1 -1 lines
FILE REMOVED

New implementation of the file(1) utility. This is a simplified,
modernised version with a nearly complete magic(5) parser but omits some
of the complex builtin tests (notably ELF) and has a reduced set of
options.

ok deraadt

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jan 16 18:08:15 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.33: +1 -5 lines
Diff to previous 1.33 (colored)

Add missing <limits.h> to file.c and remove definition of PATH_MAX
which masked the missing include.  OK deraadt@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jan 16 08:24:04 2015 UTC (9 years, 4 months ago) by doug
Branch: MAIN
Changes since 1.32: +6 -6 lines
Diff to previous 1.32 (colored)

Replace <sys/param.h> with <limits.h>

This patch is from Theo.  I helped verify that removing <sys/param.h>
doesn't change anything.

This produces the same binaries before and after with clang 3.5 and gcc
4.9.4 on amd64.  There is a slight difference in the way it is generated by
our old gcc 4.2.1 despite the fact that the preprocessed input is almost
identical.

ok deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Sun Oct 26 04:10:26 2014 UTC (9 years, 6 months ago) by brad
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Place additional parantheses around readdir() and check return does not
equal NULL.

apprentice.c:645:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]

With input and ok guenther@

Revision 1.31 / (download) - annotate - [select for diffs], Sun May 18 17:50:11 2014 UTC (10 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.30: +12 -11 lines
Diff to previous 1.30 (colored)

use reallocarray
okay ian@, chl@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jan 16 21:45:33 2014 UTC (10 years, 4 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.29: +5 -3 lines
Diff to previous 1.29 (colored)

Avoid size_t overflow in apprentice_map.

ok millert

Revision 1.29 / (download) - annotate - [select for diffs], Wed Nov 11 16:21:51 2009 UTC (14 years, 6 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, 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.28: +2 -2 lines
Diff to previous 1.28 (colored)

fix a buffer overflow found by parfait
ok millert@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:37 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +1 -5 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Thu Aug 27 16:26:42 2009 UTC (14 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +6 -5 lines
Diff to previous 1.26 (colored)

Appease gcc2 (I wish people would write in C, rather than "latest crap
gcc added")
ok millert miod

Revision 1.26 / (download) - annotate - [select for diffs], Fri Apr 24 18:54:34 2009 UTC (15 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.25: +410 -133 lines
Diff to previous 1.25 (colored)

file update to 4.24

The '-i' switch is now enabled so file(1) can output mime type strings.

ok ian@
builk ports build test on amd64 by jasper@

ok ray@ gilles@ on a almost identical diff
builk ports build test on sparc64 on this almost identical diff by ajacoutot@
also tested by landry@

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 8 01:40:56 2008 UTC (16 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.24: +972 -269 lines
Diff to previous 1.24 (colored)

Update file to 4.21.

tested by ian@ sthen@

OK ian@, "move ahead with it" deraadt@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 5 14:29:46 2007 UTC (16 years, 7 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.23: +5 -8 lines
Diff to previous 1.23 (colored)

use strcspn instead of strchr to properly overwrite '\n' in fgets returned buffer
check if the first byte is NUL instead of invoking strlen()

with help of ray@ "Looks OK" millert@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 31 18:06:27 2006 UTC (17 years, 6 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.22: +7 -3 lines
Diff to previous 1.22 (colored)

Don't blindly truncate buf[strlen(buf) - 1] without checking for
newline.

Initial patch from Charles Longeau <chl at tuxfamily dot org>, fix
inspired by comment by Anonymous Coward on undeadly.

OK moritz@, ian@.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Apr 4 14:17:01 2006 UTC (18 years, 1 month ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.21: +2 -3 lines
Diff to previous 1.21 (colored)

Remove unused variable, spotted by otto@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Apr 4 10:53:40 2006 UTC (18 years, 1 month ago) by pedro
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

Fix case where a string could not be correctly terminated, okay jaredy@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 25 09:19:35 2004 UTC (19 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

tidy buffer sizes, from Alexander Farber, PR 3924. ok tedu@

Revision 1.19 / (download) - annotate - [select for diffs], Wed May 19 02:32:35 2004 UTC (20 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.18: +696 -174 lines
Diff to previous 1.18 (colored)

big update to file 4.09.  ok ian@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jun 13 18:31:14 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.17: +2 -7 lines
Diff to previous 1.17 (colored)

ian gives permission for 3/4 removal

Revision 1.17 / (download) - annotate - [select for diffs], Mon Apr 7 19:03:46 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.16: +8 -5 lines
Diff to previous 1.16 (colored)

string fixes; ian ok

Revision 1.16 / (download) - annotate - [select for diffs], Tue Mar 11 21:26:26 2003 UTC (21 years, 2 months ago) by ian
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.15: +32 -24 lines
Diff to previous 1.15 (colored)

Replace TPUM license with standard BSD-style license

Revision 1.15 / (download) - annotate - [select for diffs], Mon Aug 12 00:42:56 2002 UTC (21 years, 9 months ago) by aaron
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Swap args to calloc(3) so they are in the correct order; art@ ok.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jun 5 13:46:44 2002 UTC (21 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

use types in inttypes.h directly

Revision 1.13 / (download) - annotate - [select for diffs], Thu Mar 14 06:51:41 2002 UTC (22 years, 2 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Remove \n from err/errx/warn/warnx().

millert@ ok

Revision 1.12 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:46 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.11: +8 -8 lines
Diff to previous 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.11 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:13 2001 UTC (22 years, 6 months ago) by mpech
Branch: MAIN
Changes since 1.10: +7 -7 lines
Diff to previous 1.10 (colored)

kill more registers

millert@ ok

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Fri Oct 6 21:16:12 2000 UTC (23 years, 7 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Pull in patch from current (even more to come):
Fix (millert):
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jun 30 16:00:13 2000 UTC (23 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant).  These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 6 00:32:28 1999 UTC (24 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

oflow

Revision 1.8 / (download) - annotate - [select for diffs], Sun Sep 26 20:47:28 1999 UTC (24 years, 7 months ago) by ian
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.7: +6 -5 lines
Diff to previous 1.7 (colored)

Increase MAXMAGIS again, and change the reallocation - don't need to
skimp on memory as much as when this code was written! (Thanks Theo).

Revision 1.7 / (download) - annotate - [select for diffs], Fri Aug 21 04:25:02 1998 UTC (25 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

oops

Revision 1.6 / (download) - annotate - [select for diffs], Wed Aug 19 17:20:01 1998 UTC (25 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +10 -5 lines
Diff to previous 1.5 (colored)

realloc fix

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 10 15:05:13 1998 UTC (25 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.4: +13 -16 lines
Diff to previous 1.4 (colored)

err/warn

Revision 1.4 / (download) - annotate - [select for diffs], Sun Feb 9 23:58:16 1997 UTC (27 years, 3 months ago) by millert
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.3: +13 -13 lines
Diff to previous 1.3 (colored)

Updates file(1) to version 3.22 by way to NetBSD.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 26 05:32:54 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

rcsid

Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 14 03:30:01 1995 UTC (28 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +52 -20 lines
Diff to previous 1.1 (colored)

update from netbsd

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:08 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)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:08 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

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.