CVS commit: src/external/bsd/file

2021-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  9 19:11:42 UTC 2021

Modified Files:
src/external/bsd/file/dist: ChangeLog config.guess config.h.in
configure configure.ac
src/external/bsd/file/dist/doc: file.1 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive cad coff commands diff
elf filesystems games jpeg linux mail.news msdos pgp xenix
src/external/bsd/file/dist/python: Makefile.in
src/external/bsd/file/dist/src: apprentice.c compress.c der.c
encoding.c file.c file.h funcs.c is_csv.c magic.c readelf.c
softmagic.c
src/external/bsd/file/dist/tests: Makefile.in
src/external/bsd/file/include: config.h

Log Message:
merge local changes between 5.39 and 5.40 and add magic entries from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/config.guess
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/config.h.in
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/magic/magdir/archive
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/bsd/file/dist/magic/magdir/cad
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/file/dist/magic/magdir/coff
cvs rdiff -u -r1.1.1.14 -r1.2 \
src/external/bsd/file/dist/magic/magdir/commands
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/magic/magdir/diff \
src/external/bsd/file/dist/magic/magdir/jpeg
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/magic/magdir/elf
cvs rdiff -u -r1.17 -r1.18 \
src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.1.1.10 -r1.2 src/external/bsd/file/dist/magic/magdir/games
cvs rdiff -u -r1.1.1.16 -r1.2 src/external/bsd/file/dist/magic/magdir/linux \
src/external/bsd/file/dist/magic/magdir/msdos
cvs rdiff -u -r1.1.1.9 -r1.2 \
src/external/bsd/file/dist/magic/magdir/mail.news
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/magic/magdir/xenix
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/python/Makefile.in
cvs rdiff -u -r1.25 -r1.26 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/der.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/encoding.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/file.c \
src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/funcs.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/is_csv.c
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/tests/Makefile.in
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.11 src/external/bsd/file/dist/ChangeLog:1.12
--- src/external/bsd/file/dist/ChangeLog:1.11	Sun Jun 14 20:37:24 2020
+++ src/external/bsd/file/dist/ChangeLog	Fri Apr  9 15:11:41 2021
@@ -1,3 +1,33 @@
+2021-03-30  20:21  Christos Zoulas 
+
+	* release 5.40
+
+2021-02-05  16:31  Christos Zoulas 
+
+	* PR/234: Add limit to the number of bytes to scan for encoding
+	* PR/230: Fix /T (trim flag) for regex
+
+2021-02-01  12:31  Christos Zoulas 
+	* PR/77: Trim trailing separator.
+
+2020-12-17  15:44  Christos Zoulas 
+
+	* PR/211: Convert system read errors from corrupt ELF
+	  files into human readable error messages
+
+2020-12-08  16:24  Christos Zoulas 
+	
+	* fix multithreaded decompression file descriptor issue
+	  by using close-on-exec (Denys Vlasenko)
+
+2020-06-27  11:58  Christos Zoulas 
+
+	* Exclude surrogate pairs from utf-8 detection (Michael Liu)
+
+2020-06-25  12:53  Christos Zoulas 
+	
+	* Include # to the list of ignored format chars (Werner Fink)
+
 2020-06-14  20:02  Christos Zoulas 
 
 	* release 5.39

Index: src/external/bsd/file/dist/config.guess
diff -u src/external/bsd/file/dist/config.guess:1.14 src/external/bsd/file/dist/config.guess:1.15
--- src/external/bsd/file/dist/config.guess:1.14	Tue Nov 17 05:35:11 2020
+++ src/external/bsd/file/dist/config.guess	Fri Apr  9 15:11:41 

CVS commit: src/external/bsd/file

2020-06-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 15 00:37:25 UTC 2020

Modified Files:
src/external/bsd/file/dist: ChangeLog Makefile.am Makefile.in configure
configure.ac
src/external/bsd/file/dist/doc: file.1 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive elf filesystems parix
pgp
src/external/bsd/file/dist/src: apprentice.c compress.c der.c file.c
file.h funcs.c is_csv.c is_json.c magic.c print.c readelf.c
softmagic.c
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: shlib_version

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/Makefile.am
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/Makefile.in \
src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/magic/magdir/archive
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/magic/magdir/elf
cvs rdiff -u -r1.16 -r1.17 \
src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/magdir/parix
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/der.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/file.c \
src/external/bsd/file/dist/src/magic.c \
src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/src/funcs.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/is_csv.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/is_json.c
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.10 src/external/bsd/file/dist/ChangeLog:1.11
--- src/external/bsd/file/dist/ChangeLog:1.10	Mon Dec 16 21:31:05 2019
+++ src/external/bsd/file/dist/ChangeLog	Sun Jun 14 20:37:24 2020
@@ -1,3 +1,83 @@
+2020-06-14  20:02  Christos Zoulas 
+
+	* release 5.39
+
+2020-06-07  20:00  Christos Zoulas 
+
+	* Remove unused subtype_mime (Steve Grubb)
+	* Remove unused check in okstat (Steve Grubb)
+	* Fix mime-type in elf binaries by making sure $x is set
+	* Fix indirect negative offsets broken by OFFNEGATIVE
+	* Fix GUID equality check
+	* PR/165: Handle empty array and strings in JSON
+	* PR/162: Add --exclude-quiet
+
+2020-06-06  15:33  Christos Zoulas 
+
+	* Fix memory leak in ascmagic (Steve Grubb)
+
+2020-06-04  00:21  Christos Zoulas 
+
+	* Fix string comparison length with ignore whitespace
+
+2020-05-31  00:11  Christos Zoulas 
+
+	* Fix mingwin 64 compilation
+
+2020-05-30  23:56  Christos Zoulas 
+
+	* PR/159: whitelist getpid needed for file_pipe2file()
+
+2020-05-09  18:57  Christos Zoulas 
+
+	* Indicate negative offsets with a flag OFFNEGATIVE
+	  so that -0 works.
+	* Introduce "offset" magic type that can be used to
+	  detect the file size, and bail on short files.
+	* document DER better in the magic man page.
+
+2020-03-11  21:53  Christos Zoulas 
+
+	* fix memory leaks (SonarQube)
+
+2020-03-08  21:33  Christos Zoulas 
+
+	* fix memory leaks (SonarQube)
+	* rewrite confusing loops (SonarQube)
+	* fix bogus test (SonarQube)
+	* pass a sized buffer to file_fmttime() (SonarQube)
+
+	* fix memory leaks (SonarQube)
+
+2020-02-20  15:50  Christos Zoulas 
+
+	* Don't allow * in printf formats, or the code itself (Christoph Biedl)
+	* Introduce a printf output size checker to avoid DoS attacks
+
+2020-02-17  17:22  Christos Zoulas 
+
+	* Avoid memory leak on error (oss-fuzz)
+	* Check length of string on DER before derefercing and add new types
+	* Add missing DER string (oss-fuzz)
+
+2020-02-16  20:45  Christos Zoulas 
+
+	* Add missing DER types, and debugging
+
+2020-02-13  13:10  Christos Zoulas 
+
+	* PR/140: Avoid abort with hand-crafted magic file (gockelhahn)
+	* PR/139  Avoid DoS in printf with hand-crafted magic file (gockelhahn)
+	* PR/138: 

CVS commit: src/external/bsd/file/dist/magic/magdir

2020-03-08 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Sun Mar  8 17:54:23 UTC 2020

Modified Files:
src/external/bsd/file/dist/magic/magdir: parix

Log Message:
mask was too loose, creating false positives.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/magic/magdir/parix

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/parix
diff -u src/external/bsd/file/dist/magic/magdir/parix:1.1.1.2 src/external/bsd/file/dist/magic/magdir/parix:1.2
--- src/external/bsd/file/dist/magic/magdir/parix:1.1.1.2	Thu May 12 20:47:04 2011
+++ src/external/bsd/file/dist/magic/magdir/parix	Sun Mar  8 17:54:23 2020
@@ -5,7 +5,7 @@
 # Parix COFF executables
 # From: Ignatios Souvatzis 
 #
-0	beshort&0xfff	0xACE	PARIX
+0	beshort&0xefff	0x8ACE	PARIX
 >0	byte&0xf0	0x80	T800
 >0	byte&0xf0	0x90	T9000
 >19	byte&0x02	0x02	executable



CVS commit: src/external/bsd/file

2019-12-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 17 18:59:39 UTC 2019

Modified Files:
src/external/bsd/file: Makefile.inc
src/external/bsd/file/bin: Makefile
src/external/bsd/file/lib: Makefile

Log Message:
Fix sun2 (static linking)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/bin/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.6 src/external/bsd/file/Makefile.inc:1.7
--- src/external/bsd/file/Makefile.inc:1.6	Wed Feb 22 07:34:49 2017
+++ src/external/bsd/file/Makefile.inc	Tue Dec 17 13:59:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2017/02/22 12:34:49 maya Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2019/12/17 18:59:39 christos Exp $
 
 WARNS=4
 DIST=${NETBSDSRCDIR}/external/bsd/file/dist
@@ -21,3 +21,8 @@ CPPFLAGS+=	-DMAGIC='"${MAGIC}"' -DHAVE_C
 CPPFLAGS+=	-I${.CURDIR}/../include -I${DIST}/src
 
 .PATH:		${DIST}/src ${DIST}/doc
+
+DPLIBS+= lzma${NETBSDSRCDIR}/external/public-domain/xz/lib
+DPLIBS+= bz2 ${NETBSDSRCDIR}/lib/libbz2
+DPLIBS+= z   ${NETBSDSRCDIR}/lib/libz
+

Index: src/external/bsd/file/bin/Makefile
diff -u src/external/bsd/file/bin/Makefile:1.3 src/external/bsd/file/bin/Makefile:1.4
--- src/external/bsd/file/bin/Makefile:1.3	Wed Jan 15 20:15:33 2014
+++ src/external/bsd/file/bin/Makefile	Tue Dec 17 13:59:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2014/01/16 01:15:33 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2019/12/17 18:59:39 christos Exp $
 
 .include 
 
@@ -10,8 +10,9 @@ FILES=		${MFILES}
 .endif
 
 PROG=		file
-LDADD+=		-lmagic -lz
-DPADD+=		${LIBMAGIC} ${LIBZ}
+LDADD+=		-lmagic
+DPADD+=		${LIBMAGIC} 
+PROGDPLIBS	+= ${DPLIBS}
 MAN=		file.1 magic.5
 
 CLEANFILES+=	magic.mgc

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.14 src/external/bsd/file/lib/Makefile:1.15
--- src/external/bsd/file/lib/Makefile:1.14	Tue Dec 17 08:35:43 2019
+++ src/external/bsd/file/lib/Makefile	Tue Dec 17 13:59:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2019/12/17 13:35:43 christos Exp $
+#	$NetBSD: Makefile,v 1.15 2019/12/17 18:59:39 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -8,9 +8,7 @@ USE_FORT?= yes	# data driven bugs?
 .include "../Makefile.inc"
 
 LIB=		magic
-LIBDPLIBS+=	lzma	${NETBSDSRCDIR}/external/public-domain/xz/lib
-LIBDPLIBS+=	bz2	${NETBSDSRCDIR}/lib/libbz2
-LIBDPLIBS+=	z	${NETBSDSRCDIR}/lib/libz
+LIBDPLIBS+=	${DPLIBS}
 CPPFLAGS+=-I.
 
 .if ${MACHINE_ARCH} == "i386"



CVS commit: src/external/bsd/file/lib

2019-12-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 17 13:35:43 UTC 2019

Modified Files:
src/external/bsd/file/lib: Makefile

Log Message:
Add more libraries


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.13 src/external/bsd/file/lib/Makefile:1.14
--- src/external/bsd/file/lib/Makefile:1.13	Mon Dec 16 21:31:06 2019
+++ src/external/bsd/file/lib/Makefile	Tue Dec 17 08:35:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/12/17 02:31:06 christos Exp $
+#	$NetBSD: Makefile,v 1.14 2019/12/17 13:35:43 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -8,6 +8,8 @@ USE_FORT?= yes	# data driven bugs?
 .include "../Makefile.inc"
 
 LIB=		magic
+LIBDPLIBS+=	lzma	${NETBSDSRCDIR}/external/public-domain/xz/lib
+LIBDPLIBS+=	bz2	${NETBSDSRCDIR}/lib/libbz2
 LIBDPLIBS+=	z	${NETBSDSRCDIR}/lib/libz
 CPPFLAGS+=-I.
 



CVS commit: src/external/bsd/file/dist/src

2019-12-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec 17 08:02:00 UTC 2019

Modified Files:
src/external/bsd/file/dist/src: readelf.c

Log Message:
Cast an off_t to intmax_t and use %jd to printf it.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/file/dist/src/readelf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.22 src/external/bsd/file/dist/src/readelf.c:1.23
--- src/external/bsd/file/dist/src/readelf.c:1.22	Tue Dec 17 02:31:05 2019
+++ src/external/bsd/file/dist/src/readelf.c	Tue Dec 17 08:02:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.22 2019/12/17 02:31:05 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.23 2019/12/17 08:02:00 martin Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID("@(#)$File: readelf.c,v 1.168 2019/12/16 03:49:19 christos Exp $")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.22 2019/12/17 02:31:05 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.23 2019/12/17 08:02:00 martin Exp $");
 #endif
 #endif
 
@@ -1355,8 +1355,8 @@ doshn(struct magic_set *ms, int clazz, i
 	name_off = xsh_offset;
 
 	if (fsize != SIZE_UNKNOWN && fsize < name_off) {
-		if (file_printf(ms, ", too large section header offset %td",
-		name_off) == -1)
+		if (file_printf(ms, ", too large section header offset %jd",
+		(intmax_t)name_off) == -1)
 			return -1;
 		return 0;
 	}



CVS commit: src/external/bsd/file/dist/magic/magdir

2018-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan  1 03:12:31 UTC 2019

Modified Files:
src/external/bsd/file/dist/magic/magdir: netbsd

Log Message:
bring detail from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/magic/magdir/netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/netbsd
diff -u src/external/bsd/file/dist/magic/magdir/netbsd:1.6 src/external/bsd/file/dist/magic/magdir/netbsd:1.7
--- src/external/bsd/file/dist/magic/magdir/netbsd:1.6	Sun Apr 15 15:45:32 2018
+++ src/external/bsd/file/dist/magic/magdir/netbsd	Mon Dec 31 22:12:30 2018
@@ -9,184 +9,149 @@
 # in aout.
 #
 
-0	belong&03	041400413	a.out NetBSD/i386 demand paged
+0	name	netbsd-detail
+>20	lelong	x		@%#x
+>4	lelong	>0		\b+T=%d
+>8	lelong	>0		\b+D=%d
+>12	lelong	>0		\b+B=%d
+>16	lelong	>0		\b+S=%d
+>24	lelong	>0		\b+TR=%d
+>28	lelong	>0		\b+TD=%d
+
+0	name			netbsd-4096
 >0	byte			&0x80
 >>20	lelong			<4096		shared library
 >>20	lelong			=4096		dynamically linked executable
 >>20	lelong			>4096		dynamically linked executable
 >0	byte			^0x80		executable
 >16	lelong			>0		not stripped
-0	belong&03	041400410	a.out NetBSD/i386 pure
->0	byte			&0x80		dynamically linked executable
+
+0	name			netbsd-8192
+>0	byte			&0x80
+>>20	lelong			<8192		shared library
+>>20	lelong			=8192		dynamically linked executable
+>>20	lelong			>8192		dynamically linked executable
 >0	byte			^0x80		executable
 >16	lelong			>0		not stripped
-0	belong&03	041400407	a.out NetBSD/i386
+>0	use			netbsd-detail
+
+0	name			netbsd-normal
 >0	byte			&0x80		dynamically linked executable
 >0	byte			^0x80
 >>0	byte			&0x40		position independent
 >>20	lelong			!0		executable
 >>20	lelong			=0		object file
 >16	lelong			>0		not stripped
-0	belong&03	041400507	a.out NetBSD/i386 core
+>0	use			netbsd-detail
+
+0	name			netbsd-pure
+>0	byte			&0x80		dynamically linked executable
+>0	byte			^0x80		executable
+>16	lelong			>0		not stripped
+>0	use			netbsd-detail
+
+0	name			netbsd-core
 >12	string			>\0		from '%s'
 >32	lelong			!0		(signal %d)
 
+0	belong&03	041400413	a.out NetBSD/i386 demand paged
+>0	use			netbsd-4096
+
+0	belong&03	041400410	a.out NetBSD/i386 pure
+>0	use			netbsd-pure
+
+0	belong&03	041400407	a.out NetBSD/i386
+>0	use			netbsd-normal
+
+0	belong&03	041400507	a.out NetBSD/i386 core
+>0	use			netbsd-core
+
 0	belong&03	041600413	a.out NetBSD/m68k demand paged
->0	byte			&0x80
->>20	belong			<8192		shared library
->>20	belong			=8192		dynamically linked executable
->>20	belong			>8192		dynamically linked executable
->0	byte			^0x80		executable
->16	belong			>0		not stripped
+>0	use			\^netbsd-8192
+
 0	belong&03	041600410	a.out NetBSD/m68k pure
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80		executable
->16	belong			>0		not stripped
+>0	use			\^netbsd-pure
+
 0	belong&03	041600407	a.out NetBSD/m68k
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80
->>0	byte			&0x40		position independent
->>20	belong			!0		executable
->>20	belong			=0		object file
->16	belong			>0		not stripped
+>0	use			\^netbsd-normal
+
 0	belong&03	041600507	a.out NetBSD/m68k core
->12	string			>\0		from '%s'
->32	belong			!0		(signal %d)
+>0	use			\^netbsd-core
 
 0	belong&03	042000413	a.out NetBSD/m68k4k demand paged
->0	byte			&0x80
->>20	belong			<4096		shared library
->>20	belong			=4096		dynamically linked executable
->>20	belong			>4096		dynamically linked executable
->0	byte			^0x80		executable
->16	belong			>0		not stripped
+>0	use			\^netbsd-4096
+
 0	belong&03	042000410	a.out NetBSD/m68k4k pure
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80		executable
->16	belong			>0		not stripped
+>0	use			\^netbsd-pure
+
 0	belong&03	042000407	a.out NetBSD/m68k4k
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80
->>0	byte			&0x40		position independent
->>20	belong			!0		executable
->>20	belong			=0		object file
->16	belong			>0		not stripped
+>0	use			\^netbsd-normal
+
 0	belong&03	042000507	a.out NetBSD/m68k4k core
->12	string			>\0		from '%s'
->32	belong			!0		(signal %d)
+>0	use			\^netbsd-core
 
 0	belong&03	042200413	a.out NetBSD/ns32532 demand paged
->0	byte			&0x80
->>20	lelong			<4096		shared library
->>20	lelong			=4096		dynamically linked executable
->>20	lelong			>4096		dynamically linked executable
->0	byte			^0x80		executable
->16	lelong			>0		not stripped
+>0	use			netbsd-4096
+
 0	belong&03	042200410	a.out NetBSD/ns32532 pure
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80		executable
->16	lelong			>0		not stripped
+>0	use			netbsd-pure
+
 0	belong&03	042200407	a.out NetBSD/ns32532
->0	byte			&0x80		dynamically linked executable
->0	byte			^0x80

CVS commit: src/external/bsd/file/lib

2018-12-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 12 06:36:13 UTC 2018

Modified Files:
src/external/bsd/file/lib: Makefile

Log Message:
 Use DPSRCS for magic.h. OK'd by Christos.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.10 src/external/bsd/file/lib/Makefile:1.11
--- src/external/bsd/file/lib/Makefile:1.10	Fri Oct 19 00:11:48 2018
+++ src/external/bsd/file/lib/Makefile	Wed Dec 12 06:36:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2018/10/19 00:11:48 christos Exp $
+#	$NetBSD: Makefile,v 1.11 2018/12/12 06:36:13 msaitoh Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -20,6 +20,7 @@ CPPFLAGS+=-I.
 SRCS=		magic.c apprentice.c softmagic.c ascmagic.c compress.c	\
 		is_json.c is_tar.c readelf.c print.c fsmagic.c apptype.c \
 		funcs.c cdf.c readcdf.c cdf_time.c encoding.c der.c buffer.c
+DPSRCS=		magic.h
 MAN=		libmagic.3
 MLINKS+=	libmagic.3 magic_open.3 \
 		libmagic.3 magic_close.3 \
@@ -41,5 +42,3 @@ magic.h:magic.h.in
 CLEANFILES+=	magic.h
 
 .include 
-
-${ALLOBJS}:	magic.h



CVS commit: src/external/bsd/file/dist/src

2018-10-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 19 00:32:47 UTC 2018

Modified Files:
src/external/bsd/file/dist/src: file.h readelf.c softmagic.c

Log Message:
fix lint fixes


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.21 src/external/bsd/file/dist/src/file.h:1.22
--- src/external/bsd/file/dist/src/file.h:1.21	Thu Oct 18 20:24:57 2018
+++ src/external/bsd/file/dist/src/file.h	Thu Oct 18 20:32:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.21 2018/10/19 00:24:57 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.22 2018/10/19 00:32:47 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -384,7 +384,7 @@ struct mlist {
 #define CCAST(T, b)	const_cast(b)
 #else
 #define CAST(T, b)	((T)(b))
-#define RCAST(T, b)	((T)(void *)(b))
+#define RCAST(T, b)	((T)(uintptr_t)(b))
 #define CCAST(T, b)	((T)(uintptr_t)(b))
 #endif
 

Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.19 src/external/bsd/file/dist/src/readelf.c:1.20
--- src/external/bsd/file/dist/src/readelf.c:1.19	Thu Oct 18 20:24:57 2018
+++ src/external/bsd/file/dist/src/readelf.c	Thu Oct 18 20:32:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.19 2018/10/19 00:24:57 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.20 2018/10/19 00:32:47 christos Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID("@(#)$File: readelf.c,v 1.154 2018/10/15 16:29:16 christos Exp $")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.19 2018/10/19 00:24:57 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.20 2018/10/19 00:32:47 christos Exp $");
 #endif
 #endif
 
@@ -792,7 +792,7 @@ do_core_note(struct magic_set *ms, unsig
 			pidoff = argoff + 81 + 2;
 			if (doff + pidoff + 4 <= size) {
 if (file_printf(ms, ", pid=%u",
-elf_getu32(swap, *RCAST(uint32 *, (nbuf +
+elf_getu32(swap, *RCAST(uint32_t *, (nbuf +
 doff + pidoff == -1)
 	return 1;
 			}

Index: src/external/bsd/file/dist/src/softmagic.c
diff -u src/external/bsd/file/dist/src/softmagic.c:1.20 src/external/bsd/file/dist/src/softmagic.c:1.21
--- src/external/bsd/file/dist/src/softmagic.c:1.20	Thu Oct 18 20:11:48 2018
+++ src/external/bsd/file/dist/src/softmagic.c	Thu Oct 18 20:32:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: softmagic.c,v 1.20 2018/10/19 00:11:48 christos Exp $	*/
+/*	$NetBSD: softmagic.c,v 1.21 2018/10/19 00:32:47 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: softmagic.c,v 1.271 2018/10/15 16:29:16 christos Exp $")
 #else
-__RCSID("$NetBSD: softmagic.c,v 1.20 2018/10/19 00:11:48 christos Exp $");
+__RCSID("$NetBSD: softmagic.c,v 1.21 2018/10/19 00:32:47 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -1441,7 +1441,7 @@ msetoffset(struct magic_set *ms, struct 
 		if ((size_t)-m->offset > b->elen)
 			return -1;
 		buffer_init(bb, -1, b->ebuf, b->elen);
-		ms->eoffset = ms->offset = b->elen + m->offset;
+		ms->eoffset = ms->offset = (int32_t)(b->elen + m->offset);
 	} else {
 		if (cont_level == 0) {
 normal:



CVS commit: src/external/bsd/file/dist/src

2018-10-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 19 00:24:57 UTC 2018

Modified Files:
src/external/bsd/file/dist/src: apprentice.c compress.c file.h
is_json.c readelf.c

Log Message:
lint fixes


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/is_json.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/readelf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.21 src/external/bsd/file/dist/src/apprentice.c:1.22
--- src/external/bsd/file/dist/src/apprentice.c:1.21	Thu Oct 18 20:11:48 2018
+++ src/external/bsd/file/dist/src/apprentice.c	Thu Oct 18 20:24:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.21 2018/10/19 00:11:48 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.22 2018/10/19 00:24:57 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: apprentice.c,v 1.281 2018/10/10 17:41:10 christos Exp $")
 #else
-__RCSID("$NetBSD: apprentice.c,v 1.21 2018/10/19 00:11:48 christos Exp $");
+__RCSID("$NetBSD: apprentice.c,v 1.22 2018/10/19 00:24:57 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -299,9 +299,9 @@ get_type(const struct type_tbl_s *tbl, c
 
 private off_t
 maxoff_t(void) {
-	if (sizeof(off_t) == sizeof(int))
+	if (/*CONSTCOND*/sizeof(off_t) == sizeof(int))
 		return CAST(off_t, INT_MAX);
-	if (sizeof(off_t) == sizeof(long))
+	if (/*CONSTCOND*/sizeof(off_t) == sizeof(long))
 		return CAST(off_t, LONG_MAX);
 	return 0x7fff;
 }

Index: src/external/bsd/file/dist/src/compress.c
diff -u src/external/bsd/file/dist/src/compress.c:1.16 src/external/bsd/file/dist/src/compress.c:1.17
--- src/external/bsd/file/dist/src/compress.c:1.16	Thu Oct 18 20:11:48 2018
+++ src/external/bsd/file/dist/src/compress.c	Thu Oct 18 20:24:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compress.c,v 1.16 2018/10/19 00:11:48 christos Exp $	*/
+/*	$NetBSD: compress.c,v 1.17 2018/10/19 00:24:57 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -40,7 +40,7 @@
 #if 0
 FILE_RCSID("@(#)$File: compress.c,v 1.113 2018/10/15 16:29:16 christos Exp $")
 #else
-__RCSID("$NetBSD: compress.c,v 1.16 2018/10/19 00:11:48 christos Exp $");
+__RCSID("$NetBSD: compress.c,v 1.17 2018/10/19 00:24:57 christos Exp $");
 #endif
 #endif
 
@@ -428,7 +428,7 @@ file_pipe2file(struct magic_set *ms, int
 #else
 	{
 		int te;
-		int ou = umask(0);
+		mode_t ou = umask(0);
 		tfd = mkstemp(buf);
 		(void)umask(ou);
 		te = errno;

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.20 src/external/bsd/file/dist/src/file.h:1.21
--- src/external/bsd/file/dist/src/file.h:1.20	Thu Oct 18 20:11:48 2018
+++ src/external/bsd/file/dist/src/file.h	Thu Oct 18 20:24:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.20 2018/10/19 00:11:48 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.21 2018/10/19 00:24:57 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -384,7 +384,7 @@ struct mlist {
 #define CCAST(T, b)	const_cast(b)
 #else
 #define CAST(T, b)	((T)(b))
-#define RCAST(T, b)	((T)(b))
+#define RCAST(T, b)	((T)(void *)(b))
 #define CCAST(T, b)	((T)(uintptr_t)(b))
 #endif
 

Index: src/external/bsd/file/dist/src/is_json.c
diff -u src/external/bsd/file/dist/src/is_json.c:1.1.1.1 src/external/bsd/file/dist/src/is_json.c:1.2
--- src/external/bsd/file/dist/src/is_json.c:1.1.1.1	Thu Oct 18 19:54:09 2018
+++ src/external/bsd/file/dist/src/is_json.c	Thu Oct 18 20:24:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: is_json.c,v 1.1.1.1 2018/10/18 23:54:09 christos Exp $	*/
+/*	$NetBSD: is_json.c,v 1.2 2018/10/19 00:24:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 Christos Zoulas
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: is_json.c,v 1.11 2018/10/15 16:29:16 christos Exp $")
 #else
-__RCSID("$NetBSD: is_json.c,v 1.1.1.1 2018/10/18 23:54:09 christos Exp $");
+__RCSID("$NetBSD: is_json.c,v 1.2 2018/10/19 00:24:57 christos Exp $");
 #endif
 #endif
 
@@ -50,7 +50,7 @@ __RCSID("$NetBSD: is_json.c,v 1.1.1.1 20
 #define DPRINTF(a, b, c)	\
 printf("%s [%.2x/%c] %.20s\n", (a), *(b), *(b), (const char *)(c))
 #else
-#define DPRINTF(a, b, c)	(void)0
+#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
 #endif
 
 #define JSON_ARRAY	0

Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.18 src/external/bsd/file/dist/src/readelf.c:1.19
--- src/external/bsd/file/dist/src/readelf.c:1.18	Thu Oct 18 20:11:48 2018
+++ src/external/bsd/file/dist/src/readelf.c	Thu Oct 18 20:24:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.18 2018/10/19 

CVS commit: src/external/bsd/file/dist/src

2018-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 18 01:18:16 UTC 2018

Modified Files:
src/external/bsd/file/dist/src: file.c

Log Message:
__noreturn__ does in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.c
diff -u src/external/bsd/file/dist/src/file.c:1.10 src/external/bsd/file/dist/src/file.c:1.11
--- src/external/bsd/file/dist/src/file.c:1.10	Tue Apr 17 08:34:04 2018
+++ src/external/bsd/file/dist/src/file.c	Tue Apr 17 21:18:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $	*/
+/*	$NetBSD: file.c,v 1.11 2018/04/18 01:18:16 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: file.c,v 1.175 2018/03/02 16:11:37 christos Exp $")
 #else
-__RCSID("$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $");
+__RCSID("$NetBSD: file.c,v 1.11 2018/04/18 01:18:16 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -677,9 +677,6 @@ file_getprogname(void)
 	return file_progname;
 }
 
-#ifdef __dead
-__dead
-#endif
 protected void
 file_err(int e, const char *fmt, ...)
 {
@@ -694,9 +691,6 @@ file_err(int e, const char *fmt, ...)
 	exit(e);
 }
 
-#ifdef __dead
-__dead
-#endif
 protected void
 file_errx(int e, const char *fmt, ...)
 {



CVS commit: src/external/bsd/file/dist/src

2018-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 18 01:17:42 UTC 2018

Modified Files:
src/external/bsd/file/dist/src: file.h

Log Message:
add __noreturn__ attribute to file_err{,x}


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/file.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.18 src/external/bsd/file/dist/src/file.h:1.19
--- src/external/bsd/file/dist/src/file.h:1.18	Sun Apr 15 15:45:32 2018
+++ src/external/bsd/file/dist/src/file.h	Tue Apr 17 21:17:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.18 2018/04/15 19:45:32 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.19 2018/04/18 01:17:42 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -620,9 +620,9 @@ int enable_sandbox_full(void);
 protected const char *file_getprogname(void);
 protected void file_setprogname(const char *);
 protected void file_err(int, const char *, ...)
-__attribute__((__format__(__printf__, 2, 3)));
+__attribute__((__format__(__printf__, 2, 3), __noreturn__));
 protected void file_errx(int, const char *, ...)
-__attribute__((__format__(__printf__, 2, 3)));
+__attribute__((__format__(__printf__, 2, 3), __noreturn__));
 protected void file_warn(const char *, ...)
 __attribute__((__format__(__printf__, 1, 2)));
 protected void file_warnx(const char *, ...)



CVS commit: src/external/bsd/file/dist/src

2018-04-17 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Apr 17 12:34:04 UTC 2018

Modified Files:
src/external/bsd/file/dist/src: file.c

Log Message:
sprinkle #ifdef __dead \n __dead \n #endif for clang


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.c
diff -u src/external/bsd/file/dist/src/file.c:1.9 src/external/bsd/file/dist/src/file.c:1.10
--- src/external/bsd/file/dist/src/file.c:1.9	Sun Apr 15 19:45:32 2018
+++ src/external/bsd/file/dist/src/file.c	Tue Apr 17 12:34:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.9 2018/04/15 19:45:32 christos Exp $	*/
+/*	$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: file.c,v 1.175 2018/03/02 16:11:37 christos Exp $")
 #else
-__RCSID("$NetBSD: file.c,v 1.9 2018/04/15 19:45:32 christos Exp $");
+__RCSID("$NetBSD: file.c,v 1.10 2018/04/17 12:34:04 jakllsch Exp $");
 #endif
 #endif	/* lint */
 
@@ -677,6 +677,9 @@ file_getprogname(void)
 	return file_progname;
 }
 
+#ifdef __dead
+__dead
+#endif
 protected void
 file_err(int e, const char *fmt, ...)
 {
@@ -691,6 +694,9 @@ file_err(int e, const char *fmt, ...)
 	exit(e);
 }
 
+#ifdef __dead
+__dead
+#endif
 protected void
 file_errx(int e, const char *fmt, ...)
 {



CVS commit: src/external/bsd/file/dist/src

2017-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 11 23:19:38 UTC 2017

Modified Files:
src/external/bsd/file/dist/src: softmagic.c

Log Message:
If we don't have any formatting characters, we are always ok.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/softmagic.c
diff -u src/external/bsd/file/dist/src/softmagic.c:1.17 src/external/bsd/file/dist/src/softmagic.c:1.18
--- src/external/bsd/file/dist/src/softmagic.c:1.17	Fri Sep  8 09:40:25 2017
+++ src/external/bsd/file/dist/src/softmagic.c	Mon Dec 11 18:19:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: softmagic.c,v 1.17 2017/09/08 13:40:25 christos Exp $	*/
+/*	$NetBSD: softmagic.c,v 1.18 2017/12/11 23:19:38 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: softmagic.c,v 1.249 2017/06/19 18:30:25 christos Exp $")
 #else
-__RCSID("$NetBSD: softmagic.c,v 1.17 2017/09/08 13:40:25 christos Exp $");
+__RCSID("$NetBSD: softmagic.c,v 1.18 2017/12/11 23:19:38 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -127,6 +127,8 @@ private const char * __attribute__((__fo
 file_fmtcheck(struct magic_set *ms, const struct magic *m, const char *def,
 	const char *file, size_t line)
 {
+	if (strchr(m->desc, '%') == NULL)
+		return m->desc;
 	const char *ptr = fmtcheck(m->desc, def);
 	if (ptr == def)
 		file_magerror(ms,



CVS commit: src/external/bsd/file/dist/doc

2017-10-22 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Oct 22 11:17:39 UTC 2017

Modified Files:
src/external/bsd/file/dist/doc: libmagic.3

Log Message:
Add magic_open to the NAME section


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/doc/libmagic.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/libmagic.3
diff -u src/external/bsd/file/dist/doc/libmagic.3:1.16 src/external/bsd/file/dist/doc/libmagic.3:1.17
--- src/external/bsd/file/dist/doc/libmagic.3:1.16	Fri Sep  8 13:40:25 2017
+++ src/external/bsd/file/dist/doc/libmagic.3	Sun Oct 22 11:17:39 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: libmagic.3,v 1.16 2017/09/08 13:40:25 christos Exp $
+.\"	$NetBSD: libmagic.3,v 1.17 2017/10/22 11:17:39 abhinav Exp $
 .\"
 .\" $File: libmagic.man,v 1.41 2017/05/23 21:54:07 christos Exp $
 .\"
@@ -36,6 +36,7 @@
 .Nm magic_error ,
 .Nm magic_errno ,
 .Nm magic_descriptor ,
+.Nm magic_file ,
 .Nm magic_buffer ,
 .Nm magic_getflags ,
 .Nm magic_setflags ,



CVS commit: src/external/bsd/file/dist/magic/magdir

2017-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Sep 27 21:04:05 UTC 2017

Modified Files:
src/external/bsd/file/dist/magic/magdir: netbsd

Log Message:
fix offset of segment count in NetBSD crashdump header.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/magic/magdir/netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/netbsd
diff -u src/external/bsd/file/dist/magic/magdir/netbsd:1.4 src/external/bsd/file/dist/magic/magdir/netbsd:1.5
--- src/external/bsd/file/dist/magic/magdir/netbsd:1.4	Thu May 25 00:11:26 2017
+++ src/external/bsd/file/dist/magic/magdir/netbsd	Wed Sep 27 21:04:05 2017
@@ -285,7 +285,7 @@
 >0	belong&0xfc00 0x1000	\b, STACK
 >4	leshort	x			\b, (headersize = %d
 >6	leshort	x			\b, segmentsize = %d
->6	lelong	x			\b, segments = %d)
+>8	lelong	x			\b, segments = %d)
 
 # little endian only for now.
 0	name		ktrace



CVS commit: src/external/bsd/file

2017-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  8 13:40:25 UTC 2017

Modified Files:
src/external/bsd/file/dist: ChangeLog Makefile.in config.guess
config.sub configure configure.ac
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive filesystems
src/external/bsd/file/dist/src: apprentice.c cdf.c compress.c file.h
fsmagic.c funcs.c magic.c readelf.c softmagic.c
src/external/bsd/file/dist/tests: Makefile.in
src/external/bsd/file/include: config.h

Log Message:
merge file-5.32


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/Makefile.in
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/config.guess
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/config.sub
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/doc/libmagic.3
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/magic/magdir/archive \
src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/cdf.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/file.h \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/funcs.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/tests/Makefile.in
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.5 src/external/bsd/file/dist/ChangeLog:1.6
--- src/external/bsd/file/dist/ChangeLog:1.5	Wed May 24 20:11:26 2017
+++ src/external/bsd/file/dist/ChangeLog	Fri Sep  8 09:40:24 2017
@@ -1,3 +1,27 @@
+2017-09-02  11:53  Christos Zoulas 
+
+	* release 5.32
+
+2017-08-28  16:37  Christos Zoulas 
+
+	* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)
+
+2017-08-27  03:55  Christos Zoulas 
+
+	* Fix always true condition (Thomas Jarosch)
+
+2017-05-24  17:30  Christos Zoulas 
+
+	* pickier parsing of numeric values in magic files.
+
+2017-05-23  17:55  Christos Zoulas 
+
+	* PR/615 add magic_getflags()
+
+2017-05-23  13:55  Christos Zoulas 
+
+	* release 5.31
+
 2017-03-17  20:32  Christos Zoulas 
 
 	* remove trailing spaces from magic files
@@ -417,7 +441,7 @@
 		`
 2013-11-06  14:40  Christos Zoulas 
 
-	* fix erroneous non-zero exit code from non-existant file and message
+	* fix erroneous non-zero exit code from non-existent file and message
 
 2013-10-29  14:25  Christos Zoulas 
 

Index: src/external/bsd/file/dist/Makefile.in
diff -u src/external/bsd/file/dist/Makefile.in:1.14 src/external/bsd/file/dist/Makefile.in:1.15
--- src/external/bsd/file/dist/Makefile.in:1.14	Wed May 24 20:11:26 2017
+++ src/external/bsd/file/dist/Makefile.in	Fri Sep  8 09:40:24 2017
@@ -327,8 +327,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
 EXTRA_DIST = MAINT
-SUBDIRS = src
-#SUBDIRS = src magic tests doc python
+SUBDIRS = src magic tests doc python
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 

Index: src/external/bsd/file/dist/config.guess
diff -u src/external/bsd/file/dist/config.guess:1.9 src/external/bsd/file/dist/config.guess:1.10
--- src/external/bsd/file/dist/config.guess:1.9	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/config.guess	Fri Sep  8 09:40:24 2017
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2015 Free Software Foundation, Inc.
+#   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2015-03-04'
+timestamp='2017-01-01'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ timestamp='2015-03-04'
 # Originally 

CVS commit: src/external/bsd/file

2017-05-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 25 00:11:27 UTC 2017

Modified Files:
src/external/bsd/file/dist: ChangeLog Makefile.in aclocal.m4 configure
configure.ac
src/external/bsd/file/dist/doc: file.1 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: apple archive diff filesystems
geo jpeg netbsd os9 pgp
src/external/bsd/file/dist/src: apprentice.c cdf.c cdf_time.c
compress.c der.c file.h funcs.c print.c readcdf.c readelf.c
softmagic.c
src/external/bsd/file/dist/tests: Makefile.in
src/external/bsd/file/include: config.h

Log Message:
merge 5.31


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/Makefile.in
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/aclocal.m4
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/magic/magdir/apple
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/magic/magdir/archive \
src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/magic/magdir/diff \
src/external/bsd/file/dist/magic/magdir/os9 \
src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/magic/magdir/geo \
src/external/bsd/file/dist/magic/magdir/jpeg \
src/external/bsd/file/dist/magic/magdir/netbsd
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/readcdf.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/cdf_time.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/der.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/file.h \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/funcs.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/tests/Makefile.in
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.4 src/external/bsd/file/dist/ChangeLog:1.5
--- src/external/bsd/file/dist/ChangeLog:1.4	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/ChangeLog	Wed May 24 20:11:26 2017
@@ -1,3 +1,9 @@
+2017-03-17  20:32  Christos Zoulas 
+
+	* remove trailing spaces from magic files
+	* refactor is_tar
+	* better bounds checks for cdf
+
 2017-02-10  12:24  Christos Zoulas 
 
 	* release 5.30

Index: src/external/bsd/file/dist/Makefile.in
diff -u src/external/bsd/file/dist/Makefile.in:1.13 src/external/bsd/file/dist/Makefile.in:1.14
--- src/external/bsd/file/dist/Makefile.in:1.13	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/Makefile.in	Wed May 24 20:11:26 2017
@@ -327,8 +327,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
 EXTRA_DIST = MAINT
-#SUBDIRS = src magic tests doc python
 SUBDIRS = src
+#SUBDIRS = src magic tests doc python
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 

Index: src/external/bsd/file/dist/aclocal.m4
diff -u src/external/bsd/file/dist/aclocal.m4:1.10 src/external/bsd/file/dist/aclocal.m4:1.11
--- src/external/bsd/file/dist/aclocal.m4:1.10	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/aclocal.m4	Wed May 24 20:11:26 2017
@@ -21,7 +21,7 @@ If you have problems, you may need to re
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.

Index: src/external/bsd/file/dist/configure
diff -u src/external/bsd/file/dist/configure:1.16 src/external/bsd/file/dist/configure:1.17
--- src/external/bsd/file/dist/configure:1.16	Fri Feb 10 12:56:27 2017
+++ 

CVS commit: src/external/bsd/file/dist/src

2017-02-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 17 17:33:00 UTC 2017

Modified Files:
src/external/bsd/file/dist/src: apprentice.c

Log Message:
Ignore files that start with .


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/src/apprentice.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.16 src/external/bsd/file/dist/src/apprentice.c:1.17
--- src/external/bsd/file/dist/src/apprentice.c:1.16	Fri Feb 10 13:06:59 2017
+++ src/external/bsd/file/dist/src/apprentice.c	Fri Feb 17 12:33:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.17 2017/02/17 17:33:00 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: apprentice.c,v 1.257 2017/02/04 16:46:16 christos Exp $")
 #else
-__RCSID("$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $");
+__RCSID("$NetBSD: apprentice.c,v 1.17 2017/02/17 17:33:00 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -1322,6 +1322,8 @@ apprentice_load(struct magic_set *ms, co
 			goto out;
 		}
 		while ((d = readdir(dir)) != NULL) {
+			if (d->d_name[0] == '.')
+continue;
 			if (asprintf(, "%s/%s", fn, d->d_name) < 0) {
 file_oomem(ms,
 strlen(fn) + strlen(d->d_name) + 2);



CVS commit: src/external/bsd/file/dist/src

2017-02-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 11 18:17:29 UTC 2017

Modified Files:
src/external/bsd/file/dist/src: readelf.c

Log Message:
fix reversed logic


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/readelf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.13 src/external/bsd/file/dist/src/readelf.c:1.14
--- src/external/bsd/file/dist/src/readelf.c:1.13	Fri Feb 10 13:06:59 2017
+++ src/external/bsd/file/dist/src/readelf.c	Sat Feb 11 13:17:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID("@(#)$File: readelf.c,v 1.130 2017/01/29 19:34:24 christos Exp $")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $");
 #endif
 #endif
 
@@ -1191,7 +1191,7 @@ doshn(struct magic_set *ms, int clazz, i
 {
 	Elf32_Shdr sh32;
 	Elf64_Shdr sh64;
-	int stripped = 1, has_debug_info = 1;
+	int stripped = 1, has_debug_info = 0;
 	size_t nbadcap = 0;
 	void *nbuf;
 	off_t noff, coff, name_off;



CVS commit: src/external/bsd/file

2017-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 10 18:11:18 UTC 2017

Modified Files:
src/external/bsd/file/dist/src: der.c
src/external/bsd/file/lib: Makefile shlib_version

Log Message:
fix der.c bump shared library


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/der.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/lib/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/der.c
diff -u src/external/bsd/file/dist/src/der.c:1.1.1.1 src/external/bsd/file/dist/src/der.c:1.2
--- src/external/bsd/file/dist/src/der.c:1.1.1.1	Fri Feb 10 12:42:57 2017
+++ src/external/bsd/file/dist/src/der.c	Fri Feb 10 13:11:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: der.c,v 1.1.1.1 2017/02/10 17:42:57 christos Exp $	*/
+/*	$NetBSD: der.c,v 1.2 2017/02/10 18:11:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 Christos Zoulas
@@ -40,7 +40,7 @@
 #if 0
 FILE_RCSID("@(#)$File: der.c,v 1.11 2016/11/07 15:51:23 christos Exp $")
 #else
-__RCSID("$NetBSD: der.c,v 1.1.1.1 2017/02/10 17:42:57 christos Exp $");
+__RCSID("$NetBSD: der.c,v 1.2 2017/02/10 18:11:17 christos Exp $");
 #endif
 #endif
 #endif
@@ -207,7 +207,7 @@ getlength(const uint8_t *c, size_t *p, s
 
 	if (*p + len >= l)
 		return DER_BAD;
-	return len;
+	return CAST(uint32_t, len);
 }
 
 static const char *
@@ -266,12 +266,12 @@ der_offs(struct magic_set *ms, struct ma
 #endif
 	if (m->cont_level != 0) {
 		if (offs + tlen > nbytes)
-			return DER_BAD;
-		ms->c.li[m->cont_level - 1].off = offs + tlen;
+			return -1;
+		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
 		DPRINTF(("cont_level[%u] = %u\n", m->cont_level - 1,
 		ms->c.li[m->cont_level - 1].off));
 	}
-	return offs;
+	return CAST(int32_t, offs);
 }
 
 int

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.7 src/external/bsd/file/lib/Makefile:1.8
--- src/external/bsd/file/lib/Makefile:1.7	Tue Jan 10 08:51:36 2017
+++ src/external/bsd/file/lib/Makefile	Fri Feb 10 13:11:18 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2017/01/10 13:51:36 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2017/02/10 18:11:18 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -19,7 +19,7 @@ CPPFLAGS+=-I.
 
 SRCS=		magic.c apprentice.c softmagic.c ascmagic.c compress.c	\
 		is_tar.c readelf.c print.c fsmagic.c apptype.c funcs.c \
-		cdf.c readcdf.c cdf_time.c encoding.c
+		cdf.c readcdf.c cdf_time.c encoding.c der.c
 MAN=		libmagic.3
 MLINKS+=	libmagic.3 magic_open.3 \
 		libmagic.3 magic_close.3 \

Index: src/external/bsd/file/lib/shlib_version
diff -u src/external/bsd/file/lib/shlib_version:1.5 src/external/bsd/file/lib/shlib_version:1.6
--- src/external/bsd/file/lib/shlib_version:1.5	Fri Jan  2 16:15:32 2015
+++ src/external/bsd/file/lib/shlib_version	Fri Feb 10 13:11:18 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.5 2015/01/02 21:15:32 christos Exp $
+#	$NetBSD: shlib_version,v 1.6 2017/02/10 18:11:18 christos Exp $
 #
 major=5
-minor=1
+minor=2



CVS commit: src/external/bsd/file/dist/src

2017-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 10 18:06:59 UTC 2017

Modified Files:
src/external/bsd/file/dist/src: apprentice.c cdf.c compress.c print.c
readelf.c softmagic.c

Log Message:
pacify lint.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/compress.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.15 src/external/bsd/file/dist/src/apprentice.c:1.16
--- src/external/bsd/file/dist/src/apprentice.c:1.15	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/src/apprentice.c	Fri Feb 10 13:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.15 2017/02/10 17:53:24 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: apprentice.c,v 1.257 2017/02/04 16:46:16 christos Exp $")
 #else
-__RCSID("$NetBSD: apprentice.c,v 1.15 2017/02/10 17:53:24 christos Exp $");
+__RCSID("$NetBSD: apprentice.c,v 1.16 2017/02/10 18:06:59 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -555,8 +555,10 @@ apprentice_unmap(struct magic_map *map)
 		break;
 	case MAP_TYPE_MALLOC:
 		for (i = 0; i < MAGIC_SETS; i++) {
-			if ((char *)map->magic[i] >= (char *)map->p &&
-			(char *)map->magic[i] <= (char *)map->p + map->len)
+			void *b = map->magic[i];
+			void *p = map->p;
+			if (CAST(char *, b) >= CAST(char *, p) &&
+			CAST(char *, b) <= CAST(char *, p) + map->len)
 continue;
 			free(map->magic[i]);
 		}

Index: src/external/bsd/file/dist/src/cdf.c
diff -u src/external/bsd/file/dist/src/cdf.c:1.12 src/external/bsd/file/dist/src/cdf.c:1.13
--- src/external/bsd/file/dist/src/cdf.c:1.12	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/src/cdf.c	Fri Feb 10 13:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdf.c,v 1.12 2017/02/10 17:53:24 christos Exp $	*/
+/*	$NetBSD: cdf.c,v 1.13 2017/02/10 18:06:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 Christos Zoulas
@@ -40,7 +40,7 @@
 #if 0
 FILE_RCSID("@(#)$File: cdf.c,v 1.88 2017/02/07 23:21:29 christos Exp $")
 #else
-__RCSID("$NetBSD: cdf.c,v 1.12 2017/02/10 17:53:24 christos Exp $");
+__RCSID("$NetBSD: cdf.c,v 1.13 2017/02/10 18:06:59 christos Exp $");
 #endif
 #endif
 
@@ -817,7 +817,7 @@ cdf_find_stream(const cdf_dir_t *dir, co
 		== 0)
 			break;
 	if (i > 0)
-		return i;
+		return CAST(int, i);
 
 	DPRINTF(("Cannot find type %d `%s'\n", type, name));
 	errno = ESRCH;
@@ -1074,7 +1074,7 @@ cdf_unpack_catalog(const cdf_header_t *h
 {
 	size_t ss = cdf_check_stream(sst, h);
 	const char *b = CAST(const char *, sst->sst_tab);
-	const char *eb = b + ss * sst->sst_len;
+	const char *nb, *eb = b + ss * sst->sst_len;
 	size_t nr, i, j, k;
 	cdf_catalog_entry_t *ce;
 	uint16_t reclen;
@@ -1119,7 +1119,9 @@ cdf_unpack_catalog(const cdf_header_t *h
 			cep->ce_namlen = rlen;
 
 		np = CAST(const uint16_t *, CAST(const void *, (b + 16)));
-		if (RCAST(const char *, np + cep->ce_namlen) > eb) {
+		nb = CAST(const char *, CAST(const void *,
+		(np + cep->ce_namlen)));
+		if (nb > eb) {
 			cep->ce_namlen = 0;
 			break;
 		}
Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.12 src/external/bsd/file/dist/src/readelf.c:1.13
--- src/external/bsd/file/dist/src/readelf.c:1.12	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/src/readelf.c	Fri Feb 10 13:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.12 2017/02/10 17:53:24 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID("@(#)$File: readelf.c,v 1.130 2017/01/29 19:34:24 christos Exp $")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.12 2017/02/10 17:53:24 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $");
 #endif
 #endif
 
@@ -896,7 +896,7 @@ get_string_on_virtaddr(struct magic_set 
 
 	offset = get_offset_from_virtaddr(ms, swap, clazz, fd, ph_off, ph_num,
 	fsize, virtaddr);
-	if ((buflen = pread(fd, buf, buflen, offset)) <= 0) {
+	if ((buflen = pread(fd, buf, CAST(size_t, buflen), offset)) <= 0) {
 		file_badread(ms);
 		return 0;
 	}

Index: src/external/bsd/file/dist/src/compress.c
diff -u src/external/bsd/file/dist/src/compress.c:1.11 src/external/bsd/file/dist/src/compress.c:1.12
--- src/external/bsd/file/dist/src/compress.c:1.11	Fri Feb 10 12:53:24 2017
+++ 

CVS commit: src/external/bsd/file/dist

2017-02-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 10 17:56:27 UTC 2017

Modified Files:
src/external/bsd/file/dist: configure

Log Message:
put back maintainer mode


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/configure
diff -u src/external/bsd/file/dist/configure:1.15 src/external/bsd/file/dist/configure:1.16
--- src/external/bsd/file/dist/configure:1.15	Fri Feb 10 12:53:24 2017
+++ src/external/bsd/file/dist/configure	Fri Feb 10 12:56:27 2017
@@ -2977,6 +2977,28 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+# Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
 # Check whether --enable-silent-rules was given.
 if test "${enable_silent_rules+set}" = set; then :
   enableval=$enable_silent_rules;



CVS commit: src/external/bsd/file/lib

2017-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 10 13:51:36 UTC 2017

Modified Files:
src/external/bsd/file/lib: Makefile

Log Message:
Build magic.h before all objs.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.6 src/external/bsd/file/lib/Makefile:1.7
--- src/external/bsd/file/lib/Makefile:1.6	Sun Dec  1 15:15:42 2013
+++ src/external/bsd/file/lib/Makefile	Tue Jan 10 08:51:36 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2013/12/01 20:15:42 christos Exp $
+#	$NetBSD: Makefile,v 1.7 2017/01/10 13:51:36 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -41,3 +41,5 @@ magic.h:magic.h.in
 CLEANFILES+=	magic.h
 
 .include 
+
+${ALLOBJS}:	magic.h



CVS commit: src/external/bsd/file/dist/doc

2017-01-03 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Jan  3 11:34:41 UTC 2017

Modified Files:
src/external/bsd/file/dist/doc: file.1

Log Message:
Correct a sentence in the HISTORY section.
Remove a mention of "1989" at the end of the 4th paragraph in HISTORY section,
probably leftover because of copy-paste from the paragraph above.
Sort SEE ALSO.
Remove trailing white spaces at some places.
Remove Pp after Sh at few places as pointed out by mandoc.

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/file/dist/doc/file.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/file.1
diff -u src/external/bsd/file/dist/doc/file.1:1.16 src/external/bsd/file/dist/doc/file.1:1.17
--- src/external/bsd/file/dist/doc/file.1:1.16	Fri Jan  2 21:15:32 2015
+++ src/external/bsd/file/dist/doc/file.1	Tue Jan  3 11:34:41 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: file.1,v 1.16 2015/01/02 21:15:32 christos Exp $
+.\"	$NetBSD: file.1,v 1.17 2017/01/03 11:34:41 abhinav Exp $
 .\"
 .\" $File: file.man,v 1.111 2014/12/16 23:18:40 christos Exp $
 .Dd December 16, 2014
@@ -231,8 +231,8 @@ or at least one filename argument must b
 to test the standard input, use
 .Sq -
 as a filename argument.
-Please note that 
-.Ar namefile 
+Please note that
+.Ar namefile
 is unwrapped and the enclosed filenames are processed when this option is
 encountered and before any further options processing is done.
 This allows one to process multiple lists of files with different command line
@@ -394,10 +394,10 @@ and
 .Fl h
 options.
 .Sh SEE ALSO
-.Xr magic 5 ,
 .Xr hexdump 1 ,
 .Xr od 1 ,
 .Xr strings 1 ,
+.Xr magic 5
 .Sh STANDARDS CONFORMANCE
 This program is believed to exceed the System V Interface Definition
 of FILE(CMD), as near as one can determine from the vague language
@@ -513,16 +513,15 @@ John Gilmore revised the code extensivel
 the first version.
 Geoff Collyer found several inadequacies
 and provided some magic file entries.
-Contributions by the
+Contribution of the
 .Sq \*[Am]
-operator by Rob McMahon, 
+operator by Rob McMahon,
 .Aq cu...@warwick.ac.uk ,
 1989.
 .Pp
-Guy Harris, 
+Guy Harris,
 .Aq g...@netapp.com ,
 made many changes from 1993 to the present.
-1989.
 .Pp
 Primary development and maintenance from 1990 to the present by
 Christos Zoulas
@@ -570,7 +569,6 @@ program, and are not covered by the abov
 .Nm
 returns 0 on success, and non-zero on error.
 .Sh BUGS
-.Pp
 Please report bugs and send patches to the bug tracker at
 .Pa http://bugs.gw.com/
 or the mailing list at
@@ -579,7 +577,6 @@ or the mailing list at
 .Pa http://mx.gw.com/mailman/listinfo/file
 first to subscribe).
 .Sh TODO
-.Pp
 Fix output so that tests for MIME and APPLE flags are not needed all
 over the place, and actual output is only done in one place.
 This needs a design.
@@ -615,16 +612,16 @@ Fix
 .Dq name
 and
 .Dq use
-to check for consistency at compile time (duplicate 
+to check for consistency at compile time (duplicate
 .Dq name ,
 .Dq use
 pointing to undefined
 .Dq name
 ).
-Make 
+Make
 .Dq name
 /
-.Dq use 
+.Dq use
 more efficient by keeping a sorted list of names.
 Special-case ^ to flip endianness in the parser so that it does not
 have to be escaped, and document it.



CVS commit: src/external/bsd/file/dist/magic/magdir

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 23:27:46 UTC 2015

Modified Files:
src/external/bsd/file/dist/magic/magdir: jpeg

Log Message:
fix recursion


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/file/dist/magic/magdir/jpeg

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/jpeg
diff -u src/external/bsd/file/dist/magic/magdir/jpeg:1.1.1.6 src/external/bsd/file/dist/magic/magdir/jpeg:1.2
--- src/external/bsd/file/dist/magic/magdir/jpeg:1.1.1.6	Fri Jan  2 15:34:28 2015
+++ src/external/bsd/file/dist/magic/magdir/jpeg	Fri Jan  2 18:27:46 2015
@@ -1,6 +1,6 @@
 
 #--
-# $File: jpeg,v 1.25 2015/01/02 16:56:50 christos Exp $
+# $File: jpeg,v 1.26 2015/01/02 22:40:27 christos Exp $
 # JPEG images
 # SunOS 5.5.1 had
 #
@@ -41,7 +41,8 @@
 # This uses recursion...
 0		name		jpeg_segment
 0	beshort		0xFFFE
-(2.S+2)	use			jpeg_segment
+# Recursion handled by FFE0
+#(2.S+2)	use			jpeg_segment
 2	pstring/HJ	x		\b, comment: %s
 
 0	beshort		0xFFC0
@@ -70,6 +71,7 @@
 (2.S+2)	use			jpeg_segment
 
 0	beshort		0xFFE1		
+# Recursion handled by FFE0
 #(2.S+2)	use			jpeg_segment
 4	string		Exif		\b, Exif Standard: [
 10	indirect/r	x		
@@ -85,7 +87,8 @@
 # D9: End of image
 # Dn: Restart
 0	beshort0xFFD0	=0xFFD0
-(2.S+2)	use			jpeg_segment
+0	beshort0xFFE0	!0xFFE0
+(2.S+2)	use			jpeg_segment
 
 #0	beshort		x		unknown 0x%x
 #(2.S+2)	use			jpeg_segment



CVS commit: src/external/bsd/file/dist/magic/magdir

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 23:38:45 UTC 2015

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
add a clear that did not merge.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.12 src/external/bsd/file/dist/magic/magdir/elf:1.13
--- src/external/bsd/file/dist/magic/magdir/elf:1.12	Mon Oct 20 17:48:57 2014
+++ src/external/bsd/file/dist/magic/magdir/elf	Fri Jan  2 18:38:45 2015
@@ -30,6 +30,7 @@
 #(0x38+0xcc) string	\0		of '%s'
 #(0x38+0x10) lelong	0		(signal %d),
 16	leshort		0xff00		processor-specific,
+18	clear		x
 18	leshort		0		no machine,
 18	leshort		1		ATT WE32100,
 18	leshort		2		SPARC,



CVS commit: src/external/bsd/file

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 21:15:32 UTC 2015

Modified Files:
src/external/bsd/file/dist: ChangeLog Makefile.in configure
configure.ac
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: filesystems pgp
src/external/bsd/file/dist/src: Makefile.in apprentice.c cdf.c
cdf_time.c compress.c encoding.c file.c file.h fsmagic.c funcs.c
magic.c print.c readcdf.c readelf.c softmagic.c
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: shlib_version

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/Makefile.in
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/doc/libmagic.3 \
src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/Makefile.in \
src/external/bsd/file/dist/src/readcdf.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/readelf.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/cdf_time.c \
src/external/bsd/file/dist/src/file.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/compress.c \
src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/encoding.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.2 src/external/bsd/file/dist/ChangeLog:1.3
--- src/external/bsd/file/dist/ChangeLog:1.2	Mon Oct 20 17:48:57 2014
+++ src/external/bsd/file/dist/ChangeLog	Fri Jan  2 16:15:32 2015
@@ -1,3 +1,72 @@
+2015-01-02  15:15  Christos Zoulas chris...@zoulas.com
+
+	* release 5.22
+
+2015-01-01  12:01  Christos Zoulas chris...@zoulas.com
+
+	* add indirect relative for TIFF/Exif
+
+2014-12-16  18:10  Christos Zoulas chris...@zoulas.com
+	
+	* restructure elf note printing to avoid repeated messages
+	* add note limit, suggested by Alexander Cherepanov
+
+2014-12-16  16:53  Christos Zoulas chris...@zoulas.com
+	
+	* Bail out on partial pread()'s (Alexander Cherepanov)
+	* Fix incorrect bounds check in file_printable (Alexander Cherepanov)
+
+2014-12-11  20:01  Christos Zoulas chris...@zoulas.com
+
+	* PR/405: ignore SIGPIPE from uncompress programs
+	* change printable - file_printable and use it in
+	  more places for safety
+	* in ELF, instead of (uses dynamic libraries) when PT_INTERP
+	  is present print the interpreter name.
+	
+2014-12-10  20:01  Christos Zoulas chris...@zoulas.com
+
+	* release 5.21
+
+2014-11-27  18:40  Christos Zoulas chris...@zoulas.com
+
+	* Allow setting more parameters from the command line.
+	* Split name/use and indirect magic recursion limits.
+
+2014-11-27  11:12  Christos Zoulas chris...@zoulas.com
+
+	* Adjust ELF parameters and the default recursion
+	  level.
+	* Allow setting the recursion level dynamically.
+
+2014-11-24   8:55  Christos Zoulas chris...@zoulas.com
+
+	* The following fixes resulted from Thomas Jarosch's fuzzing
+	  tests that revealed severe performance issues on pathological
+	  input:
+	- limit number of elf program and sections processing
+	- abort elf note processing quickly
+	- reduce the number of recursion levels from 20 to 10
+	- preserve error messages in indirect magic handling
+
+	This is tracked as CVE-2014-8116 and CVE-2014-8117
+
+2014-11-12  10:30  Christos Zoulas chris...@zoulas.com
+
+	* fix bogus free in the user buffer case.
+
+2014-11-11  12:35  Christos Zoulas chris...@zoulas.com
+
+	* fix out of bounds read for pascal strings
+	* fix memory leak (not freeing the head of each mlist)
+
+2014-11-07  10:25  Christos Zoulas chris...@zoulas.com
+
+	* When printing strings 

CVS commit: src/external/bsd/file/dist/magic/magdir

2014-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec  8 20:54:33 UTC 2014

Modified Files:
src/external/bsd/file/dist/magic/magdir: netbsd

Log Message:
fix bogus kernel core magic entries from file HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/magic/magdir/netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/netbsd
diff -u src/external/bsd/file/dist/magic/magdir/netbsd:1.1.1.5 src/external/bsd/file/dist/magic/magdir/netbsd:1.2
--- src/external/bsd/file/dist/magic/magdir/netbsd:1.1.1.5	Thu Jun 12 21:48:25 2014
+++ src/external/bsd/file/dist/magic/magdir/netbsd	Mon Dec  8 15:54:33 2014
@@ -1,6 +1,6 @@
 
 #--
-# $File: netbsd,v 1.21 2014/03/29 15:40:34 christos Exp $
+# $File: netbsd,v 1.22 2014/12/08 20:53:52 christos Exp $
 # netbsd:  file(1) magic for NetBSD objects
 #
 # All new-style magic numbers are in network byte order.
@@ -247,7 +247,7 @@
 # Kernel core dump format
 0	belong0x 0x8fca	NetBSD kernel core file
 0	belong0x03ff 0x	\b, Unknown
-0	belong0x03ff 0x1000	\b, sun 68010/68020
+0	belong0x03ff 0x0001	\b, sun 68010/68020
 0	belong0x03ff 0x0002	\b, sun 68020
 0	belong0x03ff 0x0064	\b, 386 PC
 0	belong0x03ff 0x0086	\b, i386 BSD
@@ -262,20 +262,24 @@
 0	belong0x03ff 0x008f	\b, arm6 BSD
 0	belong0x03ff 0x0090	\b, m68k BSD (2K pages)
 0	belong0x03ff 0x0091	\b, sh3 BSD
-0	belong0x03ff 0x0092	\b, ppc BSD (Big Endian)
-0	belong0x03ff 0x0093	\b, vax BSD (4K pages)
-0	belong0x03ff 0x0094	\b, mips1 BSD
-0	belong0x03ff 0x0095	\b, mips2 BSD
-0	belong0x03ff 0x0096	\b, parisc BSD
-0	belong0x03ff 0x0097	\b, sh5/64 BSD
-0	belong0x03ff 0x0098	\b, SPARC/64 BSD
-0	belong0x03ff 0x0099	\b, amd64 BSD
-0	belong0x03ff 0x009a	\b, hp200 (68010) BSD
-0	belong0x03ff 0x009b	\b, hp300 (68020+68881) BSD
-0	belong0x03ff 0x009b	\b, hp300 (68020+68881) BSD
-0	belong0x03ff 0x00c8	\b, hp200
-0	belong0x03ff 0x020b	\b, hp300 (68020+68881) HP-UX
-0	belong0x03ff 0x020c	\b, hp300 (68020+68881) HP-UX
+0	belong0x03ff 0x0095	\b, ppc BSD (Big Endian)
+0	belong0x03ff 0x0096	\b, vax BSD (4K pages)
+0	belong0x03ff 0x0097	\b, mips1 BSD
+0	belong0x03ff 0x0098	\b, mips2 BSD
+0	belong0x03ff 0x0099	\b, m88k BSD
+0	belong0x03ff 0x0092	\b, parisc BSD
+0	belong0x03ff 0x009b	\b, sh5/64 BSD
+0	belong0x03ff 0x009c	\b, SPARC/64 BSD
+0	belong0x03ff 0x009d	\b, amd64 BSD
+0	belong0x03ff 0x009e	\b, sh5/32 BSD
+0	belong0x03ff 0x009f	\b, ia64 BSD
+0	belong0x03ff 0x00b7	\b, aarch64 BSD
+0	belong0x03ff 0x00b8	\b, or1k BSD
+0	belong0x03ff 0x00b9	\b, Risk-V BSD
+0	belong0x03ff 0x00c8	\b, hp200 BSD
+0	belong0x03ff 0x012c	\b, hp300 BSD
+0	belong0x03ff 0x020b	\b, hp800 HP-UX
+0	belong0x03ff 0x020c	\b, hp200/hp300 HP-UX
 0	belong0xfc00 0x0400	\b, CPU
 0	belong0xfc00 0x0800	\b, DATA
 0	belong0xfc00 0x1000	\b, STACK



CVS commit: src/external/bsd/file/dist

2014-10-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 20 21:48:57 UTC 2014

Modified Files:
src/external/bsd/file/dist: ChangeLog configure.ac
src/external/bsd/file/dist/magic/magdir: elf pgp
src/external/bsd/file/dist/src: apprentice.c file.c file.h fsmagic.c
readelf.c

Log Message:
sync with head of upstream to fix MacOS/X compilation and more.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/bsd/file/dist/ChangeLog
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/magic/magdir/elf
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/magic/magdir/pgp
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/file.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/readelf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/ChangeLog
diff -u src/external/bsd/file/dist/ChangeLog:1.1.1.9 src/external/bsd/file/dist/ChangeLog:1.2
--- src/external/bsd/file/dist/ChangeLog:1.1.1.9	Fri Oct 10 16:08:15 2014
+++ src/external/bsd/file/dist/ChangeLog	Mon Oct 20 17:48:57 2014
@@ -1,3 +1,12 @@
+2014-10-17  11:48  Christos Zoulas chris...@zoulas.com
+
+	* fix bounds in note reading (Francisco Alonso / Red Hat)
+
+2014-10-11  15:02  Christos Zoulas chris...@zoulas.com
+
+	* fix autoconf glue for setlocale and locale_t; some OS's
+	  have locale_t in xlocale.h
+
 2014-10-10  15:01  Christos Zoulas chris...@zoulas.com
 
 	* release 5.20

Index: src/external/bsd/file/dist/configure.ac
diff -u src/external/bsd/file/dist/configure.ac:1.9 src/external/bsd/file/dist/configure.ac:1.10
--- src/external/bsd/file/dist/configure.ac:1.9	Fri Oct 10 16:15:01 2014
+++ src/external/bsd/file/dist/configure.ac	Mon Oct 20 17:48:57 2014
@@ -83,7 +83,7 @@ AC_HEADER_MAJOR
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
 AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
-AC_CHECK_HEADERS(getopt.h err.h)
+AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
 AC_CHECK_HEADERS(zlib.h)
 
@@ -139,7 +139,7 @@ else
 fi])
 
 dnl Checks for functions
-AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale)
+AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
 
 dnl Provide implementation of some required functions if necessary
 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.11 src/external/bsd/file/dist/magic/magdir/elf:1.12
--- src/external/bsd/file/dist/magic/magdir/elf:1.11	Fri Oct 10 16:15:01 2014
+++ src/external/bsd/file/dist/magic/magdir/elf	Mon Oct 20 17:48:57 2014
@@ -30,7 +30,6 @@
 #(0x38+0xcc) string	\0		of '%s'
 #(0x38+0x10) lelong	0		(signal %d),
 16	leshort		0xff00		processor-specific,
-18	clear		x
 18	leshort		0		no machine,
 18	leshort		1		ATT WE32100,
 18	leshort		2		SPARC,

Index: src/external/bsd/file/dist/magic/magdir/pgp
diff -u src/external/bsd/file/dist/magic/magdir/pgp:1.1.1.2 src/external/bsd/file/dist/magic/magdir/pgp:1.2
--- src/external/bsd/file/dist/magic/magdir/pgp:1.1.1.2	Thu May 12 16:47:04 2011
+++ src/external/bsd/file/dist/magic/magdir/pgp	Mon Oct 20 17:48:57 2014
@@ -1,6 +1,6 @@
 
 #--
-# $File: pgp,v 1.9 2009/09/19 16:28:11 christos Exp $
+# $File: pgp,v 1.10 2014/10/14 16:50:37 christos Exp $
 # pgp:  file(1) magic for Pretty Good Privacy
 # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
 #
@@ -25,3 +25,391 @@
 !:mime	application/pgp
 0	string	-BEGIN\040PGP\40SIGNATURE-		PGP signature
 !:mime	application/pgp-signature
+
+# magic signatures to detect PGP crypto material (from stef)
+# detects and extracts metadata from:
+#  - symmetric encrypted packet header
+#  - RSA (e=65537) secret (sub-)keys
+
+# 1024b RSA encrypted data
+
+0	string	\x84\x8c\x03		PGP RSA encrypted session key -
+3	lelong	x			keyid: %X
+7	lelong	x			%X
+11	byte	0x01			RSA (Encrypt or Sign) 1024b
+11	byte	0x02			RSA Encrypt-Only 1024b
+12	string	\x04\x00
+12	string	\x03\xff
+12	string	\x03\xfe
+12	string	\x03\xfd
+12	string	\x03\xfc
+12	string	\x03\xfb
+12	string	\x03\xfa
+12	string	\x03\xf9
+142	byte	0xd2			.
+
+# 2048b RSA encrypted data
+
+0	string	\x85\x01\x0c\x03	PGP RSA encrypted session key -
+4	lelong	x			keyid: %X
+8	lelong	x			%X
+12	byte	0x01			RSA (Encrypt or Sign) 2048b
+12	

CVS commit: src/external/bsd/file/dist

2014-10-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 20 22:04:31 UTC 2014

Modified Files:
src/external/bsd/file/dist: Makefile.in aclocal.m4 config.h.in
configure install-sh missing
src/external/bsd/file/dist/doc: Makefile.in
src/external/bsd/file/dist/magic: Makefile.in
src/external/bsd/file/dist/python: Makefile.in
src/external/bsd/file/dist/src: Makefile.in
src/external/bsd/file/dist/tests: Makefile.in

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/Makefile.in
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/aclocal.m4
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/config.h.in \
src/external/bsd/file/dist/install-sh
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/missing
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/doc/Makefile.in
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/python/Makefile.in
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/Makefile.in
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/tests/Makefile.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/Makefile.in
diff -u src/external/bsd/file/dist/Makefile.in:1.10 src/external/bsd/file/dist/Makefile.in:1.11
--- src/external/bsd/file/dist/Makefile.in:1.10	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/Makefile.in	Mon Oct 20 18:04:30 2014
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.14 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -619,10 +619,9 @@ distcheck: dist
 	   dc_destdir=$${TMPDIR-/tmp}/am-dc-/ \
 	   am__cwd=`pwd` \
 	   $(am__cd) $(distdir)/_build \
-	   ../configure \
+	   ../configure --srcdir=.. --prefix=$$dc_install_base \
 	$(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	$(DISTCHECK_CONFIGURE_FLAGS) \
-	--srcdir=.. --prefix=$$dc_install_base \
 	   $(MAKE) $(AM_MAKEFLAGS) \
 	   $(MAKE) $(AM_MAKEFLAGS) dvi \
 	   $(MAKE) $(AM_MAKEFLAGS) check \

Index: src/external/bsd/file/dist/aclocal.m4
diff -u src/external/bsd/file/dist/aclocal.m4:1.8 src/external/bsd/file/dist/aclocal.m4:1.9
--- src/external/bsd/file/dist/aclocal.m4:1.8	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/aclocal.m4	Mon Oct 20 18:04:30 2014
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
@@ -113,7 +113,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.14], [],
   [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -129,7 +129,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.14])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])

Index: src/external/bsd/file/dist/config.h.in
diff -u src/external/bsd/file/dist/config.h.in:1.9 src/external/bsd/file/dist/config.h.in:1.10
--- src/external/bsd/file/dist/config.h.in:1.9	Fri Oct 10 16:15:01 2014
+++ src/external/bsd/file/dist/config.h.in	Mon Oct 20 18:04:30 2014
@@ -104,6 +104,9 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the stddef.h header file. */
 #undef HAVE_STDDEF_H
 
@@ -228,6 +231,9 @@
 /* Define to 1 if `vfork' works. */
 #undef HAVE_WORKING_VFORK
 
+/* Define to 1 if you have the xlocale.h header file. */
+#undef HAVE_XLOCALE_H
+
 /* Define to 1 if you have the zlib.h header file. */
 #undef HAVE_ZLIB_H
 
Index: src/external/bsd/file/dist/install-sh
diff -u src/external/bsd/file/dist/install-sh:1.9 src/external/bsd/file/dist/install-sh:1.10
--- src/external/bsd/file/dist/install-sh:1.9	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/install-sh	Mon Oct 20 18:04:31 2014
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: install-sh,v 1.9 2014/06/13 02:08:06 christos Exp $
+# $NetBSD: install-sh,v 1.10 2014/10/20 22:04:31 christos Exp $
 # This script now also installs multiple files, but might choke on installing
 # multiple files with spaces in the file names.
 #

Index: src/external/bsd/file/dist/configure

CVS commit: src/external/bsd/file/dist

2014-10-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 10 20:15:02 UTC 2014

Modified Files:
src/external/bsd/file/dist: config.h.in configure configure.ac
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive elf filesystems
src/external/bsd/file/dist/src: Makefile.in apprentice.c cdf.c
encoding.c file.c file.h funcs.c magic.c readcdf.c softmagic.c
Removed Files:
src/external/bsd/file/dist/magic/magdir: rinex

Log Message:
welcome to file-5.20


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/config.h.in \
src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/file/dist/doc/libmagic.3 \
src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/magic/magdir/archive
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/magic/magdir/elf
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/file/dist/magic/magdir/rinex
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/Makefile.in \
src/external/bsd/file/dist/src/cdf.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/file.h \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/encoding.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/src/file.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/magic.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/src/readcdf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/config.h.in
diff -u src/external/bsd/file/dist/config.h.in:1.8 src/external/bsd/file/dist/config.h.in:1.9
--- src/external/bsd/file/dist/config.h.in:1.8	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/config.h.in	Fri Oct 10 16:15:01 2014
@@ -44,6 +44,9 @@
 /* Define to 1 if you have the `fork' function. */
 #undef HAVE_FORK
 
+/* Define to 1 if you have the `freelocale' function. */
+#undef HAVE_FREELOCALE
+
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #undef HAVE_FSEEKO
 
@@ -95,6 +98,9 @@
 /* Define to 1 if you have a working `mmap' system call. */
 #undef HAVE_MMAP
 
+/* Define to 1 if you have the `newlocale' function. */
+#undef HAVE_NEWLOCALE
+
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
@@ -182,6 +188,9 @@
 /* Define to 1 if you have the unistd.h header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
 /* Define to 1 if you have the `utime' function. */
 #undef HAVE_UTIME
 
Index: src/external/bsd/file/dist/configure.ac
diff -u src/external/bsd/file/dist/configure.ac:1.8 src/external/bsd/file/dist/configure.ac:1.9
--- src/external/bsd/file/dist/configure.ac:1.8	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/configure.ac	Fri Oct 10 16:15:01 2014
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.19],[chris...@astron.com])
+AC_INIT([file],[5.20],[chris...@astron.com])
 AM_INIT_AUTOMAKE([subdir-objects foreign])
 AM_MAINTAINER_MODE(disable)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -139,7 +139,7 @@ else
 fi])
 
 dnl Checks for functions
-AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof)
+AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale)
 
 dnl Provide implementation of some required functions if necessary
 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)

Index: src/external/bsd/file/dist/configure
diff -u src/external/bsd/file/dist/configure:1.11 src/external/bsd/file/dist/configure:1.12
--- src/external/bsd/file/dist/configure:1.11	Thu Jun 12 22:08:06 2014
+++ src/external/bsd/file/dist/configure	Fri Oct 10 16:15:01 2014
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for file 5.19.
+# Generated by GNU Autoconf 2.69 for file 5.20.
 #
 # Report bugs to chris...@astron.com.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='file'
 PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.19'
-PACKAGE_STRING='file 5.19'
+PACKAGE_VERSION='5.20'
+PACKAGE_STRING='file 

CVS commit: src/external/bsd/file/include

2014-10-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 10 20:57:48 UTC 2014

Modified Files:
src/external/bsd/file/include: config.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/include/config.h
diff -u src/external/bsd/file/include/config.h:1.6 src/external/bsd/file/include/config.h:1.7
--- src/external/bsd/file/include/config.h:1.6	Sun Dec  1 15:15:42 2013
+++ src/external/bsd/file/include/config.h	Fri Oct 10 16:57:48 2014
@@ -39,9 +39,15 @@
 /* Define to 1 if you have the fcntl.h header file. */
 #define HAVE_FCNTL_H 1
 
+/* Define to 1 if you have the `fmtcheck' function. */
+#define HAVE_FMTCHECK 1
+
 /* Define to 1 if you have the `fork' function. */
 #define HAVE_FORK 1
 
+/* Define to 1 if you have the `freelocale' function. */
+#define HAVE_FREELOCALE 1
+
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #define HAVE_FSEEKO 1
 
@@ -57,6 +63,9 @@
 /* Define to 1 if you have the `getpagesize' function. */
 #define HAVE_GETPAGESIZE 1
 
+/* Define to 1 if the system has the type `intptr_t'. */
+#define HAVE_INTPTR_T 1
+
 /* Define to 1 if you have the inttypes.h header file. */
 #define HAVE_INTTYPES_H 1
 
@@ -82,7 +91,7 @@
 #define HAVE_MEMORY_H 1
 
 /* Define to 1 if you have the `mkostemp' function. */
-/* #undef HAVE_MKOSTEMP */
+#define HAVE_MKOSTEMP 1
 
 /* Define to 1 if you have the `mkstemp' function. */
 #define HAVE_MKSTEMP 1
@@ -90,6 +99,9 @@
 /* Define to 1 if you have a working `mmap' system call. */
 #define HAVE_MMAP 1
 
+/* Define to 1 if you have the `newlocale' function. */
+#define HAVE_NEWLOCALE 1
+
 /* Define to 1 if you have the `pread' function. */
 #define HAVE_PREAD 1
 
@@ -102,6 +114,9 @@
 /* Define to 1 if you have the stdlib.h header file. */
 #define HAVE_STDLIB_H 1
 
+/* Define to 1 if you have the `strcasestr' function. */
+#define HAVE_STRCASESTR 1
+
 /* Define to 1 if you have the `strerror' function. */
 #define HAVE_STRERROR 1
 
@@ -168,9 +183,15 @@
 /* HAVE_TZNAME */
 #define HAVE_TZNAME 1
 
+/* Define to 1 if the system has the type `uintptr_t'. */
+#define HAVE_UINTPTR_T 1
+
 /* Define to 1 if you have the unistd.h header file. */
 #define HAVE_UNISTD_H 1
 
+/* Define to 1 if you have the `uselocale' function. */
+/* #undef HAVE_USELOCALE */
+
 /* Define to 1 if you have the `utime' function. */
 #define HAVE_UTIME 1
 
@@ -223,9 +244,6 @@
sysmacros.h. */
 /* #undef MAJOR_IN_SYSMACROS */
 
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
 /* Name of package */
 #define PACKAGE file
 
@@ -236,7 +254,7 @@
 #define PACKAGE_NAME file
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING file 5.14
+#define PACKAGE_STRING file 5.20
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME file
@@ -245,9 +263,7 @@
 #define PACKAGE_URL 
 
 /* Define to the version of this package. */
-#if 0
-#define PACKAGE_VERSION 5.14
-#endif
+#define PACKAGE_VERSION 5.20
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -276,11 +292,8 @@
 # define __EXTENSIONS__ 1
 #endif
 
-
-#if 0
 /* Version number of package */
-#define VERSION 5.14
-#endif
+#define VERSION 5.20
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -344,6 +357,10 @@
such a type exists and the standard includes do not define it. */
 /* #undef int64_t */
 
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+   if such a type exists, and if the system does not define it. */
+/* #undef intptr_t */
+
 /* Define to a type if wchar.h does not define. */
 /* #undef mbstate_t */
 
@@ -372,5 +389,9 @@
such a type exists and the standard includes do not define it. */
 /* #undef uint8_t */
 
+/* Define to the type of an unsigned integer type wide enough to hold a
+   pointer, if such a type exists, and if the system does not define it. */
+/* #undef uintptr_t */
+
 /* Define as `fork' if `vfork' does not work. */
 /* #undef vfork */



CVS commit: src/external/bsd/file/dist/magic/magdir

2014-09-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep 19 08:59:38 UTC 2014

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
Add UCB RISC-V EM value


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.9 src/external/bsd/file/dist/magic/magdir/elf:1.10
--- src/external/bsd/file/dist/magic/magdir/elf:1.9	Fri Jun 13 02:08:06 2014
+++ src/external/bsd/file/dist/magic/magdir/elf	Fri Sep 19 08:59:38 2014
@@ -257,6 +257,7 @@
 18	leshort		216		Cognitive Smart Memory,
 18	leshort		217		iCelero CoolEngine,
 18	leshort		218		Nanoradio Optimized RISC,
+18	leshort		243		UCB RISC-V
 18	leshort		0x1057		AVR (unofficial),
 18	leshort		0x1059		MSP430 (unofficial),
 18	leshort		0x1223		Adapteva Epiphany (unofficial),



CVS commit: src/external/bsd/file/dist/src

2014-09-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 11 13:30:04 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: encoding.c

Log Message:
PR/49192: remove dup assignment.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/file/dist/src/encoding.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/encoding.c
diff -u src/external/bsd/file/dist/src/encoding.c:1.1.1.5 src/external/bsd/file/dist/src/encoding.c:1.2
--- src/external/bsd/file/dist/src/encoding.c:1.1.1.5	Thu Jun 12 21:48:22 2014
+++ src/external/bsd/file/dist/src/encoding.c	Thu Sep 11 09:30:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: encoding.c,v 1.1.1.5 2014/06/13 01:48:22 christos Exp $	*/
+/*	$NetBSD: encoding.c,v 1.2 2014/09/11 13:30:04 christos Exp $	*/
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
  * Software written by Ian F. Darwin and others;
@@ -39,7 +39,7 @@
 #if 0
 FILE_RCSID(@(#)$File: encoding.c,v 1.9 2013/11/19 20:45:50 christos Exp $)
 #else
-__RCSID($NetBSD: encoding.c,v 1.1.1.5 2014/06/13 01:48:22 christos Exp $);
+__RCSID($NetBSD: encoding.c,v 1.2 2014/09/11 13:30:04 christos Exp $);
 #endif
 #endif	/* lint */
 
@@ -102,7 +102,6 @@ file_encoding(struct magic_set *ms, cons
 		*code_mime = utf-8;
 	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen)  1) {
 		DPRINTF((utf8 % SIZE_T_FORMAT u\n, *ulen));
-		*code = UTF-8 Unicode (with BOM);
 		*code = UTF-8 Unicode;
 		*code_mime = utf-8;
 	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {



CVS commit: src/external/bsd/file/dist/src

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 13:38:53 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: readelf.c

Log Message:
Initialise all fields.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/src/readelf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.8 src/external/bsd/file/dist/src/readelf.c:1.9
--- src/external/bsd/file/dist/src/readelf.c:1.8	Fri Jun 13 02:08:06 2014
+++ src/external/bsd/file/dist/src/readelf.c	Fri Jun 13 13:38:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $	*/
 /*
  * Copyright (c) Christos Zoulas 2003.
  * All Rights Reserved.
@@ -31,7 +31,7 @@
 #if 0
 FILE_RCSID(@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $)
 #else
-__RCSID($NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $);
+__RCSID($NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $);
 #endif
 #endif
 
@@ -473,8 +473,8 @@ private size_t
 donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
 int clazz, int swap, size_t align, int *flags)
 {
-	Elf32_Nhdr nh32 = { 0 };
-	Elf64_Nhdr nh64 = { 0 };
+	Elf32_Nhdr nh32 = { 0, 0, 0 };
+	Elf64_Nhdr nh64 = { 0, 0, 0 };
 	size_t noff, doff;
 #ifdef ELFCORE
 	int os_style = -1;



CVS commit: src/external/bsd/file

2014-01-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 17 20:24:20 UTC 2014

Modified Files:
src/external/bsd/file: Makefile.inc

Log Message:
Make a gcc 4.8 warning non-fatal (couldn't find a way to avoid it, the
data is initialized via memcpy to a void pointer, so the may be uninitialized
warning is not true)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.4 src/external/bsd/file/Makefile.inc:1.5
--- src/external/bsd/file/Makefile.inc:1.4	Sun Dec  1 20:15:42 2013
+++ src/external/bsd/file/Makefile.inc	Fri Jan 17 20:24:20 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.4 2013/12/01 20:15:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2014/01/17 20:24:20 martin Exp $
 
 WARNS=4
 DIST=${NETBSDSRCDIR}/external/bsd/file/dist
@@ -20,4 +20,8 @@ CPPFLAGS+=	-DMAGIC='${MAGIC}' -DHAVE_C
 		-DELFCORE -DVERSION='${VERSION}'
 CPPFLAGS+=	-I${.CURDIR}/../include -I${DIST}/src
 
+.if ${ACTIVE_CC}==gcc  ${HAVE_GCC}==48
+CPPFLAGS.readelf.c	+= -Wno-error=maybe-uninitialized
+.endif
+
 .PATH:		${DIST}/src ${DIST}/doc



CVS commit: src/external/bsd/file/dist/src

2014-01-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan 16 23:35:54 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: file.c

Log Message:
Mark some more dead functions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/file/dist/src/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.c
diff -u src/external/bsd/file/dist/src/file.c:1.1.1.6 src/external/bsd/file/dist/src/file.c:1.2
--- src/external/bsd/file/dist/src/file.c:1.1.1.6	Sun Dec  1 19:28:17 2013
+++ src/external/bsd/file/dist/src/file.c	Thu Jan 16 23:35:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.1.1.6 2013/12/01 19:28:17 christos Exp $	*/
+/*	$NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: file.c,v 1.152 2013/06/26 14:46:54 christos Exp $)
 #else
-__RCSID($NetBSD: file.c,v 1.1.1.6 2013/12/01 19:28:17 christos Exp $);
+__RCSID($NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $);
 #endif
 #endif	/* lint */
 
@@ -127,9 +127,9 @@ private const struct {
 
 private char *progname;		/* used throughout 		*/
 
-private void usage(void);
+private void usage(void) __dead;
 private void docprint(const char *);
-private void help(void);
+private void help(void) __dead;
 
 private int unwrap(struct magic_set *, const char *);
 private int process(struct magic_set *ms, const char *, int);



CVS commit: src/external/bsd/file/dist/src

2014-01-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan 16 23:36:52 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: file.c

Log Message:
Only use __dead if it exists.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.c
diff -u src/external/bsd/file/dist/src/file.c:1.2 src/external/bsd/file/dist/src/file.c:1.3
--- src/external/bsd/file/dist/src/file.c:1.2	Thu Jan 16 23:35:54 2014
+++ src/external/bsd/file/dist/src/file.c	Thu Jan 16 23:36:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.3 2014/01/16 23:36:52 joerg Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: file.c,v 1.152 2013/06/26 14:46:54 christos Exp $)
 #else
-__RCSID($NetBSD: file.c,v 1.2 2014/01/16 23:35:54 joerg Exp $);
+__RCSID($NetBSD: file.c,v 1.3 2014/01/16 23:36:52 joerg Exp $);
 #endif
 #endif	/* lint */
 
@@ -127,9 +127,15 @@ private const struct {
 
 private char *progname;		/* used throughout 		*/
 
-private void usage(void) __dead;
+#ifdef __dead
+__dead
+#endif
+private void usage(void);
 private void docprint(const char *);
-private void help(void) __dead;
+#ifdef __dead
+__dead
+#endif
+private void help(void);
 
 private int unwrap(struct magic_set *, const char *);
 private int process(struct magic_set *ms, const char *, int);



CVS commit: src/external/bsd/file/dist/src

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:12:07 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: file.h funcs.c

Log Message:
Format string checks for file_vprintf and file_error_core


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/funcs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.9 src/external/bsd/file/dist/src/file.h:1.10
--- src/external/bsd/file/dist/src/file.h:1.9	Sun Dec  1 19:32:15 2013
+++ src/external/bsd/file/dist/src/file.h	Tue Jan  7 02:12:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.9 2013/12/01 19:32:15 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.10 2014/01/07 02:12:07 joerg Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -417,7 +417,8 @@ protected int file_buffer(struct magic_s
 size_t);
 protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
-protected int file_vprintf(struct magic_set *, const char *, va_list);
+protected int file_vprintf(struct magic_set *, const char *, va_list)
+__attribute__((__format__(__printf__, 2, 0)));
 protected size_t file_printedlen(const struct magic_set *);
 protected int file_replace(struct magic_set *, const char *, const char *);
 protected int file_printf(struct magic_set *, const char *, ...)

Index: src/external/bsd/file/dist/src/funcs.c
diff -u src/external/bsd/file/dist/src/funcs.c:1.6 src/external/bsd/file/dist/src/funcs.c:1.7
--- src/external/bsd/file/dist/src/funcs.c:1.6	Sun Dec  1 19:32:15 2013
+++ src/external/bsd/file/dist/src/funcs.c	Tue Jan  7 02:12:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $	*/
+/*	$NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $	*/
 
 /*
  * Copyright (c) Christos Zoulas 2003.
@@ -32,7 +32,7 @@
 #if 0
 FILE_RCSID(@(#)$File: funcs.c,v 1.64 2013/11/19 23:49:44 christos Exp $)
 #else
-__RCSID($NetBSD: funcs.c,v 1.6 2013/12/01 19:32:15 christos Exp $);
+__RCSID($NetBSD: funcs.c,v 1.7 2014/01/07 02:12:07 joerg Exp $);
 #endif
 #endif	/* lint */
 
@@ -101,6 +101,7 @@ file_printf(struct magic_set *ms, const 
  * error - print best error message possible
  */
 /*VARARGS*/
+__attribute__((__format__(__printf__, 3, 0)))
 private void
 file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
 size_t lineno)



CVS commit: src/external/bsd/file/lib

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 20:01:14 UTC 2013

Modified Files:
src/external/bsd/file/lib: Makefile

Log Message:
Get version from the configure script


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.4 src/external/bsd/file/lib/Makefile:1.5
--- src/external/bsd/file/lib/Makefile:1.4	Tue Aug 13 15:29:45 2013
+++ src/external/bsd/file/lib/Makefile	Sun Dec  1 15:01:14 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2013/08/13 19:29:45 drochner Exp $
+#	$NetBSD: Makefile,v 1.5 2013/12/01 20:01:14 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -33,11 +33,13 @@ MLINKS+=	libmagic.3 magic_open.3 \
 INCS=		magic.h
 INCSDIR=	/usr/include
 
+VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([0-9]*\)\.\([0-9]*\)'/\1\2/p  ${DIST}/configure
+
 COPTS.softmagic.c = -Wno-format-nonliteral
 
 magic.c:	magic.h
 magic.h:magic.h.in
-	${TOOL_SED} -e s/X.YY/514/  ${.ALLSRC}  ${.TARGET}
+	${TOOL_SED} -e s/X.YY/${VERSION}/  ${.ALLSRC}  ${.TARGET}
 CLEANFILES+=	magic.h
 
 .include bsd.lib.mk



CVS commit: src/external/bsd/file

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 20:15:42 UTC 2013

Modified Files:
src/external/bsd/file: Makefile.inc
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: Makefile

Log Message:
Finish version auto-setting.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.3 src/external/bsd/file/Makefile.inc:1.4
--- src/external/bsd/file/Makefile.inc:1.3	Fri May  8 19:36:42 2009
+++ src/external/bsd/file/Makefile.inc	Sun Dec  1 15:15:42 2013
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.3 2009/05/08 23:36:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2013/12/01 20:15:42 christos Exp $
 
-DIST=${.CURDIR}/../dist
 WARNS=4
+DIST=${NETBSDSRCDIR}/external/bsd/file/dist
+
+.include bsd.own.mk
 
 BINDIR?= /usr/bin
 USE_FORT?= yes	# data-driven bugs?
@@ -12,8 +14,10 @@ MFILESDIR?=	/usr/share/misc
 MFILES?=	magic.mgc
 MAGIC?=		${MFILESDIR}/magic
 
+VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([^']*\)'/\1/p ${DIST}/configure
+
 CPPFLAGS+=	-DMAGIC='${MAGIC}' -DHAVE_CONFIG_H -DQUICK -DBUILTIN_ELF \
-		-DELFCORE
+		-DELFCORE -DVERSION='${VERSION}'
 CPPFLAGS+=	-I${.CURDIR}/../include -I${DIST}/src
 
 .PATH:		${DIST}/src ${DIST}/doc

Index: src/external/bsd/file/include/config.h
diff -u src/external/bsd/file/include/config.h:1.5 src/external/bsd/file/include/config.h:1.6
--- src/external/bsd/file/include/config.h:1.5	Sat Mar 23 12:15:59 2013
+++ src/external/bsd/file/include/config.h	Sun Dec  1 15:15:42 2013
@@ -245,7 +245,9 @@
 #define PACKAGE_URL 
 
 /* Define to the version of this package. */
+#if 0
 #define PACKAGE_VERSION 5.14
+#endif
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -275,8 +277,10 @@
 #endif
 
 
+#if 0
 /* Version number of package */
 #define VERSION 5.14
+#endif
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.5 src/external/bsd/file/lib/Makefile:1.6
--- src/external/bsd/file/lib/Makefile:1.5	Sun Dec  1 15:01:14 2013
+++ src/external/bsd/file/lib/Makefile	Sun Dec  1 15:15:42 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2013/12/01 20:01:14 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2013/12/01 20:15:42 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -33,13 +33,11 @@ MLINKS+=	libmagic.3 magic_open.3 \
 INCS=		magic.h
 INCSDIR=	/usr/include
 
-VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([0-9]*\)\.\([0-9]*\)'/\1\2/p  ${DIST}/configure
-
 COPTS.softmagic.c = -Wno-format-nonliteral
 
 magic.c:	magic.h
 magic.h:magic.h.in
-	${TOOL_SED} -e s/X.YY/${VERSION}/  ${.ALLSRC}  ${.TARGET}
+	${TOOL_SED} -e s/X.YY/${VERSION:S/.//g}/  ${.ALLSRC}  ${.TARGET}
 CLEANFILES+=	magic.h
 
 .include bsd.lib.mk



CVS commit: src/external/bsd/file/dist/src

2013-11-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Nov 28 14:40:00 UTC 2013

Modified Files:
src/external/bsd/file/dist/src: compress.c

Log Message:
Spell the null pointer as NULL, not as nul.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/compress.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/compress.c
diff -u src/external/bsd/file/dist/src/compress.c:1.6 src/external/bsd/file/dist/src/compress.c:1.7
--- src/external/bsd/file/dist/src/compress.c:1.6	Thu Jan  3 23:05:38 2013
+++ src/external/bsd/file/dist/src/compress.c	Thu Nov 28 14:40:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: compress.c,v 1.6 2013/01/03 23:05:38 christos Exp $	*/
+/*	$NetBSD: compress.c,v 1.7 2013/11/28 14:40:00 joerg Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -40,7 +40,7 @@
 #if 0
 FILE_RCSID(@(#)$File: compress.c,v 1.70 2012/11/07 17:54:48 christos Exp $)
 #else
-__RCSID($NetBSD: compress.c,v 1.6 2013/01/03 23:05:38 christos Exp $);
+__RCSID($NetBSD: compress.c,v 1.7 2013/11/28 14:40:00 joerg Exp $);
 #endif
 #endif
 
@@ -487,7 +487,7 @@ uncompressbuf(struct magic_set *ms, int 
 #endif
 			free(*newch);
 			n = 0;
-			newch[0] = '\0';
+			*newch = NULL;
 			goto err;
 		} else {
 			n = r;



CVS commit: src/external/bsd/file/dist/magic/magdir

2013-08-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug  4 07:49:07 UTC 2013

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
Print out BE8 and LE8 for arm elf


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.6 src/external/bsd/file/dist/magic/magdir/elf:1.7
--- src/external/bsd/file/dist/magic/magdir/elf:1.6	Sat Mar 23 16:23:46 2013
+++ src/external/bsd/file/dist/magic/magdir/elf	Sun Aug  4 07:49:07 2013
@@ -109,6 +109,8 @@
 4	byte		1
 36	lelong0xff00	0x0400	EABI4
 36	lelong0xff00	0x0500	EABI5
+36	lelong		0x0080	BE8
+36	lelong		0x0040	LE8
 18	leshort		41		Alpha,
 18	leshort		0xa390		IBM S/390 (obsolete),
 18	leshort		42		Renesas SH,



CVS commit: src/external/bsd/file/dist

2013-03-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 23 15:50:26 UTC 2013

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22550

Log Message:
import file-5.14
changes are name + use keyword features, bug fixes

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_14

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
C src/external/bsd/file/dist/configure.ac
C src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/Makefile.in
C src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
C src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
C src/external/bsd/file/dist/depcomp
C src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
C src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/asctime_r.c
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/ctime_r.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcat.c
N src/external/bsd/file/dist/src/pread.c
U src/external/bsd/file/dist/src/readelf.h
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
C src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
U src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
C src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
U src/external/bsd/file/dist/src/funcs.c
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/tar.h
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
C src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/cdf_time.c
U src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
N src/external/bsd/file/dist/src/magic.h.in
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
C src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/cad
N src/external/bsd/file/dist/magic/magdir/aout
U src/external/bsd/file/dist/magic/magdir/apl
C src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
C src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/external/bsd/file/dist/magic/magdir/citrus
U src/external/bsd/file/dist/magic/magdir/clarion
U src/external/bsd/file/dist/magic/magdir/claris
U 

CVS commit: src/external/bsd/file/dist/magic/magdir

2013-03-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 23 16:23:46 UTC 2013

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
remove extra space


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.5 src/external/bsd/file/dist/magic/magdir/elf:1.6
--- src/external/bsd/file/dist/magic/magdir/elf:1.5	Sat Mar 23 12:15:58 2013
+++ src/external/bsd/file/dist/magic/magdir/elf	Sat Mar 23 12:23:46 2013
@@ -189,9 +189,9 @@
 4	byte		1		32-bit
 4	byte		2		64-bit
 5	byte		0		invalid byte order
-5	byte		1		LSB 
+5	byte		1		LSB
 0	use		elf-le
-5	byte		2		MSB 
+5	byte		2		MSB
 0	use		\^elf-le
 # Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
 # like proper ELF, but extracting the string had bad results.



CVS commit: src/external/bsd/file

2013-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 15:34:47 UTC 2013

Modified Files:
src/external/bsd/file: file2netbsd

Log Message:
fix version detection


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/file2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/file2netbsd
diff -u src/external/bsd/file/file2netbsd:1.4 src/external/bsd/file/file2netbsd:1.5
--- src/external/bsd/file/file2netbsd:1.4	Thu Jan  3 18:04:52 2013
+++ src/external/bsd/file/file2netbsd	Fri Jan  4 10:34:47 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: file2netbsd,v 1.4 2013/01/03 23:04:52 christos Exp $
+#	$NetBSD: file2netbsd,v 1.5 2013/01/04 15:34:47 christos Exp $
 #
 # Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,7 +41,13 @@ then
 fi
 FILE=$1
 
-file_vers=$(awk -F', ' '/AC_INIT\(/ { print $2 }' $FILE/configure.ac)
+file_vers=$(awk -F',' '/AC_INIT\(/ { print $2 }' $FILE/configure.ac | tr -d '[' | tr -d ']' | tr -d ' ')
+
+case $file_vers in
+[0-9].[0-9][0-9]) ;;
+*)	echo $PROG: Cannot determine file version: $file_vers 12
+	exit 1;;
+esac
 
 ### Wipe out stuff we don't want
 find $FILE -name .cvsignore -delete



CVS commit: src/external/bsd/file/dist/doc

2013-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 15:37:54 UTC 2013

Modified Files:
src/external/bsd/file/dist/doc: file.1 magic.5

Log Message:
fix the version string manually.
new sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/doc/magic.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/file.1
diff -u src/external/bsd/file/dist/doc/file.1:1.10 src/external/bsd/file/dist/doc/file.1:1.11
--- src/external/bsd/file/dist/doc/file.1:1.10	Thu Jan  3 18:05:37 2013
+++ src/external/bsd/file/dist/doc/file.1	Fri Jan  4 10:37:53 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: file.1,v 1.10 2013/01/03 23:05:37 christos Exp $
+.\	$NetBSD: file.1,v 1.11 2013/01/04 15:37:53 christos Exp $
 .\
 .\ $File: file.man,v 1.101 2012/11/01 04:31:53 christos Exp $
 .Dd October 25, 2012
@@ -26,7 +26,7 @@
 .Nm
 .Op Fl Fl help
 .Sh DESCRIPTION
-This manual page documents version  of the
+This manual page documents version 5.12 of the
 .Nm
 command.
 .Pp
@@ -559,15 +559,20 @@ or the mailing list at
 .Sh TODO
 .Pp
 Fix output so that tests for MIME and APPLE flags are not needed all
-over the place, and actual output is only done in one place. This
-needs a design. Suggestion: push possible outputs on to a list, then
+over the place, and actual output is only done in one place.
+This needs a design.
+Suggestion: push possible outputs on to a list, then
 pick the last-pushed (most specific, one hopes) value at the end, or
-use a default if the list is empty. This should not slow down evaluation.
+use a default if the list is empty.
+This should not slow down evaluation.
 .Pp
-Continue to squash all magic bugs. See Debian BTS for a good source.
+Continue to squash all magic bugs.
+See Debian BTS for a good source.
 .Pp
 Store arbitrarily long strings, for example for %s patterns, so that
-they can be printed out. Fixes Debian bug #271672. Would require more
+they can be printed out.
+Fixes Debian bug #271672.
+Would require more
 complex store/load code in apprentice.
 .Pp
 Add syntax for relative offsets after current level (Debian bug #466037).
@@ -581,8 +586,9 @@ Add an option to print URLs for the sour
 .Pp
 Combine script searches and add a way to map executable names to MIME
 types (e.g. have a magic value for !:mime which causes the resulting
-string to be looked up in a table). This would avoid adding the same
-magic repeatedly for each new hash-bang interpreter.
+string to be looked up in a table).
+This would avoid adding the same magic repeatedly for each new hash-bang
+interpreter.
 .Pp
 Fix
 .Dq name

Index: src/external/bsd/file/dist/doc/magic.5
diff -u src/external/bsd/file/dist/doc/magic.5:1.8 src/external/bsd/file/dist/doc/magic.5:1.9
--- src/external/bsd/file/dist/doc/magic.5:1.8	Thu Jan  3 18:05:37 2013
+++ src/external/bsd/file/dist/doc/magic.5	Fri Jan  4 10:37:53 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: magic.5,v 1.8 2013/01/03 23:05:37 christos Exp $
+.\	$NetBSD: magic.5,v 1.9 2013/01/04 15:37:53 christos Exp $
 .\
 .\ $File: magic.man,v 1.76 2012/11/07 20:29:27 christos Exp $
 .Dd November 7, 2012
@@ -12,7 +12,7 @@
 This manual page documents the format of the magic file as
 used by the
 .Xr file 1
-command, version .
+command, version 5.12.
 The
 .Xr file 1
 command identifies the type of a file using,



CVS commit: src/external/bsd/file/dist/src

2013-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 17:03:13 UTC 2013

Modified Files:
src/external/bsd/file/dist/src: softmagic.c

Log Message:
bring return value fixes from head.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/softmagic.c
diff -u src/external/bsd/file/dist/src/softmagic.c:1.7 src/external/bsd/file/dist/src/softmagic.c:1.8
--- src/external/bsd/file/dist/src/softmagic.c:1.7	Thu Jan  3 18:05:38 2013
+++ src/external/bsd/file/dist/src/softmagic.c	Fri Jan  4 12:03:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: softmagic.c,v 1.7 2013/01/03 23:05:38 christos Exp $	*/
+/*	$NetBSD: softmagic.c,v 1.8 2013/01/04 17:03:13 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: softmagic.c,v 1.155 2012/11/01 04:21:27 christos Exp $)
 #else
-__RCSID($NetBSD: softmagic.c,v 1.7 2013/01/03 23:05:38 christos Exp $);
+__RCSID($NetBSD: softmagic.c,v 1.8 2013/01/04 17:03:13 christos Exp $);
 #endif
 #endif	/* lint */
 
@@ -49,9 +49,9 @@ __RCSID($NetBSD: softmagic.c,v 1.7 2013
 
 
 private int match(struct magic_set *, struct magic *, uint32_t,
-const unsigned char *, size_t, size_t, int, int, int);
+const unsigned char *, size_t, size_t, int, int, int, int *);
 private int mget(struct magic_set *, const unsigned char *,
-struct magic *, size_t, size_t, unsigned int, int, int, int);
+struct magic *, size_t, size_t, unsigned int, int, int, int, int *);
 private int magiccheck(struct magic_set *, struct magic *);
 private int32_t mprint(struct magic_set *, struct magic *);
 private int32_t moffset(struct magic_set *, struct magic *);
@@ -79,7 +79,7 @@ file_softmagic(struct magic_set *ms, con
 	int rv;
 	for (ml = ms-mlist[0]-next; ml != ms-mlist[0]; ml = ml-next)
 		if ((rv = match(ms, ml-magic, ml-nmagic, buf, nbytes, 0, mode,
-		text, 0)) != 0)
+		text, 0, NULL)) != 0)
 			return rv;
 
 	return 0;
@@ -115,16 +115,19 @@ file_softmagic(struct magic_set *ms, con
 private int
 match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
 const unsigned char *s, size_t nbytes, size_t offset, int mode, int text,
-int flip)
+int flip, int *returnval)
 {
 	uint32_t magindex = 0;
 	unsigned int cont_level = 0;
 	int need_separator = 0;
-	int returnval = 0, e; /* if a match is found it is set to 1*/
+	int returnvalv = 0, e; /* if a match is found it is set to 1*/
 	int firstline = 1; /* a flag to print X\n  X\n- X */
 	int printed_something = 0;
 	int print = (ms-flags  (MAGIC_MIME|MAGIC_APPLE)) == 0;
 
+	if (returnval == NULL)
+		returnval = returnvalv;
+
 	if (file_check_mem(ms, cont_level) == -1)
 		return -1;
 
@@ -150,7 +153,7 @@ match(struct magic_set *ms, struct magic
 
 		/* if main entry matches, print it... */
 		switch (mget(ms, s, m, nbytes, offset, cont_level, mode, text,
-		flip)) {
+		flip, returnval)) {
 		case -1:
 			return -1;
 		case 0:
@@ -158,7 +161,7 @@ match(struct magic_set *ms, struct magic
 			break;
 		default:
 			if (m-type == FILE_INDIRECT)
-returnval = 1;
+*returnval = 1;
 
 			switch (magiccheck(ms, m)) {
 			case -1:
@@ -184,6 +187,7 @@ match(struct magic_set *ms, struct magic
 		}
 
 		if ((e = handle_annotation(ms, m)) != 0) {
+			*returnval = 1;
 			return e;
 		}
 		/*
@@ -235,7 +239,7 @@ match(struct magic_set *ms, struct magic
 			}
 #endif
 			switch (mget(ms, s, m, nbytes, offset, cont_level, mode,
-			text, flip)) {
+			text, flip, returnval)) {
 			case -1:
 return -1;
 			case 0:
@@ -245,7 +249,7 @@ match(struct magic_set *ms, struct magic
 break;
 			default:
 if (m-type == FILE_INDIRECT)
-	returnval = 1;
+	*returnval = 1;
 flush = 0;
 break;
 			}
@@ -268,8 +272,10 @@ match(struct magic_set *ms, struct magic
 	ms-c.li[cont_level].got_match = 0;
 	break;
 }
-if ((e = handle_annotation(ms, m)) != 0)
+if ((e = handle_annotation(ms, m)) != 0) {
+	*returnval = 1;
 	return e;
+}
 /*
  * If we are going to print something,
  * make sure that we have a separator first.
@@ -318,13 +324,13 @@ match(struct magic_set *ms, struct magic
 		if (printed_something) {
 			firstline = 0;
 			if (print)
-returnval = 1;
+*returnval = 1;
 		}
 		if ((ms-flags  MAGIC_CONTINUE) == 0  printed_something) {
-			return returnval; /* don't keep searching */
+			return *returnval; /* don't keep searching */
 		}
 	}
-	return returnval;  /* This is hit if -k is set or there is no match */
+	return *returnval;  /* This is hit if -k is set or there is no match */
 }
 
 private int
@@ -1116,7 +1122,7 @@ mcopy(struct magic_set *ms, union VALUET
 private int
 mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
 size_t nbytes, size_t o, unsigned int 

CVS commit: src/external/bsd/file/dist/magic/magdir

2013-01-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 17:33:01 UTC 2013

Modified Files:
src/external/bsd/file/dist/magic/magdir: assembler

Log Message:
fix quoting.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/file/dist/magic/magdir/assembler

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/assembler
diff -u src/external/bsd/file/dist/magic/magdir/assembler:1.1.1.2 src/external/bsd/file/dist/magic/magdir/assembler:1.2
--- src/external/bsd/file/dist/magic/magdir/assembler:1.1.1.2	Thu Jan  3 11:27:53 2013
+++ src/external/bsd/file/dist/magic/magdir/assembler	Fri Jan  4 12:33:01 2013
@@ -2,17 +2,17 @@
 # $File: assembler,v 1.2 2012/10/31 18:41:42 christos Exp $
 # make:  file(1) magic for assembler source
 #
-0	regex	\^[\020\t]*\.asciiz\?		assembler source text
+0	regex	\^[\020\t]*\\.asciiz		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.byte		assembler source text
+0	regex	\^[\020\t]*\\.byte		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.even		assembler source text
+0	regex	\^[\020\t]*\\.even		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.globl		assembler source text
+0	regex	\^[\020\t]*\\.globl		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.text		assembler source text
+0	regex	\^[\020\t]*\\.text		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.file		assembler source text
+0	regex	\^[\020\t]*\\.file		assembler source text
 !:mime	text/x-asm
-0	regex	\^[\020\t]*\.type		assembler source text
+0	regex	\^[\020\t]*\\.type		assembler source text
 !:mime	text/x-asm



CVS commit: src/external/bsd/file/dist

2013-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  3 16:28:06 UTC 2013

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv16727

Log Message:
from ftp.astron.com

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE_5_12

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
C src/external/bsd/file/dist/configure.ac
C src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/Makefile.in
C src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
U src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
U src/external/bsd/file/dist/depcomp
C src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
U src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
N src/external/bsd/file/dist/m4/visibility.m4
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
N src/external/bsd/file/dist/src/asctime_r.c
U src/external/bsd/file/dist/src/asprintf.c
N src/external/bsd/file/dist/src/ctime_r.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
C src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
C src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
C src/external/bsd/file/dist/src/funcs.c
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
C src/external/bsd/file/dist/src/cdf.c
C src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
C src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/apl
U src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
C src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/external/bsd/file/dist/magic/magdir/citrus
U src/external/bsd/file/dist/magic/magdir/clarion
U src/external/bsd/file/dist/magic/magdir/claris
U src/external/bsd/file/dist/magic/magdir/clipper
U src/external/bsd/file/dist/magic/magdir/commands
C 

CVS commit: src/external/bsd/file

2013-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  3 23:04:52 UTC 2013

Modified Files:
src/external/bsd/file: file2netbsd

Log Message:
make it work if $1 != .


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/file2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/file2netbsd
diff -u src/external/bsd/file/file2netbsd:1.3 src/external/bsd/file/file2netbsd:1.4
--- src/external/bsd/file/file2netbsd:1.3	Wed Feb 22 12:47:25 2012
+++ src/external/bsd/file/file2netbsd	Thu Jan  3 18:04:52 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: file2netbsd,v 1.3 2012/02/22 17:47:25 christos Exp $
+#	$NetBSD: file2netbsd,v 1.4 2013/01/03 23:04:52 christos Exp $
 #
 # Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -67,9 +67,9 @@ mv /tmp/file3$$ $c  echo did source mo
 done
 
  Move files to proper names
-mv -f doc/file.man doc/file.1
-mv -f doc/libmagic.man doc/libmagic.3
-mv -f doc/magic.man doc/magic.5
+mv -f $FILE/doc/file.man $FILE/doc/file.1
+mv -f $FILE/doc/libmagic.man $FILE/doc/libmagic.3
+mv -f $FILE/doc/magic.man $FILE/doc/magic.5
 
  Add RCS tags to man pages
 find $FILE -type f -name '*.[0-9]' -print | while read m; do
@@ -86,7 +86,7 @@ mv /tmp/file4$$ $m  echo did manpage m
 done
 
  de-capsize the magdir
-mv magic/Magdir magic/magdir
+mv $FILE/magic/Magdir $FILE/magic/magdir
 
  Make building easier, don't build magic and doc
 echo '/^SUBDIRS/



CVS commit: src/external/bsd/file

2013-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  3 23:18:10 UTC 2013

Modified Files:
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: shlib_version

Log Message:
new config, bump lib


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/include/config.h
diff -u src/external/bsd/file/include/config.h:1.3 src/external/bsd/file/include/config.h:1.4
--- src/external/bsd/file/include/config.h:1.3	Sat Jul 28 04:02:15 2012
+++ src/external/bsd/file/include/config.h	Thu Jan  3 18:18:10 2013
@@ -1,15 +1,24 @@
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
 /* Define in built-in ELF support is used */
 #define BUILTIN_ELF 1
 
 /* Define for ELF core file support */
 #define ELFCORE 1
 
+/* Define to 1 if you have the `asctime_r' function. */
+#define HAVE_ASCTIME_R 1
+
 /* Define to 1 if you have the `asprintf' function. */
 #define HAVE_ASPRINTF 1
 
+/* Define to 1 if you have the `ctime_r' function. */
+#define HAVE_CTIME_R 1
+
 /* HAVE_DAYLIGHT */
 #define HAVE_DAYLIGHT 1
 
@@ -45,11 +54,8 @@
 /* Define to 1 if you have the `getopt_long' function. */
 #define HAVE_GETOPT_LONG 1
 
-/* Define to 1 if the system has the type `int32_t'. */
-#define HAVE_INT32_T 1
-
-/* Define to 1 if the system has the type `int64_t'. */
-#define HAVE_INT64_T 1
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
 
 /* Define to 1 if you have the inttypes.h header file. */
 #define HAVE_INTTYPES_H 1
@@ -66,7 +72,7 @@
 /* Define to 1 if you have the locale.h header file. */
 #define HAVE_LOCALE_H 1
 
-/* Define to 1 if you have the `mbrtowc' function. */
+/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
 #define HAVE_MBRTOWC 1
 
 /* Define to 1 if wchar.h declares mbstate_t. */
@@ -75,14 +81,17 @@
 /* Define to 1 if you have the memory.h header file. */
 #define HAVE_MEMORY_H 1
 
+/* Define to 1 if you have the `mkostemp' function. */
+/* #undef HAVE_MKOSTEMP */
+
 /* Define to 1 if you have the `mkstemp' function. */
 #define HAVE_MKSTEMP 1
 
-/* Define to 1 if you have the `mmap' function. */
+/* Define to 1 if you have a working `mmap' system call. */
 #define HAVE_MMAP 1
 
-/* Define to 1 if the system has the type `pid_t'. */
-#define HAVE_PID_T 1
+/* Define to 1 if you have the stddef.h header file. */
+#define HAVE_STDDEF_H 1
 
 /* Define to 1 if you have the stdint.h header file. */
 #define HAVE_STDINT_H 1
@@ -117,18 +126,21 @@
 /* HAVE_STRUCT_OPTION */
 #define HAVE_STRUCT_OPTION 1
 
-/* Define to 1 if `struct stat' is a member of `st_rdev'. */
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
 #define HAVE_STRUCT_STAT_ST_RDEV 1
 
-/* Define to 1 if `struct tm' is a member of `tm_gmtoff'. */
+/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
 #define HAVE_STRUCT_TM_TM_GMTOFF 1
 
-/* Define to 1 if `struct tm' is a member of `tm_zone'. */
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
 #define HAVE_STRUCT_TM_TM_ZONE 1
 
 /* Define to 1 if you have the sys/mman.h header file. */
 #define HAVE_SYS_MMAN_H 1
 
+/* Define to 1 if you have the sys/param.h header file. */
+#define HAVE_SYS_PARAM_H 1
+
 /* Define to 1 if you have the sys/stat.h header file. */
 #define HAVE_SYS_STAT_H 1
 
@@ -153,18 +165,6 @@
 /* HAVE_TZNAME */
 #define HAVE_TZNAME 1
 
-/* Define to 1 if the system has the type `uint16_t'. */
-#define HAVE_UINT16_T 1
-
-/* Define to 1 if the system has the type `uint32_t'. */
-#define HAVE_UINT32_T 1
-
-/* Define to 1 if the system has the type `uint64_t'. */
-#define HAVE_UINT64_T 1
-
-/* Define to 1 if the system has the type `uint8_t'. */
-#define HAVE_UINT8_T 1
-
 /* Define to 1 if you have the unistd.h header file. */
 #define HAVE_UNISTD_H 1
 
@@ -180,6 +180,16 @@
 /* Define to 1 if you have the `vasprintf' function. */
 #define HAVE_VASPRINTF 1
 
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the vfork.h header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+   declarations. */
+#define HAVE_VISIBILITY 1
+
 /* Define to 1 if you have the wchar.h header file. */
 #define HAVE_WCHAR_H 1
 
@@ -189,6 +199,12 @@
 /* Define to 1 if you have the `wcwidth' function. */
 #define HAVE_WCWIDTH 1
 
+/* Define to 1 if `fork' works. */
+#define HAVE_WORKING_FORK 1
+
+/* Define to 1 if `vfork' works. */
+#define HAVE_WORKING_VFORK 1
+
 /* Define to 1 if you have the zlib.h header file. */
 #define HAVE_ZLIB_H 1
 

CVS commit: src/external/bsd/file/dist/magic/magdir

2013-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  4 00:49:45 UTC 2013

Modified Files:
src/external/bsd/file/dist/magic/magdir: geo

Log Message:
magic bug.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/magic/magdir/geo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/geo
diff -u src/external/bsd/file/dist/magic/magdir/geo:1.1.1.2 src/external/bsd/file/dist/magic/magdir/geo:1.2
--- src/external/bsd/file/dist/magic/magdir/geo:1.1.1.2	Thu Jan  3 11:27:54 2013
+++ src/external/bsd/file/dist/magic/magdir/geo	Thu Jan  3 19:49:44 2013
@@ -106,12 +106,12 @@
 
 # Geospatial Designs http://www.geospatialdesigns.com/surfer6_format.htm
 0	string		DSBB	Surfer 6 binary grid file
-4	leshort		x	\b, %d
-6	leshort		x	\bx%d
-8	ledouble	x	\b, minx=%g
-16	ledouble	x	\b, maxx=%g
-24	ledouble	x	\b, miny=%g
-32	ledouble	x	\b, maxy=%g
-40	ledouble	x	\b, minz=%g
-48	ledouble	x	\b, maxz=%g
+4	leshort		x	\b, %d
+6	leshort		x	\bx%d
+8	ledouble	x	\b, minx=%g
+16	ledouble	x	\b, maxx=%g
+24	ledouble	x	\b, miny=%g
+32	ledouble	x	\b, maxy=%g
+40	ledouble	x	\b, minz=%g
+48	ledouble	x	\b, maxz=%g
 



CVS commit: src/external/bsd/file/dist/magic/magdir

2012-08-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug  4 15:51:20 UTC 2012

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
Add EABI4 and EABI5 for arm


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.2 src/external/bsd/file/dist/magic/magdir/elf:1.3
--- src/external/bsd/file/dist/magic/magdir/elf:1.2	Wed Feb 22 18:25:12 2012
+++ src/external/bsd/file/dist/magic/magdir/elf	Sat Aug  4 15:51:20 2012
@@ -101,6 +101,9 @@
 18	leshort		38		TRW RH-32,
 18	leshort		39		Motorola RCE,
 18	leshort		40		ARM,
+4	byte		1
+36  lelong0xff00	0x0400	EABI4
+36  lelong0xff00	0x0500	EABI5
 18	leshort		41		Alpha,
 18	leshort		0xa390		IBM S/390 (obsolete),
 18	leshort		42		Renesas SH,
@@ -254,6 +257,9 @@
 18	beshort		38		TRW RH-32,
 18	beshort		39		Motorola RCE,
 18	beshort		40		ARM,
+4	byte		2
+36  belong0xff00	0x0400	EABI4
+36  belong0xff00	0x0500	EABI5
 18	beshort		41		Alpha,
 18	beshort		42		Renesas SH,
 18	beshort		43		SPARC V9,



CVS commit: src/external/bsd/file/dist

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:30:56 UTC 2012

Modified Files:
src/external/bsd/file/dist/magic/magdir: apple
src/external/bsd/file/dist/src: apprentice.c softmagic.c

Log Message:
bring in changes from head.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/magic/magdir/apple
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/apple
diff -u src/external/bsd/file/dist/magic/magdir/apple:1.1.1.2 src/external/bsd/file/dist/magic/magdir/apple:1.2
--- src/external/bsd/file/dist/magic/magdir/apple:1.1.1.2	Thu May 12 16:46:57 2011
+++ src/external/bsd/file/dist/magic/magdir/apple	Sat Apr  7 13:30:55 2012
@@ -1,6 +1,6 @@
 
 #--
-# $File: apple,v 1.24 2010/11/25 15:00:12 christos Exp $
+# $File: apple,v 1.25 2012/04/06 21:18:09 christos Exp $
 # apple:  file(1) magic for Apple file formats
 #
 0	search/1/t	FiLeStArTfIlEsTaRt	binscii (apple ][) text
@@ -249,3 +249,45 @@
 # From: Nelson A. de Oliveira nao...@gmail.com
 # .vdi
 4	string innotek\ VirtualBox\ Disk\ Image %s
+
+# Apple disk partition stuff, strengthen the magic using byte 4
+0	beshort	0x4552
+4	byte	0			Apple Driver Map
+2	beshort	x			\b, blocksize %d
+4	belong	x			\b, blockcount %d
+10	beshort	x			\b, devtype %d
+12	beshort	x			\b, devid %d
+20	beshort x			\b, descriptors %d
+# Assume 	8 partitions each at a multiple of the sector size.
+# We could glean this from the partition descriptors, but they are empty!?!?
+(2.S*1)	indirect		\b, contains[@0x%x]: 
+(2.S*2)	indirect		\b, contains[@0x%x]: 
+(2.S*3)	indirect		\b, contains[@0x%x]: 
+(2.S*4)	indirect		\b, contains[@0x%x]: 
+(2.S*5)	indirect		\b, contains[@0x%x]: 
+(2.S*6)	indirect		\b, contains[@0x%x]: 
+(2.S*7)	indirect		\b, contains[@0x%x]: 
+(2.S*8)	indirect		\b, contains[@0x%x]: 
+
+# Yes, the 3rd and 4th bytes are reserved, but we use them to make the
+# magic stronger.
+0	belong	0x504d		Apple Partition Map
+4	belong	x			\b, map block count %d
+8	belong	x			\b, start block %d
+12	belong	x			\b, block count %d
+16	string 0			\b, name %s
+48	string 0			\b, type %s
+124	string 0			\b, processor %s
+140	string 0			\b, boot arguments %s
+92	belong	 1			\b, valid
+92	belong	 2			\b, allocated
+92	belong	 4			\b, in use
+92	belong	 8			\b, has boot info
+92	belong	 16			\b, readable
+92	belong	 32			\b, writable
+92	belong	 64			\b, pic boot code
+92	belong	 128			\b, chain compatible driver
+92	belong	 256			\b, real driver
+92	belong	 512			\b, chain driver
+92	belong	 1024			\b, mount at startup
+92	belong	 2048			\b, is the startup partition

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.6 src/external/bsd/file/dist/src/apprentice.c:1.7
--- src/external/bsd/file/dist/src/apprentice.c:1.6	Wed Feb 22 12:53:51 2012
+++ src/external/bsd/file/dist/src/apprentice.c	Sat Apr  7 13:30:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.6 2012/02/22 17:53:51 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.7 2012/04/07 17:30:55 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: apprentice.c,v 1.173 2011/12/08 12:38:24 rrt Exp $)
 #else
-__RCSID($NetBSD: apprentice.c,v 1.6 2012/02/22 17:53:51 christos Exp $);
+__RCSID($NetBSD: apprentice.c,v 1.7 2012/04/07 17:30:55 christos Exp $);
 #endif
 #endif	/* lint */
 
@@ -218,7 +218,7 @@ static const struct type_tbl_s {
 	{ XX(ledouble),	FILE_LEDOUBLE,		FILE_FMT_DOUBLE },
 	{ XX(leid3),		FILE_LEID3,		FILE_FMT_NUM },
 	{ XX(beid3),		FILE_BEID3,		FILE_FMT_NUM },
-	{ XX(indirect),	FILE_INDIRECT,		FILE_FMT_NONE },
+	{ XX(indirect),	FILE_INDIRECT,		FILE_FMT_NUM },
 	{ XX_NULL,		FILE_INVALID,		FILE_FMT_NONE },
 # undef XX
 # undef XX_NULL
@@ -477,6 +477,9 @@ apprentice_magic_strength(const struct m
 		val += 8 * MULT;
 		break;
 
+	case FILE_INDIRECT:
+		break;
+
 	default:
 		val = 0;
 		(void)fprintf(stderr, Bad type %d\n, m-type);

Index: src/external/bsd/file/dist/src/softmagic.c
diff -u src/external/bsd/file/dist/src/softmagic.c:1.5 src/external/bsd/file/dist/src/softmagic.c:1.6
--- src/external/bsd/file/dist/src/softmagic.c:1.5	Wed Feb 22 12:53:51 2012
+++ src/external/bsd/file/dist/src/softmagic.c	Sat Apr  7 13:30:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: softmagic.c,v 1.5 2012/02/22 17:53:51 christos Exp $	*/
+/*	$NetBSD: softmagic.c,v 1.6 2012/04/07 17:30:56 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $)
 #else
-__RCSID($NetBSD: softmagic.c,v 1.5 2012/02/22 17:53:51 christos Exp $);

CVS commit: src/external/bsd/file

2012-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 22 17:47:25 UTC 2012

Modified Files:
src/external/bsd/file: file2netbsd

Log Message:
fix wrong variable, import command


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/file2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/file2netbsd
diff -u src/external/bsd/file/file2netbsd:1.2 src/external/bsd/file/file2netbsd:1.3
--- src/external/bsd/file/file2netbsd:1.2	Sat Oct  8 15:28:39 2011
+++ src/external/bsd/file/file2netbsd	Wed Feb 22 12:47:25 2012
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: file2netbsd,v 1.2 2011/10/08 19:28:39 christos Exp $
+#	$NetBSD: file2netbsd,v 1.3 2012/02/22 17:47:25 christos Exp $
 #
 # Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,7 @@ file_vers=$(awk -F', ' '/AC_INIT\(/ { p
 find $FILE -name .cvsignore -delete
 
 ### Remove the $'s around RCS tags
-cleantags $d
+cleantags $FILE
 
 ### Add NetBSD RCS Id
 find $FILE -type f -name '*.[chly]' -print | while read c; do
@@ -99,6 +99,6 @@ wq' | ed Makefile.in  /dev/null 21
 echo done
 
 echo You can import now.  Use the following command:
-echo cvs import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
+echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
 
 exit 0



CVS commit: src/external/bsd/file/dist

2012-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 22 17:48:53 UTC 2012

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv4443

Log Message:
from ftp.astron.com, CDF security fixes

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_11

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
C src/external/bsd/file/dist/configure.ac
U src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/Makefile.am
U src/external/bsd/file/dist/Makefile.in
U src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
U src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
U src/external/bsd/file/dist/depcomp
C src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
U src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
U src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
U src/external/bsd/file/dist/src/readelf.c
C src/external/bsd/file/dist/src/print.c
U src/external/bsd/file/dist/src/fsmagic.c
C src/external/bsd/file/dist/src/funcs.c
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
C src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
C src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/apl
N src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
C src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/external/bsd/file/dist/magic/magdir/citrus
U src/external/bsd/file/dist/magic/magdir/clarion
U src/external/bsd/file/dist/magic/magdir/claris
U src/external/bsd/file/dist/magic/magdir/clipper
U src/external/bsd/file/dist/magic/magdir/commands
U src/external/bsd/file/dist/magic/magdir/filesystems
U src/external/bsd/file/dist/magic/magdir/compress
U 

CVS commit: src/external/bsd/file/dist

2012-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 22 17:53:52 UTC 2012

Modified Files:
src/external/bsd/file/dist: configure configure.ac install-sh
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive
src/external/bsd/file/dist/src: Makefile.in apprentice.c cdf.c
cdf_time.c compress.c file.h funcs.c print.c readcdf.c softmagic.c
Removed Files:
src/external/bsd/file/dist/src: names.h

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/configure
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/configure.ac
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/install-sh
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/file/dist/doc/libmagic.3
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/magic/Makefile.am
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/magic/magdir/archive
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/src/Makefile.in \
src/external/bsd/file/dist/src/compress.c \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/cdf_time.c \
src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/file/dist/src/names.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/readcdf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/configure
diff -u src/external/bsd/file/dist/configure:1.6 src/external/bsd/file/dist/configure:1.7
--- src/external/bsd/file/dist/configure:1.6	Sun Sep 25 14:18:43 2011
+++ src/external/bsd/file/dist/configure	Wed Feb 22 12:53:48 2012
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for file 5.09.
+# Generated by GNU Autoconf 2.68 for file 5.11.
 #
 # Report bugs to chris...@astron.com.
 #
@@ -698,8 +698,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='file'
 PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.09'
-PACKAGE_STRING='file 5.09'
+PACKAGE_VERSION='5.11'
+PACKAGE_STRING='file 5.11'
 PACKAGE_BUGREPORT='chris...@astron.com'
 PACKAGE_URL=''
 
@@ -1431,7 +1431,7 @@ if test $ac_init_help = long; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat _ACEOF
-\`configure' configures file 5.09 to adapt to many kinds of systems.
+\`configure' configures file 5.11 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1501,7 +1501,7 @@ fi
 
 if test -n $ac_init_help; then
   case $ac_init_help in
- short | recursive ) echo Configuration of file 5.09:;;
+ short | recursive ) echo Configuration of file 5.11:;;
esac
   cat \_ACEOF
 
@@ -1609,8 +1609,8 @@ fi
 test -n $ac_init_help  exit $ac_status
 if $ac_init_version; then
   cat \_ACEOF
-file configure 5.09
-generated by GNU Autoconf 2.64
+file configure 5.11
+generated by GNU Autoconf 2.68
 
 Copyright (C) 2009 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -2308,8 +2308,8 @@ cat config.log _ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by file $as_me 5.09, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+It was created by file $as_me 5.11, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -3116,7 +3116,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='file'
- VERSION='5.09'
+ VERSION='5.11'
 
 
 cat confdefs.h _ACEOF
@@ -13477,8 +13477,8 @@ cat $CONFIG_STATUS \_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log=
-This file was extended by file $as_me 5.09, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+This file was extended by file $as_me 5.11, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -13541,9 +13541,9 @@ Report bugs to chris...@astron.com.
 _ACEOF
 cat $CONFIG_STATUS _ACEOF || ac_write_fail=1
 ac_cs_version=\\
-file config.status 5.09
-configured by $0, generated by GNU Autoconf 2.64,
-  with options \\`$as_echo 

CVS commit: src/external/bsd/file/dist/magic/magdir

2012-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 22 18:25:12 UTC 2012

Modified Files:
src/external/bsd/file/dist/magic/magdir: elf

Log Message:
Look at the proper offsets for MD info, depending on the size of the binary
32 or 64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/file/dist/magic/magdir/elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/elf
diff -u src/external/bsd/file/dist/magic/magdir/elf:1.1.1.3 src/external/bsd/file/dist/magic/magdir/elf:1.2
--- src/external/bsd/file/dist/magic/magdir/elf:1.1.1.3	Wed Feb 22 12:48:32 2012
+++ src/external/bsd/file/dist/magic/magdir/elf	Wed Feb 22 13:25:12 2012
@@ -40,9 +40,10 @@
 18	leshort		2		SPARC - invalid byte order,
 18	leshort		3		Intel 80386,
 18	leshort		4		Motorola
-36	lelong		0x0100	68000 - invalid byte order,
-36	lelong		0x0081	CPU32 - invalid byte order,
-36	lelong		0		68020 - invalid byte order,
+4	byte		1
+36	lelong		0x0100	68000 - invalid byte order,
+36	lelong		0x0081	CPU32 - invalid byte order,
+36	lelong		0		68020 - invalid byte order,
 18	leshort		5		Motorola 88000 - invalid byte order,
 18	leshort		6		Intel 80486,
 18	leshort		7		Intel 80860,
@@ -50,9 +51,11 @@
 # The second number (#10) will be deprecated later. For now, we still
 # say something if #10 is encountered, but only gory details for #8.
 18	leshort		8		MIPS,
-36	lelong		0x20		N32
+4	byte		1
+36	lelong		0x20		N32
 18	leshort		10		MIPS,
-36	lelong		0x20		N32
+4	byte		1
+36	lelong		0x20		N32
 18	leshort		8
 # only for 32-bit
 4	byte		1
@@ -80,8 +83,14 @@
 18	leshort		10		MIPS (deprecated),
 18	leshort		11		RS6000 - invalid byte order,
 18	leshort		15		PA-RISC - invalid byte order,
-50	leshort		0x0214		2.0
-48	leshort		0x0008		(LP64),
+# only for 32-bit
+4	byte		1
+38	leshort		0x0214		2.0
+36	leshort		0x0008		(LP64)
+# only for 64-bit
+4	byte		2
+50	leshort		0x0214		2.0
+48	leshort		0x0008		(LP64)
 18	leshort		16		nCUBE,
 18	leshort		17		Fujitsu VPP500,
 18	leshort		18		SPARC32PLUS - invalid byte order,
@@ -157,7 +166,6 @@
 18	leshort		0x9026		Alpha (unofficial),
 20	lelong		0		invalid version
 20	lelong		1		version 1
-36	lelong		1		MathCoPro/FPU/MAU Required
 5	byte		2		MSB
 16	beshort		0		no file type,
 !:mime	application/octet-stream
@@ -177,17 +185,20 @@
 18	beshort		2		SPARC,
 18	beshort		3		Intel 80386 - invalid byte order,
 18	beshort		4		Motorola
-36	belong		0x0100	68000,
-36	belong		0x0081	CPU32,
-36	belong		0		68020,
+4	byte		1
+36	belong		0x0100	68000,
+36	belong		0x0081	CPU32,
+36	belong		0		68020,
 18	beshort		5		Motorola 88000,
 18	beshort		6		Intel 80486 - invalid byte order,
 18	beshort		7		Intel 80860,
 # only for MIPS - see comment in little-endian section above.
 18	beshort		8		MIPS,
-36	belong		0x20		N32
+4	byte		1
+36	belong		0x20		N32
 18	beshort		10		MIPS,
-36	belong		0x20		N32
+4	byte		1
+36	belong		0x20		N32
 18	beshort		8
 # only for 32-bit
 4	byte		1
@@ -215,15 +226,23 @@
 18	beshort		10		MIPS (deprecated),
 18	beshort		11		RS6000,
 18	beshort		15		PA-RISC
-50	beshort		0x0214		2.0
-48	beshort		0x0008		(LP64)
+# only for 32-bit
+4	byte		1
+38	beshort		0x0214		2.0
+36	beshort		0x0008		(LP64)
+# only for 64-bit
+4	byte		2
+50	beshort		0x0214		2.0
+48	beshort		0x0008		(LP64)
 18	beshort		16		nCUBE,
 18	beshort		17		Fujitsu VPP500,
 18	beshort		18		SPARC32PLUS,
-36	belong0x00	0x000100	V8+ Required,
-36	belong0x00	0x000200	Sun UltraSPARC1 Extensions Required,
-36	belong0x00	0x000400	HaL R1 Extensions Required,
-36	belong0x00	0x000800	Sun UltraSPARC3 Extensions Required,
+# only for 32-bit
+4	byte		1
+36	belong0x00	0x000100	V8+ Required,
+36	belong0x00	0x000200	Sun UltraSPARC1 Extensions Required,
+36	belong0x00	0x000400	HaL R1 Extensions Required,
+36	belong0x00	0x000800	Sun UltraSPARC3 Extensions Required,
 18	beshort		20		PowerPC or cisco 4500,
 18	beshort		21		64-bit PowerPC or cisco 7500,
 18	beshort		22		IBM S/390,
@@ -238,12 +257,13 @@
 18	beshort		41		Alpha,
 18	beshort		42		Renesas SH,
 18	beshort		43		SPARC V9,
-48	belong0x00	0x000200	Sun UltraSPARC1 Extensions Required,
-48	belong0x00	0x000400	HaL R1 Extensions Required,
-48	belong0x00	0x000800	Sun UltraSPARC3 Extensions Required,
-48	belong0x3	0		total store ordering,
-48	belong0x3	1		partial store ordering,
-48	belong0x3	2		relaxed memory ordering,
+4	byte		2
+48	belong0x00	0x000200	Sun UltraSPARC1 Extensions Required,
+48	belong0x00	0x000400	HaL R1 Extensions Required,
+48	belong0x00	0x000800	Sun UltraSPARC3 Extensions Required,
+48	belong0x3	0		total store ordering,
+48	belong0x3	1		partial store ordering,
+48	belong0x3	2		relaxed memory ordering,
 18	beshort		44		Siemens Tricore Embedded Processor,
 18	beshort		45		Argonaut RISC Core, Argonaut Technologies Inc.,
 18	beshort		46		Renesas H8/300,
@@ -268,9 +288,10 

CVS commit: src/external/bsd/file/dist/doc

2011-11-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 10 13:41:01 UTC 2011

Modified Files:
src/external/bsd/file/dist/doc: libmagic.3

Log Message:
PR/45595: bch: fix missing magic prefix


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/doc/libmagic.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/libmagic.3
diff -u src/external/bsd/file/dist/doc/libmagic.3:1.8 src/external/bsd/file/dist/doc/libmagic.3:1.9
--- src/external/bsd/file/dist/doc/libmagic.3:1.8	Mon Oct  3 11:43:55 2011
+++ src/external/bsd/file/dist/doc/libmagic.3	Thu Nov 10 08:41:00 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: libmagic.3,v 1.8 2011/10/03 15:43:55 njoly Exp $
+.\	$NetBSD: libmagic.3,v 1.9 2011/11/10 13:41:00 christos Exp $
 .\
 .\ $File: libmagic.man,v 1.24 2011/05/13 22:11:44 christos Exp $
 .\
@@ -128,7 +128,7 @@ Don't get extra information on MS Compos
 Don't look inside compressed files.
 .It Dv MAGIC_NO_CHECK_ELF
 Don't print ELF details.
-.It Dv NO_CHECK_ENCODING
+.It Dv MAGIC_NO_CHECK_ENCODING
 Don't check text encodings.
 .It Dv MAGIC_NO_CHECK_SOFT
 Don't consult magic files.



CVS commit: src/external/bsd/file/include

2011-10-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 31 20:52:15 UTC 2011

Modified Files:
src/external/bsd/file/include: config.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/file/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/include/config.h
diff -u src/external/bsd/file/include/config.h:1.1 src/external/bsd/file/include/config.h:1.2
--- src/external/bsd/file/include/config.h:1.1	Fri May  8 13:28:02 2009
+++ src/external/bsd/file/include/config.h	Mon Oct 31 16:52:14 2011
@@ -1,4 +1,3 @@
-/*	$NetBSD: config.h,v 1.1 2009/05/08 17:28:02 christos Exp $	*/
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
@@ -14,6 +13,14 @@
 /* HAVE_DAYLIGHT */
 #define HAVE_DAYLIGHT 1
 
+/* Define to 1 if you have the declaration of `daylight', and to 0 if you
+   don't. */
+#define HAVE_DECL_DAYLIGHT 1
+
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+   */
+#define HAVE_DECL_TZNAME 1
+
 /* Define to 1 if you have the dlfcn.h header file. */
 #define HAVE_DLFCN_H 1
 
@@ -23,9 +30,15 @@
 /* Define to 1 if you have the fcntl.h header file. */
 #define HAVE_FCNTL_H 1
 
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #define HAVE_FSEEKO 1
 
+/* Define to 1 if you have the `getline' function. */
+#define HAVE_GETLINE 1
+
 /* Define to 1 if you have the getopt.h header file. */
 #define HAVE_GETOPT_H 1
 
@@ -41,6 +54,9 @@
 /* Define to 1 if you have the inttypes.h header file. */
 #define HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have the `gnurx' library (-lgnurx). */
+/* #undef HAVE_LIBGNURX */
+
 /* Define to 1 if you have the `z' library (-lz). */
 #define HAVE_LIBZ 1
 
@@ -65,6 +81,9 @@
 /* Define to 1 if you have the `mmap' function. */
 #define HAVE_MMAP 1
 
+/* Define to 1 if the system has the type `pid_t'. */
+#define HAVE_PID_T 1
+
 /* Define to 1 if you have the stdint.h header file. */
 #define HAVE_STDINT_H 1
 
@@ -98,13 +117,13 @@
 /* HAVE_STRUCT_OPTION */
 #define HAVE_STRUCT_OPTION 1
 
-/* Define to 1 if `st_rdev' is member of `struct stat'. */
+/* Define to 1 if `struct stat' is a member of `st_rdev'. */
 #define HAVE_STRUCT_STAT_ST_RDEV 1
 
-/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
+/* Define to 1 if `struct tm' is a member of `tm_gmtoff'. */
 #define HAVE_STRUCT_TM_TM_GMTOFF 1
 
-/* Define to 1 if `tm_zone' is member of `struct tm'. */
+/* Define to 1 if `struct tm' is a member of `tm_zone'. */
 #define HAVE_STRUCT_TM_TM_ZONE 1
 
 /* Define to 1 if you have the sys/mman.h header file. */
@@ -173,6 +192,10 @@
 /* Define to 1 if you have the zlib.h header file. */
 #define HAVE_ZLIB_H 1
 
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR .libs/
+
 /* Define to 1 if `major', `minor', and `makedev' are declared in mkdev.h.
*/
 /* #undef MAJOR_IN_MKDEV */
@@ -194,13 +217,16 @@
 #define PACKAGE_NAME file
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING file 5.03
+#define PACKAGE_STRING file 5.09
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME file
 
+/* Define to the home page for this package. */
+#define PACKAGE_URL 
+
 /* Define to the version of this package. */
-#define PACKAGE_VERSION 5.03
+#define PACKAGE_VERSION 5.09
 
 /* The size of `long long', as computed by sizeof. */
 #define SIZEOF_LONG_LONG 8
@@ -211,16 +237,33 @@
 /* Define to 1 if your sys/time.h declares `struct tm'. */
 /* #undef TM_IN_SYS_TIME */
 
-/* Version number of package */
-#define VERSION 5.03
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef _FILE_OFFSET_BITS */
-
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Version number of package */
+#define VERSION 5.09
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
 
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
 /* #undef _LARGEFILE_SOURCE */
@@ -228,6 +271,16 @@
 /* Define for large files, on AIX-style hosts. */
 /* #undef _LARGE_FILES */
 
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if 

CVS commit: src/external/bsd/file/dist/doc

2011-10-03 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Oct  3 15:43:55 UTC 2011

Modified Files:
src/external/bsd/file/dist/doc: libmagic.3

Log Message:
Fix magic_descriptor/magic_file quoting in SYNOPSIS.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/file/dist/doc/libmagic.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/libmagic.3
diff -u src/external/bsd/file/dist/doc/libmagic.3:1.7 src/external/bsd/file/dist/doc/libmagic.3:1.8
--- src/external/bsd/file/dist/doc/libmagic.3:1.7	Fri Sep 16 21:06:25 2011
+++ src/external/bsd/file/dist/doc/libmagic.3	Mon Oct  3 15:43:55 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: libmagic.3,v 1.7 2011/09/16 21:06:25 christos Exp $
+.\	$NetBSD: libmagic.3,v 1.8 2011/10/03 15:43:55 njoly Exp $
 .\
 .\ $File: libmagic.man,v 1.24 2011/05/13 22:11:44 christos Exp $
 .\
@@ -54,9 +54,9 @@
 .Ft int
 .Fn magic_errno magic_t cookie
 .Ft const char *
-.Fn magic_descriptor magic_t cookie, int fd
+.Fn magic_descriptor magic_t cookie int fd
 .Ft const char *
-.Fn magic_file magic_t cookie, const char *filename
+.Fn magic_file magic_t cookie const char *filename
 .Ft const char *
 .Fn magic_buffer magic_t cookie const void *buffer size_t length
 .Ft int



CVS commit: src/external/bsd/file/dist/src

2011-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 28 13:50:09 UTC 2011

Modified Files:
src/external/bsd/file/dist/src: readcdf.c

Log Message:
fix cdf mime output on cdf files (from file HEAD)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/readcdf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/readcdf.c
diff -u src/external/bsd/file/dist/src/readcdf.c:1.5 src/external/bsd/file/dist/src/readcdf.c:1.6
--- src/external/bsd/file/dist/src/readcdf.c:1.5	Sat Sep 17 06:46:52 2011
+++ src/external/bsd/file/dist/src/readcdf.c	Wed Sep 28 09:50:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $	*/
+/*	$NetBSD: readcdf.c,v 1.6 2011/09/28 13:50:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 Christos Zoulas
@@ -31,7 +31,7 @@
 #if 0
 FILE_RCSID(@(#)$File: readcdf.c,v 1.26 2011/08/26 13:38:28 christos Exp $)
 #else
-__RCSID($NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $);
+__RCSID($NetBSD: readcdf.c,v 1.6 2011/09/28 13:50:09 christos Exp $);
 #endif
 #endif
 
@@ -154,6 +154,9 @@ cdf_file_property_info(struct magic_set 
 if (!NOTMIME(ms)) {
 		if (str == NULL)
 			return 0;
+		if (file_printf(ms, application/%s, str) == -1)
+			return -1;
+
 }
 return 1;
 }



CVS commit: src/external/bsd/file/dist/magic/magdir

2011-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 28 13:50:52 UTC 2011

Modified Files:
src/external/bsd/file/dist/magic/magdir: archive

Log Message:
comment out weak magic, from file HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/magic/magdir/archive

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/archive
diff -u src/external/bsd/file/dist/magic/magdir/archive:1.4 src/external/bsd/file/dist/magic/magdir/archive:1.5
--- src/external/bsd/file/dist/magic/magdir/archive:1.4	Fri Sep 16 17:06:25 2011
+++ src/external/bsd/file/dist/magic/magdir/archive	Wed Sep 28 09:50:52 2011
@@ -183,7 +183,7 @@
 # MAR
 2	string	=-ah MAR archive data
 # ACB
-0	belong0x00f800ff	0x0080 ACB archive data
+#0	belong0x00f800ff	0x0080 ACB archive data
 # CPZ
 # TODO, this is what idarc says: 0	string	\0\0\0 CPZ archive data
 # JRC



CVS commit: src/external/bsd/file/dist/src

2011-09-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Sep 17 10:46:52 UTC 2011

Modified Files:
src/external/bsd/file/dist/src: readcdf.c

Log Message:
Define __arraycount if it doesn't exist.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/src/readcdf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/readcdf.c
diff -u src/external/bsd/file/dist/src/readcdf.c:1.4 src/external/bsd/file/dist/src/readcdf.c:1.5
--- src/external/bsd/file/dist/src/readcdf.c:1.4	Fri Sep 16 21:06:27 2011
+++ src/external/bsd/file/dist/src/readcdf.c	Sat Sep 17 10:46:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: readcdf.c,v 1.4 2011/09/16 21:06:27 christos Exp $	*/
+/*	$NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 Christos Zoulas
@@ -31,7 +31,7 @@
 #if 0
 FILE_RCSID(@(#)$File: readcdf.c,v 1.26 2011/08/26 13:38:28 christos Exp $)
 #else
-__RCSID($NetBSD: readcdf.c,v 1.4 2011/09/16 21:06:27 christos Exp $);
+__RCSID($NetBSD: readcdf.c,v 1.5 2011/09/17 10:46:52 joerg Exp $);
 #endif
 #endif
 
@@ -44,6 +44,10 @@
 #include cdf.h
 #include magic.h
 
+#ifndef __arraycount
+#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
 #define NOTMIME(ms) (((ms)-flags  MAGIC_MIME) == 0)
 
 private int



CVS commit: src/external/bsd/file/dist

2011-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 16 20:38:02 UTC 2011

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28841

Log Message:
from ftp.astron.com:
- elf seeking fixes
- improvements in cdf parsing
- waitpid only for our child
- magic fixes and additions

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_09

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
C src/external/bsd/file/dist/configure.ac
C src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/Makefile.in
C src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
C src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
C src/external/bsd/file/dist/compile
C src/external/bsd/file/dist/config.guess
C src/external/bsd/file/dist/config.sub
C src/external/bsd/file/dist/depcomp
C src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
C src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
C src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
C src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
U src/external/bsd/file/dist/src/funcs.c
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/names.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
C src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/apl
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/applix
C src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/encore
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/external/bsd/file/dist/magic/magdir/citrus
U src/external/bsd/file/dist/magic/magdir/clarion
U src/external/bsd/file/dist/magic/magdir/claris
U src/external/bsd/file/dist/magic/magdir/clipper
U src/external/bsd/file/dist/magic/magdir/commands
U src/external/bsd/file/dist/magic/magdir/communications
U 

CVS commit: src/external/bsd/file

2011-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 16 20:38:12 UTC 2011

Added Files:
src/external/bsd/file: file2netbsd

Log Message:
restore from the dead.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/file/file2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/bsd/file/file2netbsd
diff -u /dev/null src/external/bsd/file/file2netbsd:1.1
--- /dev/null	Fri Sep 16 16:38:12 2011
+++ src/external/bsd/file/file2netbsd	Fri Sep 16 16:38:12 2011
@@ -0,0 +1,113 @@
+#! /bin/sh
+#
+#	$NetBSD: file2netbsd,v 1.1 2011/09/16 20:38:12 christos Exp $
+#
+# Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# file2netbsd:  convert a file source tree into a
+# format suitable for import.  Works on current dir.
+# You can run this only once if you want it to work.
+#
+# based on texinfo2netbsd
+#
+PROG=$(basename $0)
+
+if [ -z $1 ]
+then
+	echo Usage: $PROG directory 12
+	exit 1
+fi
+FILE=$1
+
+file_vers=$(awk -F', ' '/AC_INIT\(/ { print $2 }' $FILE/configure.ac)
+
+### Wipe out stuff we don't want
+find $FILE -name .cvsignore -delete
+
+### Remove the $'s around RCS tags
+find $FILE -type f -print | xargs egrep -l '\$(Id|Date|Header|Log|Revision)'\
+| while read f; do
+	sed -e 's/\$\(Id.*\) \$/\1/' \
+	-e 's/\$\(Date.*\) \$/\1/' \
+	-e 's/\$\(Header.*\) \$/\1/' \
+	-e 's/\$\(Log.*\) \$/\1/' \
+	-e 's/\$\(Revision.*\) \$/\1/' \
+	$f  /tmp/file2$$  mv /tmp/file2$$ $f  \
+	echo removed RCS tag from $f
+done
+
+### Add NetBSD RCS Id
+find $FILE -type f -name '*.[chly]' -print | while read c; do
+	sed -e '1{/$NetBSD/!{i\
+/*	\$NetBSD\$	*/\
+
+};}
+/#ifndef[ 	]lint/{N;/FILE_RCSID/s/\n/\
+#if 0\
+/
+a\
+#else\
+__RCSID(\$NetBSD\$);\
+#endif
+}' $c  /tmp/file3$$
+mv /tmp/file3$$ $c  echo did source mods for $c
+done
+
+ Move files to proper names
+mv -f doc/file.man doc/file.1
+mv -f doc/libmagic.man doc/libmagic.3
+mv -f doc/magic.man doc/magic.5
+
+ Add RCS tags to man pages
+find $FILE -type f -name '*.[0-9]' -print | while read m; do
+	sed -e '1{/$NetBSD/!i\
+.\\	\$NetBSD\$\
+.\\
+
+}'	-e 's/__CSECTION__/1/g' \
+	-e 's/__FSECTION__/5/g' \
+	-e 's/__VERSION__/'${file_vers}/g \
+	-e 's,__MAGIC__,/usr/share/misc/magic,g' \
+	$m  /tmp/file4$$
+mv /tmp/file4$$ $m  echo did manpage mods for $m
+done
+
+ de-capsize the magdir
+mv magic/Magdir magic/magdir
+
+ Make building easier, don't build magic and doc
+echo '/^SUBDIRS/
+t.
+s/^/#/
+-
+s/ magic.*//
+wq' | ed Makefile.in  /dev/null 21
+
+echo done
+
+echo You can import now.  Use the following command:
+echo cvs import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
+
+exit 0



CVS commit: src/external/bsd/file

2011-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 14 09:06:12 UTC 2011

Modified Files:
src/external/bsd/file/dist/src: fsmagic.c print.c
src/external/bsd/file/lib: Makefile

Log Message:
fix non-literal strings where they are not needed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/fsmagic.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/src/print.c
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/file/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/fsmagic.c
diff -u src/external/bsd/file/dist/src/fsmagic.c:1.3 src/external/bsd/file/dist/src/fsmagic.c:1.4
--- src/external/bsd/file/dist/src/fsmagic.c:1.3	Thu May 12 21:52:13 2011
+++ src/external/bsd/file/dist/src/fsmagic.c	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsmagic.c,v 1.3 2011/05/13 01:52:13 christos Exp $	*/
+/*	$NetBSD: fsmagic.c,v 1.4 2011/08/14 09:06:12 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: fsmagic.c,v 1.62 2010/09/20 20:16:08 rrt Exp $)
 #else
-__RCSID($NetBSD: fsmagic.c,v 1.3 2011/05/13 01:52:13 christos Exp $);
+__RCSID($NetBSD: fsmagic.c,v 1.4 2011/08/14 09:06:12 christos Exp $);
 #endif
 #endif	/* lint */
 
@@ -69,22 +69,18 @@
 private int
 bad_link(struct magic_set *ms, int err, char *buf)
 {
-	const char *errfmt;
 	int mime = ms-flags  MAGIC_MIME;
 	if ((mime  MAGIC_MIME_TYPE) 
 	file_printf(ms, application/x-symlink)
 	== -1)
 		return -1;
 	else if (!mime) {
-		if (err == ELOOP)
-			errfmt = symbolic link in a loop;
-		else
-			errfmt = broken symbolic link to `%s';
 		if (ms-flags  MAGIC_ERROR) {
-			file_error(ms, err, errfmt, buf);
+			file_error(ms, err,
+			broken symbolic link to `%s', buf);
 			return -1;
 		} 
-		if (file_printf(ms, errfmt, buf) == -1)
+		if (file_printf(ms, broken symbolic link to `%s', buf) == -1)
 			return -1;
 	}
 	return 1;

Index: src/external/bsd/file/dist/src/print.c
diff -u src/external/bsd/file/dist/src/print.c:1.1.1.2 src/external/bsd/file/dist/src/print.c:1.2
--- src/external/bsd/file/dist/src/print.c:1.1.1.2	Thu May 12 16:46:53 2011
+++ src/external/bsd/file/dist/src/print.c	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.1.1.2 2011/05/12 20:46:53 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.2 2011/08/14 09:06:12 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: print.c,v 1.69 2010/07/21 16:47:18 christos Exp $)
 #else
-__RCSID($NetBSD: print.c,v 1.1.1.2 2011/05/12 20:46:53 christos Exp $);
+__RCSID($NetBSD: print.c,v 1.2 2011/08/14 09:06:12 christos Exp $);
 #endif
 #endif  /* lint */
 
@@ -58,7 +58,7 @@
 	private const char optyp[] = { FILE_OPS };
 
 	(void) fprintf(stderr, [%u, m-lineno);
-	(void) fprintf(stderr,  %u + 8 - (m-cont_level  7),
+	(void) fprintf(stderr, %.*s %u, (m-cont_level  7) + 1, ,
 		   m-offset);
 
 	if (m-flag  INDIR) {

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.1 src/external/bsd/file/lib/Makefile:1.2
--- src/external/bsd/file/lib/Makefile:1.1	Fri May  8 13:28:02 2009
+++ src/external/bsd/file/lib/Makefile	Sun Aug 14 05:06:12 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/05/08 17:28:02 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/14 09:06:12 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -32,4 +32,6 @@
 INCS=		magic.h
 INCSDIR=	/usr/include
 
+COPTS.softmagic.c = -Wno-format-nonliteral
+
 .include bsd.lib.mk



CVS commit: src/external/bsd/file/dist/src

2011-06-23 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jun 23 16:12:36 UTC 2011

Modified Files:
src/external/bsd/file/dist/src: apprentice.c

Log Message:
Remove a noisy debugging printf that triggers on bigendian platforms.
(Reported upstream as well)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/apprentice.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.3 src/external/bsd/file/dist/src/apprentice.c:1.4
--- src/external/bsd/file/dist/src/apprentice.c:1.3	Fri May 13 01:52:13 2011
+++ src/external/bsd/file/dist/src/apprentice.c	Thu Jun 23 16:12:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.3 2011/05/13 01:52:13 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.4 2011/06/23 16:12:36 riz Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: apprentice.c,v 1.169 2011/05/10 17:08:13 christos Exp $)
 #else
-__RCSID($NetBSD: apprentice.c,v 1.3 2011/05/13 01:52:13 christos Exp $);
+__RCSID($NetBSD: apprentice.c,v 1.4 2011/06/23 16:12:36 riz Exp $);
 #endif
 #endif	/* lint */
 
@@ -2472,8 +2472,6 @@
 	m-in_offset = swap4((uint32_t)m-in_offset);
 	m-lineno = swap4((uint32_t)m-lineno);
 	if (IS_STRING(m-type)) {
-		if (m-type == FILE_PSTRING)
-			printf(flags! %d\n, m-str_flags);
 		m-str_range = swap4(m-str_range);
 		m-str_flags = swap4(m-str_flags);
 	}



CVS commit: src/external/bsd/file/dist/doc

2011-05-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 13 21:15:34 UTC 2011

Modified Files:
src/external/bsd/file/dist/doc: file.1

Log Message:
remove dup code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/doc/file.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/file.1
diff -u src/external/bsd/file/dist/doc/file.1:1.6 src/external/bsd/file/dist/doc/file.1:1.7
--- src/external/bsd/file/dist/doc/file.1:1.6	Thu May 12 21:52:13 2011
+++ src/external/bsd/file/dist/doc/file.1	Fri May 13 17:15:34 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: file.1,v 1.6 2011/05/13 01:52:13 christos Exp $
+.\	$NetBSD: file.1,v 1.7 2011/05/13 21:15:34 christos Exp $
 .\
 .\ $File: file.man,v 1.94 2011/04/20 19:08:44 christos Exp $
 .Dd April 20, 2011
@@ -166,14 +166,6 @@
 .Dq data .
 .Sh OPTIONS
 .Bl -tag -width indent
-.It Fl 0 , Fl Fl print0
-Output a null character
-.Sq \e0
-after the end of the filename.
-Nice to
-.Xr cut 1
-the output.
-This does not affect the separator which is still printed.
 .It Fl b , Fl Fl brief
 Do not prepend filenames to output lines (brief mode).
 .It Fl C , Fl Fl compile
@@ -373,48 +365,6 @@
 and
 .Fl h
 options.
-.Sh FILES
-.Bl -tag -width /usr/share/misc/magic.mgc -compact
-.It Pa /usr/share/misc/magic.mgc
-Default compiled list of magic.
-.It Pa /usr/share/misc/magic
-Directory containing default magic files.
-.El
-.Sh EXIT STATUS
-.Ex -std
-.Sh EXAMPLES
-.Bd -literal -offset indent
-$ file file.c file /dev/{wd0a,hda}
-file.c:   C program text
-file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
-	  dynamically linked (uses shared libs), stripped
-/dev/wd0a: block special (0/0)
-/dev/hda: block special (3/0)
-
-$ file -s /dev/wd0{b,d}
-/dev/wd0b: data
-/dev/wd0d: x86 boot sector
-
-$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10}
-/dev/hda:   x86 boot sector
-/dev/hda1:  Linux/i386 ext2 filesystem
-/dev/hda2:  x86 boot sector
-/dev/hda3:  x86 boot sector, extended partition table
-/dev/hda4:  Linux/i386 ext2 filesystem
-/dev/hda5:  Linux/i386 swap file
-/dev/hda6:  Linux/i386 swap file
-/dev/hda7:  Linux/i386 swap file
-/dev/hda8:  Linux/i386 swap file
-/dev/hda9:  empty
-/dev/hda10: empty
-
-$ file -i file.c file /dev/{wd0a,hda}
-file.c:  text/x-c
-file:application/x-executable
-/dev/hda:application/x-not-regular-file
-/dev/wd0a:   application/x-not-regular-file
-
-.Ed
 .Sh SEE ALSO
 .Xr hexdump 1 ,
 .Xr od 1 ,



CVS commit: src/external/bsd/file/dist

2011-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 12 20:47:16 UTC 2011

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv6051

Log Message:
from ftp.astron.com.
- many security related fixes
- no MAXPATHLEN limits
- fixed missing text specification on ascii magic
- new ``pascal'' style string formats
- whitespace comparison fix
- more magic

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_07

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
U src/external/bsd/file/dist/configure.ac
U src/external/bsd/file/dist/aclocal.m4
C src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/Makefile.in
U src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
U src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
U src/external/bsd/file/dist/depcomp
U src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
U src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
N src/external/bsd/file/dist/m4/lt~obsolete.m4
N src/external/bsd/file/dist/m4/libtool.m4
N src/external/bsd/file/dist/m4/ltoptions.m4
N src/external/bsd/file/dist/m4/ltsugar.m4
N src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/Makefile.am
U src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
U src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/asprintf.c
N src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
C src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
U src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
C src/external/bsd/file/dist/src/funcs.c
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/names.h
U src/external/bsd/file/dist/src/readelf.h
U src/external/bsd/file/dist/src/tar.h
C src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
U src/external/bsd/file/dist/src/mygetopt.h
C src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/apl
U src/external/bsd/file/dist/magic/magdir/cddb
U src/external/bsd/file/dist/magic/magdir/applix
C src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
N src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
N src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/cad
U src/external/bsd/file/dist/magic/magdir/cafebabe
U src/external/bsd/file/dist/magic/magdir/encore
U src/external/bsd/file/dist/magic/magdir/efi
U src/external/bsd/file/dist/magic/magdir/chord
U src/external/bsd/file/dist/magic/magdir/cisco
U src/external/bsd/file/dist/magic/magdir/citrus
U src/external/bsd/file/dist/magic/magdir/clarion
U src/external/bsd/file/dist/magic/magdir/claris
U src/external/bsd/file/dist/magic/magdir/clipper
U src/external/bsd/file/dist/magic/magdir/commands
U 

CVS commit: src/external/bsd/file

2011-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 13 01:52:13 UTC 2011

Modified Files:
src/external/bsd/file/dist: Makefile.am Makefile.in configure
src/external/bsd/file/dist/doc: file.1 libmagic.3 magic.5
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive diff filesystems os9
src/external/bsd/file/dist/src: apprentice.c cdf.c cdf_time.c
compress.c file.h fsmagic.c funcs.c magic.c readcdf.c readelf.c
softmagic.c
src/external/bsd/file/lib: shlib_version
Removed Files:
src/external/bsd/file/dist: file2netbsd
src/external/bsd/file/dist/magic/magdir: alpha psion
src/external/bsd/file/dist/python: py_magic.c py_magic.h
src/external/bsd/file/dist/src: patchlevel.h

Log Message:
resolve conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/Makefile.am \
src/external/bsd/file/dist/Makefile.in \
src/external/bsd/file/dist/configure
cvs rdiff -u -r1.2 -r0 src/external/bsd/file/dist/file2netbsd
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/doc/file.1 \
src/external/bsd/file/dist/doc/libmagic.3
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/dist/doc/magic.5
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/Makefile.am \
src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/file/dist/magic/magdir/alpha \
src/external/bsd/file/dist/magic/magdir/psion
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/magic/magdir/archive \
src/external/bsd/file/dist/magic/magdir/diff \
src/external/bsd/file/dist/magic/magdir/os9
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/magic/magdir/filesystems
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/file/dist/python/py_magic.c \
src/external/bsd/file/dist/python/py_magic.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/cdf_time.c \
src/external/bsd/file/dist/src/compress.c \
src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/magic.c \
src/external/bsd/file/dist/src/readcdf.c \
src/external/bsd/file/dist/src/readelf.c \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/file.h
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/file/dist/src/patchlevel.h
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/external/bsd/file/dist/doc

2009-11-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Nov 24 14:07:30 UTC 2009

Modified Files:
src/external/bsd/file/dist/doc: libmagic.3

Log Message:
Make Dt match installed file name.
Addresses that part of misc/42349 that applies on -current.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/doc/libmagic.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/libmagic.3
diff -u src/external/bsd/file/dist/doc/libmagic.3:1.3 src/external/bsd/file/dist/doc/libmagic.3:1.4
--- src/external/bsd/file/dist/doc/libmagic.3:1.3	Fri May  8 20:26:48 2009
+++ src/external/bsd/file/dist/doc/libmagic.3	Tue Nov 24 14:07:30 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: libmagic.3,v 1.3 2009/05/08 20:26:48 wiz Exp $
+.\	$NetBSD: libmagic.3,v 1.4 2009/11/24 14:07:30 wiz Exp $
 .\
 .\ $File: libmagic.man,v 1.19 2008/10/06 20:16:04 christos Exp $
 .\
@@ -28,7 +28,7 @@
 .\ SUCH DAMAGE.
 .\
 .Dd October 6, 2008
-.Dt MAGIC 3
+.Dt LIBMAGIC 3
 .Os
 .Sh NAME
 .Nm magic_open ,



CVS commit: src/external/bsd/file/dist/magic/magdir

2009-09-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep 13 22:16:45 UTC 2009

Modified Files:
src/external/bsd/file/dist/magic/magdir: diff

Log Message:
Recognize bsdiff(1) files.
Patch already sent upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/magic/magdir/diff

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/diff
diff -u src/external/bsd/file/dist/magic/magdir/diff:1.1.1.1 src/external/bsd/file/dist/magic/magdir/diff:1.2
--- src/external/bsd/file/dist/magic/magdir/diff:1.1.1.1	Fri May  8 16:35:08 2009
+++ src/external/bsd/file/dist/magic/magdir/diff	Sun Sep 13 22:16:45 2009
@@ -12,3 +12,8 @@
 
 0	search/1	Index:		RCS/CVS diff output text
 !:mime	text/x-diff
+#
+#--
+# bsdiff:  file(1) magic for bsdiff(1) output
+#
+0	string		BSDIFF40	bsdiff(1) patch file



CVS commit: src/external/bsd/file/dist/src

2009-05-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 15 12:06:09 UTC 2009

Modified Files:
src/external/bsd/file/dist/src: file.h

Log Message:
define __RCSID if nobody did.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/src/file.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/file.h
diff -u src/external/bsd/file/dist/src/file.h:1.2 src/external/bsd/file/dist/src/file.h:1.3
--- src/external/bsd/file/dist/src/file.h:1.2	Fri May  8 13:28:01 2009
+++ src/external/bsd/file/dist/src/file.h	Fri May 15 08:06:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.2 2009/05/08 17:28:01 christos Exp $	*/
+/*	$NetBSD: file.h,v 1.3 2009/05/15 12:06:09 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -448,5 +448,8 @@
 #else
 #define FILE_RCSID(id)
 #endif
+#ifndef __RCSID
+#define __RCSID(a)
+#endif
 
 #endif /* __file_h__ */



CVS commit: src/external/bsd/file/dist

2009-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  8 16:35:10 UTC 2009

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv14862

Log Message:
from ftp.astron.com

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_03

N src/external/bsd/file/dist/acinclude.m4
N src/external/bsd/file/dist/README
N src/external/bsd/file/dist/configure.ac
N src/external/bsd/file/dist/aclocal.m4
N src/external/bsd/file/dist/Makefile.am
N src/external/bsd/file/dist/Makefile.in
N src/external/bsd/file/dist/config.h.in
N src/external/bsd/file/dist/configure
N src/external/bsd/file/dist/AUTHORS
N src/external/bsd/file/dist/COPYING
N src/external/bsd/file/dist/ChangeLog
N src/external/bsd/file/dist/INSTALL
N src/external/bsd/file/dist/NEWS
N src/external/bsd/file/dist/TODO
N src/external/bsd/file/dist/compile
N src/external/bsd/file/dist/config.guess
N src/external/bsd/file/dist/config.sub
N src/external/bsd/file/dist/depcomp
N src/external/bsd/file/dist/install-sh
N src/external/bsd/file/dist/ltmain.sh
N src/external/bsd/file/dist/missing
N src/external/bsd/file/dist/MAINT
N src/external/bsd/file/dist/file2netbsd
N src/external/bsd/file/dist/src/Makefile.am
N src/external/bsd/file/dist/src/magic.h
N src/external/bsd/file/dist/src/getopt_long.c
N src/external/bsd/file/dist/src/Makefile.in
N src/external/bsd/file/dist/src/asprintf.c
N src/external/bsd/file/dist/src/apptype.c
N src/external/bsd/file/dist/src/strlcat.c
N src/external/bsd/file/dist/src/strlcpy.c
N src/external/bsd/file/dist/src/vasprintf.c
N src/external/bsd/file/dist/src/magic.c
N src/external/bsd/file/dist/src/apprentice.c
N src/external/bsd/file/dist/src/softmagic.c
N src/external/bsd/file/dist/src/ascmagic.c
N src/external/bsd/file/dist/src/encoding.c
N src/external/bsd/file/dist/src/compress.c
N src/external/bsd/file/dist/src/is_tar.c
N src/external/bsd/file/dist/src/readelf.c
N src/external/bsd/file/dist/src/print.c
N src/external/bsd/file/dist/src/fsmagic.c
N src/external/bsd/file/dist/src/funcs.c
N src/external/bsd/file/dist/src/file.h
N src/external/bsd/file/dist/src/names.h
N src/external/bsd/file/dist/src/patchlevel.h
N src/external/bsd/file/dist/src/readelf.h
N src/external/bsd/file/dist/src/tar.h
N src/external/bsd/file/dist/src/file_opts.h
N src/external/bsd/file/dist/src/elfclass.h
N src/external/bsd/file/dist/src/mygetopt.h
N src/external/bsd/file/dist/src/cdf.c
N src/external/bsd/file/dist/src/cdf_time.c
N src/external/bsd/file/dist/src/readcdf.c
N src/external/bsd/file/dist/src/cdf.h
N src/external/bsd/file/dist/src/file.c
N src/external/bsd/file/dist/magic/Makefile.am
N src/external/bsd/file/dist/magic/Makefile.in
N src/external/bsd/file/dist/magic/Header
N src/external/bsd/file/dist/magic/Localstuff
N src/external/bsd/file/dist/magic/magdir/adventure
N src/external/bsd/file/dist/magic/magdir/acorn
N src/external/bsd/file/dist/magic/magdir/adi
N src/external/bsd/file/dist/magic/magdir/animation
N src/external/bsd/file/dist/magic/magdir/allegro
N src/external/bsd/file/dist/magic/magdir/alliant
N src/external/bsd/file/dist/magic/magdir/alpha
N src/external/bsd/file/dist/magic/magdir/amanda
N src/external/bsd/file/dist/magic/magdir/amigaos
N src/external/bsd/file/dist/magic/magdir/apple
N src/external/bsd/file/dist/magic/magdir/apl
N src/external/bsd/file/dist/magic/magdir/communications
N src/external/bsd/file/dist/magic/magdir/applix
N src/external/bsd/file/dist/magic/magdir/archive
N src/external/bsd/file/dist/magic/magdir/asterix
N src/external/bsd/file/dist/magic/magdir/att3b
N src/external/bsd/file/dist/magic/magdir/audio
N src/external/bsd/file/dist/magic/magdir/basis
N src/external/bsd/file/dist/magic/magdir/bflt
N src/external/bsd/file/dist/magic/magdir/blender
N src/external/bsd/file/dist/magic/magdir/blit
N src/external/bsd/file/dist/magic/magdir/bout
N src/external/bsd/file/dist/magic/magdir/bsdi
N src/external/bsd/file/dist/magic/magdir/btsnoop
N src/external/bsd/file/dist/magic/magdir/c-lang
N src/external/bsd/file/dist/magic/magdir/c64
N src/external/bsd/file/dist/magic/magdir/cad
N src/external/bsd/file/dist/magic/magdir/cafebabe
N src/external/bsd/file/dist/magic/magdir/cddb
N src/external/bsd/file/dist/magic/magdir/chord
N src/external/bsd/file/dist/magic/magdir/cisco
N src/external/bsd/file/dist/magic/magdir/efi
N src/external/bsd/file/dist/magic/magdir/citrus
N src/external/bsd/file/dist/magic/magdir/clarion
N src/external/bsd/file/dist/magic/magdir/claris
N src/external/bsd/file/dist/magic/magdir/clipper
N src/external/bsd/file/dist/magic/magdir/commands
N src/external/bsd/file/dist/magic/magdir/filesystems
N src/external/bsd/file/dist/magic/magdir/compress
N src/external/bsd/file/dist/magic/magdir/console
N src/external/bsd/file/dist/magic/magdir/convex
N src/external/bsd/file/dist/magic/magdir/cracklib
N src/external/bsd/file/dist/magic/magdir/ctags
N src/external/bsd/file/dist/magic/magdir/dact
N src/external/bsd/file/dist/magic/magdir/database
N 

CVS commit: src/external/bsd/file/dist

2009-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  8 16:40:10 UTC 2009

Modified Files:
src/external/bsd/file/dist: file2netbsd

Log Message:
add import script


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/file2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/file2netbsd
diff -u src/external/bsd/file/dist/file2netbsd:1.1.1.1 src/external/bsd/file/dist/file2netbsd:1.2
--- src/external/bsd/file/dist/file2netbsd:1.1.1.1	Fri May  8 12:35:04 2009
+++ src/external/bsd/file/dist/file2netbsd	Fri May  8 12:40:10 2009
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: file2netbsd,v 1.1.1.1 2009/05/08 16:35:04 christos Exp $
+#	$NetBSD: file2netbsd,v 1.2 2009/05/08 16:40:10 christos Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,8 +33,12 @@
 # based on texinfo2netbsd
 #
 
-# edit this
-file_vers='4.21'
+if [ -z $1 ]
+then
+	echo Usage $0: file-version 12
+	exit 1
+fi
+file_vers=$1
 
 #
 # (usually) NO NEED TO EDIT BELOW THIS LINE
@@ -105,6 +109,6 @@
 echo done
 
 echo You can import now.  Use the following command:
-echo cvs import src/dist/file CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
+echo cvs import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
 
 exit 0



CVS commit: src/external/bsd/file

2009-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  8 17:28:02 UTC 2009

Modified Files:
src/external/bsd/file/dist/src: apprentice.c cdf.c cdf_time.c
compress.c file.h fsmagic.c funcs.c magic.c readcdf.c readelf.c
softmagic.c
Added Files:
src/external/bsd/file: Makefile.inc
src/external/bsd/file/bin: Makefile
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: Makefile shlib_version

Log Message:
build glue and lint fixes


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/file/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/file/bin/Makefile
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/src/apprentice.c \
src/external/bsd/file/dist/src/cdf.c \
src/external/bsd/file/dist/src/cdf_time.c \
src/external/bsd/file/dist/src/compress.c \
src/external/bsd/file/dist/src/file.h \
src/external/bsd/file/dist/src/fsmagic.c \
src/external/bsd/file/dist/src/funcs.c \
src/external/bsd/file/dist/src/magic.c \
src/external/bsd/file/dist/src/readcdf.c \
src/external/bsd/file/dist/src/readelf.c \
src/external/bsd/file/dist/src/softmagic.c
cvs rdiff -u -r0 -r1.1 src/external/bsd/file/include/config.h
cvs rdiff -u -r0 -r1.1 src/external/bsd/file/lib/Makefile \
src/external/bsd/file/lib/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.1.1.1 src/external/bsd/file/dist/src/apprentice.c:1.2
--- src/external/bsd/file/dist/src/apprentice.c:1.1.1.1	Fri May  8 12:35:05 2009
+++ src/external/bsd/file/dist/src/apprentice.c	Fri May  8 13:28:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.1.1.1 2009/05/08 16:35:05 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.2 2009/05/08 17:28:01 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: apprentice.c,v 1.151 2009/03/18 15:19:23 christos Exp $)
 #else
-__RCSID($NetBSD: apprentice.c,v 1.1.1.1 2009/05/08 16:35:05 christos Exp $);
+__RCSID($NetBSD: apprentice.c,v 1.2 2009/05/08 17:28:01 christos Exp $);
 #endif
 #endif	/* lint */
 
@@ -633,7 +633,9 @@
 		(*errs)++;
 	} else {
 		/* read and parse this file */
-		for (ms-line = 1; fgets(line, sizeof(line), f) != NULL; ms-line++) {
+		for (ms-line = 1;
+		fgets(line, CAST(int, sizeof(line)), f) != NULL;
+		ms-line++) {
 			size_t len;
 			len = strlen(line);
 			if (len == 0) /* null line, garbage, etc */
@@ -1093,7 +1095,7 @@
 return -1;
 			}
 			me-mp = m = nm;
-			me-max_count = cnt;
+			me-max_count = CAST(uint32_t, cnt);
 		}
 		m = me-mp[me-cont_count++];
 		(void)memset(m, 0, sizeof(*m));
@@ -1129,7 +1131,7 @@
 		m-cont_level = 0;
 		me-cont_count = 1;
 	}
-	m-lineno = lineno;
+	m-lineno = CAST(uint32_t, lineno);
 
 	if (*l == '') {  /* m-cont_level == 0 checked below. */
 ++l;/* step over */
@@ -1302,7 +1304,8 @@
 		file_magwarn(ms,
 		multiple ranges);
 	have_range = 1;
-	m-str_range = strtoul(l, t, 0);
+	m-str_range = CAST(uint32_t,
+	strtoul(l, t, 0));
 	if (m-str_range == 0)
 		file_magwarn(ms,
 		zero range);
@@ -1949,7 +1952,7 @@
 	}
 out:
 	*p = '\0';
-	m-vallen = p - origp;
+	m-vallen = CAST(unsigned char, (p - origp));
 	if (m-type == FILE_PSTRING)
 		m-vallen++;
 	return s;
Index: src/external/bsd/file/dist/src/cdf.c
diff -u src/external/bsd/file/dist/src/cdf.c:1.1.1.1 src/external/bsd/file/dist/src/cdf.c:1.2
--- src/external/bsd/file/dist/src/cdf.c:1.1.1.1	Fri May  8 12:35:06 2009
+++ src/external/bsd/file/dist/src/cdf.c	Fri May  8 13:28:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdf.c,v 1.1.1.1 2009/05/08 16:35:06 christos Exp $	*/
+/*	$NetBSD: cdf.c,v 1.2 2009/05/08 17:28:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 Christos Zoulas
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID(@(#)$File: cdf.c,v 1.30 2009/05/06 14:29:47 christos Exp $)
 #else
-__RCSID($NetBSD: cdf.c,v 1.1.1.1 2009/05/08 16:35:06 christos Exp $);
+__RCSID($NetBSD: cdf.c,v 1.2 2009/05/08 17:28:01 christos Exp $);
 #endif
 #endif
 
@@ -74,9 +74,9 @@
 
 #define NEED_SWAP	(cdf_bo.u == (uint32_t)0x01020304)
 
-#define CDF_TOLE8(x)	(NEED_SWAP ? cdf_tole8(x) : (uint64_t)(x))
-#define CDF_TOLE4(x)	(NEED_SWAP ? cdf_tole4(x) : (uint32_t)(x))
-#define CDF_TOLE2(x)	(NEED_SWAP ? cdf_tole2(x) : (uint16_t)(x))
+#define CDF_TOLE8(x)	((uint64_t)(NEED_SWAP ? cdf_tole8(x) : (uint64_t)(x)))
+#define CDF_TOLE4(x)	((uint32_t)(NEED_SWAP ? cdf_tole4(x) : (uint32_t)(x)))
+#define CDF_TOLE2(x)	((uint16_t)(NEED_SWAP ? cdf_tole2(x) : (uint16_t)(x)))
 
 /*
  * swap a short
@@ -151,15 +151,15 @@
 	h-h_min_size_standard_stream =
 	CDF_TOLE4(h-h_min_size_standard_stream);
 	h-h_secid_first_sector_in_short_sat =
-	CDF_TOLE4(h-h_secid_first_sector_in_short_sat);
+	   

CVS commit: src/external/bsd/file/dist

2009-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  8 17:34:35 UTC 2009

Modified Files:
src/external/bsd/file/dist: Makefile.am Makefile.in configure
src/external/bsd/file/dist/doc: file.1
src/external/bsd/file/dist/magic: Makefile.am Makefile.in
src/external/bsd/file/dist/magic/magdir: archive filesystems

Log Message:
apply our local patches


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/Makefile.am \
src/external/bsd/file/dist/Makefile.in \
src/external/bsd/file/dist/configure
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/doc/file.1
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/magic/Makefile.am \
src/external/bsd/file/dist/magic/Makefile.in
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/magic/magdir/archive \
src/external/bsd/file/dist/magic/magdir/filesystems

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/Makefile.am
diff -u src/external/bsd/file/dist/Makefile.am:1.1.1.1 src/external/bsd/file/dist/Makefile.am:1.2
--- src/external/bsd/file/dist/Makefile.am:1.1.1.1	Fri May  8 12:35:01 2009
+++ src/external/bsd/file/dist/Makefile.am	Fri May  8 13:34:34 2009
@@ -2,4 +2,4 @@
 
 EXTRA_DIST = MAINT
 
-SUBDIRS = src magic tests doc python
+SUBDIRS = src magic doc
Index: src/external/bsd/file/dist/Makefile.in
diff -u src/external/bsd/file/dist/Makefile.in:1.1.1.1 src/external/bsd/file/dist/Makefile.in:1.2
--- src/external/bsd/file/dist/Makefile.in:1.1.1.1	Fri May  8 12:35:01 2009
+++ src/external/bsd/file/dist/Makefile.in	Fri May  8 13:34:34 2009
@@ -185,7 +185,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = MAINT
-SUBDIRS = src
+SUBDIRS = src magic
 #SUBDIRS = src magic tests doc python
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -235,6 +235,8 @@
 	@rm -f stamp-h1
 	cd $(top_builddir)  $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in:  $(am__configure_deps) 
+	@echo NOT REBUILDING $@
+NetBSD_DISABLED_srcdir_config.h.in:
 	cd $(top_srcdir)  $(AUTOHEADER)
 	rm -f stamp-h1
 	touch $@
Index: src/external/bsd/file/dist/configure
diff -u src/external/bsd/file/dist/configure:1.1.1.1 src/external/bsd/file/dist/configure:1.2
--- src/external/bsd/file/dist/configure:1.1.1.1	Fri May  8 12:35:03 2009
+++ src/external/bsd/file/dist/configure	Fri May  8 13:34:34 2009
@@ -2163,7 +2163,7 @@
 # break other packages using the cache if that directory is
 # removed, or if the value is a relative name.
 test -d ./--version  rmdir ./--version
-MKDIR_P=$ac_install_sh -d
+MKDIR_P=\$(SHELL) $ac_install_sh -d
   fi
 fi
 { echo $as_me:$LINENO: result: $MKDIR_P 5

Index: src/external/bsd/file/dist/doc/file.1
diff -u src/external/bsd/file/dist/doc/file.1:1.2 src/external/bsd/file/dist/doc/file.1:1.3
--- src/external/bsd/file/dist/doc/file.1:1.2	Fri May  8 12:39:46 2009
+++ src/external/bsd/file/dist/doc/file.1	Fri May  8 13:34:34 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: file.1,v 1.2 2009/05/08 16:39:46 christos Exp $
+.\	$NetBSD: file.1,v 1.3 2009/05/08 17:34:34 christos Exp $
 .\
 .\ $File: file.man,v 1.79 2008/11/06 22:49:08 rrt Exp $
 .Dd October 9, 2008
@@ -177,7 +177,7 @@
 .Ar testname
 from the list of tests made to determine the file type. Valid test names
 are:
-.Bl -tag -width
+.Bl -tag -width compress
 .It apptype
 .Dv EMX
 application type (only on EMX).

Index: src/external/bsd/file/dist/magic/Makefile.am
diff -u src/external/bsd/file/dist/magic/Makefile.am:1.1.1.1 src/external/bsd/file/dist/magic/Makefile.am:1.2
--- src/external/bsd/file/dist/magic/Makefile.am:1.1.1.1	Fri May  8 12:35:06 2009
+++ src/external/bsd/file/dist/magic/Makefile.am	Fri May  8 13:34:35 2009
@@ -1,7 +1,7 @@
 #
 # $File: Makefile.am,v 1.45 2009/03/05 22:40:59 christos Exp $
 #
-MAGIC_FRAGMENT_BASE = Magdir
+MAGIC_FRAGMENT_BASE = magdir
 MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
 
 pkgdata_DATA = magic.mgc
Index: src/external/bsd/file/dist/magic/Makefile.in
diff -u src/external/bsd/file/dist/magic/Makefile.in:1.1.1.1 src/external/bsd/file/dist/magic/Makefile.in:1.2
--- src/external/bsd/file/dist/magic/Makefile.in:1.1.1.1	Fri May  8 12:35:07 2009
+++ src/external/bsd/file/dist/magic/Makefile.in	Fri May  8 13:34:35 2009
@@ -168,7 +168,7 @@
 #
 # $File: Makefile.am,v 1.45 2009/03/05 22:40:59 christos Exp $
 #
-MAGIC_FRAGMENT_BASE = Magdir
+MAGIC_FRAGMENT_BASE = magdir
 MAGIC_FRAGMENT_DIR = $(top_srcdir)/magic/$(MAGIC_FRAGMENT_BASE)
 pkgdata_DATA = magic.mgc
 EXTRA_DIST = Header Localstuff \

Index: src/external/bsd/file/dist/magic/magdir/archive
diff -u src/external/bsd/file/dist/magic/magdir/archive:1.1.1.1 src/external/bsd/file/dist/magic/magdir/archive:1.2
--- src/external/bsd/file/dist/magic/magdir/archive:1.1.1.1	Fri May  8 12:35:07 2009
+++ src/external/bsd/file/dist/magic/magdir/archive	Fri May  8 13:34:35 2009
@@ 

CVS commit: src/external/bsd/file/dist/doc

2009-05-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May  8 20:19:39 UTC 2009

Modified Files:
src/external/bsd/file/dist/doc: libmagic.3 magic.5

Log Message:
Drop trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/doc/libmagic.3
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/dist/doc/magic.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/libmagic.3
diff -u src/external/bsd/file/dist/doc/libmagic.3:1.1.1.1 src/external/bsd/file/dist/doc/libmagic.3:1.2
--- src/external/bsd/file/dist/doc/libmagic.3:1.1.1.1	Fri May  8 16:35:10 2009
+++ src/external/bsd/file/dist/doc/libmagic.3	Fri May  8 20:19:39 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: libmagic.3,v 1.1.1.1 2009/05/08 16:35:10 christos Exp $
+.\	$NetBSD: libmagic.3,v 1.2 2009/05/08 20:19:39 wiz Exp $
 .\
 .\ $File: libmagic.man,v 1.19 2008/10/06 20:16:04 christos Exp $
 .\
@@ -14,7 +14,7 @@
 .\ 2. Redistributions in binary form must reproduce the above copyright
 .\notice, this list of conditions and the following disclaimer in the
 .\documentation and/or other materials provided with the distribution.
-.\ 
+.\
 .\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 .\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -75,7 +75,7 @@
 The function
 .Fn magic_open
 creates a magic cookie pointer and returns it. It returns NULL if
-there was an error allocating the magic cookie. The 
+there was an error allocating the magic cookie. The
 .Ar flags
 argument specifies how the other magic functions should behave:
 .Bl -tag -width MAGIC_COMPRESS
@@ -167,7 +167,7 @@
 .Pp
 The
 .Fn magic_setflags
-function sets the 
+function sets the
 .Ar flags
 described above. Note that using both MIME flags together can also
 return extra information on the charset.
@@ -221,7 +221,7 @@
 The
 .Fn magic_file ,
 and
-.Fn magic_buffer 
+.Fn magic_buffer
 functions return a string on success and NULL on failure. The
 .Fn magic_error
 function returns a textual description of the errors of the above
@@ -244,7 +244,7 @@
 .El
 .Sh SEE ALSO
 .Xr file 1 ,
-.Xr magic 5 
+.Xr magic 5
 .Sh AUTHORS
 Måns Rullgård Initial libmagic implementation,
 and configuration.

Index: src/external/bsd/file/dist/doc/magic.5
diff -u src/external/bsd/file/dist/doc/magic.5:1.2 src/external/bsd/file/dist/doc/magic.5:1.3
--- src/external/bsd/file/dist/doc/magic.5:1.2	Fri May  8 16:39:46 2009
+++ src/external/bsd/file/dist/doc/magic.5	Fri May  8 20:19:39 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: magic.5,v 1.2 2009/05/08 16:39:46 christos Exp $
+.\	$NetBSD: magic.5,v 1.3 2009/05/08 20:19:39 wiz Exp $
 .\
 .\ $File: magic.man,v 1.59 2008/11/06 23:22:53 christos Exp $
 .Dd August 30, 2008
@@ -299,14 +299,14 @@
 .El
 .Pp
 An APPLE 4+4 character APPLE creator and type can be specified as:
-.Bd -literal -offset indent 
+.Bd -literal -offset indent
 !:apple	CREATYPE
 .Ed
 .Pp
 A MIME type is given on a separate line, which must be the next
 non-blank or comment line after the magic line that identifies the
 file type, and has the following format:
-.Bd -literal -offset indent 
+.Bd -literal -offset indent
 !:mime	MIMETYPE
 .Ed
 .Pp
@@ -316,13 +316,13 @@
 .Pp
 An optional strength can be supplied on a separate line which refers to
 the current magic description using the following format:
-.Bd -literal -offset indent 
+.Bd -literal -offset indent
 !:strength OP VALUE
 .Ed
 .Pp
 The operand
 .Dv OP
-can be: 
+can be:
 .Dv + ,
 .Dv - ,
 .Dv * ,



CVS commit: src/external/bsd/file/dist/doc

2009-05-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May  8 21:45:52 UTC 2009

Modified Files:
src/external/bsd/file/dist/doc: file.1

Log Message:
Use more markup, use more appropriate markup. Improve wording.
Sort options and sections. Make ready for HTML output. Fix xref.
Add -0 to SYNOPSIS.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/dist/doc/file.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/doc/file.1
diff -u src/external/bsd/file/dist/doc/file.1:1.3 src/external/bsd/file/dist/doc/file.1:1.4
--- src/external/bsd/file/dist/doc/file.1:1.3	Fri May  8 17:34:34 2009
+++ src/external/bsd/file/dist/doc/file.1	Fri May  8 21:45:52 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: file.1,v 1.3 2009/05/08 17:34:34 christos Exp $
+.\	$NetBSD: file.1,v 1.4 2009/05/08 21:45:52 wiz Exp $
 .\
 .\ $File: file.man,v 1.79 2008/11/06 22:49:08 rrt Exp $
 .Dd October 9, 2008
@@ -9,18 +9,18 @@
 .Nd determine file type
 .Sh SYNOPSIS
 .Nm
-.Op Fl bchikLnNprsvz
-.Op Fl -mime-type
-.Op Fl -mime-encoding
-.Op Fl f Ar namefile
+.Op Fl 0bchikLNnprsvz
 .Op Fl F Ar separator
+.Op Fl f Ar namefile
 .Op Fl m Ar magicfiles
+.Op Fl Fl mime-encoding
+.Op Fl Fl mime-type
 .Ar file
 .Nm
 .Fl C
 .Op Fl m Ar magicfile
 .Nm
-.Op Fl -help
+.Op Fl Fl help
 .Sh DESCRIPTION
 This manual page documents version 5.03 of the
 .Nm
@@ -44,12 +44,12 @@
 .Em executable
 (the file contains the result of compiling a program
 in a form understandable to some
-.Dv UNIX
+.Tn UNIX
 kernel or another),
 or
 .Em data
 meaning anything else (data is usually
-.Sq binary
+.Dq binary
 or non-printable).
 Exceptions are well-known file formats (core files, tar archives)
 that are known to contain binary data.
@@ -57,12 +57,12 @@
 .Em preserve these keywords .
 Users depend on knowing that all the readable files in a directory
 have the word
-.Sq text
+.Dq text
 printed.
 Don't do as Berkeley did and change
-.Sq shell commands text
+.Dq shell commands text
 to
-.Sq shell script .
+.Dq shell script .
 .Pp
 The filesystem tests are based on examining the return from a
 .Xr stat 2
@@ -72,8 +72,7 @@
 Any known file types appropriate to the system you are running on
 (sockets, symbolic links, or named pipes (FIFOs) on those systems that
 implement them)
-are intuited if they are defined in
-the system header file
+are intuited if they are defined in the system header file
 .In sys/stat.h .
 .Pp
 The magic tests are used to check for files with data in
@@ -87,13 +86,14 @@
 .In exec.h
 in the standard include directory.
 These files have a
-.Sq magic number
+.Dq magic number
 stored in a particular place
 near the beginning of the file that tells the
-.Dv UNIX operating system
+.Tn UNIX
+operating system
 that the file is a binary executable, and which of several types thereof.
 The concept of a
-.Sq magic
+.Dq magic
 has been applied by extension to data files.
 Any file with some invariant identifier at a small fixed
 offset into the file can usually be described in this way.
@@ -102,7 +102,8 @@
 .Pa /usr/share/misc/magic.mgc ,
 or the files in the directory
 .Pa /usr/share/misc/magic
-if the compiled file does not exist. In addition, if
+if the compiled file does not exist.
+In addition, if
 .Pa $HOME/.magic.mgc
 or
 .Pa $HOME/.magic
@@ -119,10 +120,10 @@
 If a file passes any of these tests, its character set is reported.
 ASCII, ISO-8859-x, UTF-8, and extended-ASCII files are identified
 as
-.Sq text
+.Dq text
 because they will be mostly readable on nearly any terminal;
 UTF-16 and EBCDIC are only
-.Sq character data
+.Dq character data
 because, while
 they contain text, it is text that will require translation
 before it can be read.
@@ -140,8 +141,8 @@
 it will
 attempt to determine in what language the file is written.
 The language tests look for particular strings (cf.
-.In names.h
-) that can appear anywhere in the first few blocks of a file.
+.In names.h )
+that can appear anywhere in the first few blocks of a file.
 For example, the keyword
 .Em .br
 indicates that the file is most likely a
@@ -158,32 +159,41 @@
 .Pp
 Any file that cannot be identified as having been written
 in any of the character sets listed above is simply said to be
-.Sq data .
+.Dq data .
 .Sh OPTIONS
 .Bl -tag -width indent
-.It Fl b , -brief
+.It Fl 0 , -print0
+Output a null character
+.Sq \e0
+after the end of the filename.
+Nice to
+.Xr cut 1
+the output.
+This does not affect the separator which is still printed.
+.It Fl b , Fl Fl brief
 Do not prepend filenames to output lines (brief mode).
-.It Fl c , -checking-printout
+.It Fl c , Fl Fl checking-printout
 Cause a checking printout of the parsed form of the magic file.
 This is usually used in conjunction with the
 .Fl m
 flag to debug a new magic file before installing it.
-.It Fl C , -compile
+.It Fl C , Fl Fl compile
 Write a
 .Pa magic.mgc
 output file that contains a 

CVS commit: src/external/bsd/file

2009-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  8 23:36:42 UTC 2009

Modified Files:
src/external/bsd/file: Makefile.inc

Log Message:
set BINDIR


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/file/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.2 src/external/bsd/file/Makefile.inc:1.3
--- src/external/bsd/file/Makefile.inc:1.2	Fri May  8 13:43:54 2009
+++ src/external/bsd/file/Makefile.inc	Fri May  8 19:36:42 2009
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.2 2009/05/08 17:43:54 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2009/05/08 23:36:42 christos Exp $
 
 DIST=${.CURDIR}/../dist
 WARNS=4
 
+BINDIR?= /usr/bin
 USE_FORT?= yes	# data-driven bugs?
 
 TOOL_MKMAGIC?=	${.OBJDIR}/file