Browse Source

Import Debian version 3.20.1-3

Nicolás Lichtmaier 27 years ago
parent
commit
cef0dfc1ea
19 changed files with 237 additions and 48 deletions
  1. 2 4
      Magdir/Header
  2. 0 1
      Magdir/Makefile
  3. 12 4
      Magdir/archive
  4. 26 3
      Magdir/audio
  5. 3 0
      Magdir/commands
  6. 3 6
      Magdir/elf
  7. 1 1
      Magdir/java
  8. 5 0
      Magdir/linux
  9. 12 7
      Magdir/msdos
  10. 39 0
      Magdir/net
  11. 7 0
      Magdir/ppd
  12. 6 6
      Makefile
  13. 11 0
      debian/README.debian
  14. 1 0
      debian/conffiles
  15. 14 0
      debian/control
  16. 55 0
      debian/rules
  17. 15 2
      file.c
  18. 22 14
      file.man
  19. 3 0
      softmagic.c

+ 2 - 4
Magdir/Header

@@ -1,5 +1,3 @@
-#! file
 # Magic data for file(1) command.
 # Magic data for file(1) command.
-# Machine-genererated from src/cmd/file/magdir/*; edit there only!
-# Format is described in magic(files), where:
-# files is 4 on V7 and BSD, 4 on SV, and ?? in the SVID.
+# Send your suggested inclusions to this file to nick@feedback.com.ar
+# Format is described in magic(5).

+ 0 - 1
Magdir/Makefile

@@ -12,5 +12,4 @@ ALL		=  $(HEADER) $(LOCALSTUFF) [a-z]*
 
 
 install:	../magic
 install:	../magic
 ../magic:	$(ALL)
 ../magic:	$(ALL)
-		echo "# Magic file created `date` by `who am i`" > $@
 		cat $(ALL) >> $@
 		cat $(ALL) >> $@

+ 12 - 4
Magdir/archive

@@ -45,8 +45,12 @@
 >19	string	B			and an EB hash table
 >19	string	B			and an EB hash table
 >22	string	X			-- out of date
 >22	string	X			-- out of date
 
 
-0	string		!<arch>		archive
->8	string		__.SYMDEF	random library
+0	string		!<arch>\ndebian
+>8	string		debian-split	part of multipart Debian package
+>8	string		debian-binary	Debian binary package
+>68	string		>\n		(format %s)
+>136	ledate		x		created: %s
+
 0	string		-h-		Software Tools format archive text
 0	string		-h-		Software Tools format archive text
 
 
 #
 #
@@ -68,8 +72,6 @@
 #
 #
 0	string		!<arch>		current ar archive
 0	string		!<arch>		current ar archive
 >8	string		__.SYMDEF	random library
 >8	string		__.SYMDEF	random library
->8	string		debian-split	part of multipart Debian package
->8	string		debian-binary	Debian binary package
 >0	belong		=65538		- pre SR9.5
 >0	belong		=65538		- pre SR9.5
 >0	belong		=65539		- post SR9.5
 >0	belong		=65539		- post SR9.5
 >0	beshort		2		- object archive
 >0	beshort		2		- object archive
@@ -215,3 +217,9 @@
 
 
 # Shell archives
 # Shell archives
 10	string		#\ This\ is\ a\ shell\ archive	shell archive text
 10	string		#\ This\ is\ a\ shell\ archive	shell archive text
+
+#
+# Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
+0	string		0.9
+>8	byte		0x0a		old Debian binary package
+>>3	string		>\n		(format 0.9%s)

+ 26 - 3
Magdir/audio

@@ -82,9 +82,32 @@
 
 
 # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
 # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
 # Oct 31, 1995
 # Oct 31, 1995
-0	string		MTM		MultiTracker Module sound file
+0	string		MTM		MultiTracker Module sound data
 0	string		if		Composer 669 Module sound data
 0	string		if		Composer 669 Module sound data
 0	string		FAR		Module sound data
 0	string		FAR		Module sound data
-0	string		MAS_U		ULT(imate) Module sound data
+#0	string		MAS_U		ULT(imate) Module sound data
 0x2c	string		SCRM		ScreamTracker III Module sound data
 0x2c	string		SCRM		ScreamTracker III Module sound data
-0	string		Extended Module	Extended Module sound data
+#0	string		Extended Module	Extended Module sound data
+#------------------------------------------------------------------------------
+# Mods:  file(1) magic for MOD etc. sound module files
+#
+# Taken from loader code from mikmod version 2.14
+# by Steve McIntyre (stevem@chiark.greenend.org.uk)
+0	string	JN		extended 669 module data
+0	string	MAS_UTrack_V00
+>14	string	>/0		ultratracker V1.%.1s module sound data
+0	string	UN05		MikMod UNI format module sound data
+0	string	Extended\ Module: Fasttracker II module sound data
+21	string	!SCREAM!	Screamtracker 2 module sound data
+1080	string	M.K.		4-channel Protracker module sound data
+1080	string	M!K!		4-channel Protracker module sound data
+1080	string	FLT4		4-channel Startracker module sound data
+1080	string	4CHN		4-channel Fasttracker module sound data
+1080	string	6CHN		6-channel Fasttracker module sound data
+1080	string	8CHN		8-channel Fasttracker module sound data
+1080	string	CD81		8-channel Oktalyzer module sound data
+1080	string	OKTA		8-channel Oktalyzer module sound data
+1082	string	CH
+>1080	string	>/0		%.2s-channel Fasttracker "oktalyzer" module sound data
+1080	string	16CN		16-channel Taketracker module sound data
+1080	string	32CN		32-channel Taketracker module sound data

+ 3 - 0
Magdir/commands

@@ -67,6 +67,9 @@
 0	string		#!\ /usr/local/bin/bash	Bourne-Again shell script text
 0	string		#!\ /usr/local/bin/bash	Bourne-Again shell script text
 
 
 # generic shell magic
 # generic shell magic
+# the following two lines added for debian linux by wtm to recognize a tab
+0	string		#!\	/		a
+>3	string		>\0			%s script text
 0	string		#!\ /			a
 0	string		#!\ /			a
 >3	string		>\0			%s script text
 >3	string		>\0			%s script text
 0	string		#!/			a
 0	string		#!/			a

+ 3 - 6
Magdir/elf

@@ -19,10 +19,7 @@
 >>16	leshort		1		relocatable,
 >>16	leshort		1		relocatable,
 >>16	leshort		2		executable,
 >>16	leshort		2		executable,
 >>16	leshort		3		shared object,
 >>16	leshort		3		shared object,
-# Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
->>16	leshort		4		core file
->>>576  string          >\0             of '%s'
->>>400  lelong          >0              (signal %d),
+>>16	leshort		4		core file,
 >>16	leshort		&0xff00		processor-specific,
 >>16	leshort		&0xff00		processor-specific,
 >>18	leshort		0		no machine,
 >>18	leshort		0		no machine,
 >>18	leshort		1		AT&T WE32100 - invalid byte order,
 >>18	leshort		1		AT&T WE32100 - invalid byte order,
@@ -43,8 +40,8 @@
 >>16	beshort		2		executable,
 >>16	beshort		2		executable,
 >>16	beshort		3		shared object,
 >>16	beshort		3		shared object,
 >>16	beshort		4		core file,
 >>16	beshort		4		core file,
->>>576	string		>\0		of '%s'
->>>400	lelong		>0		(signal %d),
+#>>>576	string		>\0		of '%s'
+#>>>400	lelong		>0		(signal %d),
 >>16	beshort		&0xff00		processor-specific,
 >>16	beshort		&0xff00		processor-specific,
 >>18	beshort		0		no machine,
 >>18	beshort		0		no machine,
 >>18	beshort		1		AT&T WE32100,
 >>18	beshort		1		AT&T WE32100,

+ 1 - 1
Magdir/java

@@ -1,4 +1,4 @@
 #------------------------------------------------------------
 #------------------------------------------------------------
 # Java ByteCode
 # Java ByteCode
 0	belong		0xcafebabe
 0	belong		0xcafebabe
->4	belong		0x0003002d	Java bytecode
+>4	belong		0x0003002d	Java bytecode data

+ 5 - 0
Magdir/linux

@@ -79,7 +79,12 @@
 >>0x048c	string	x		version %s
 >>0x048c	string	x		version %s
 >0x0493		byte	0x32
 >0x0493		byte	0x32
 >>0x0493	string	x		version %s
 >>0x0493	string	x		version %s
+>0x04df		byte	0x32
+>>0x04df	string	x		version %s
 # This also matches new kernels, which were caught above by "HdrS".
 # This also matches new kernels, which were caught above by "HdrS".
 0		belong	0xb8c0078e	Linux kernel
 0		belong	0xb8c0078e	Linux kernel
 >0x1e3		string	Loading		version 1.3.79 or older
 >0x1e3		string	Loading		version 1.3.79 or older
 >0x1e9		string	Loading		from prehistoric times
 >0x1e9		string	Loading		from prehistoric times
+
+# LSM entries - Nicolas Lichtmaier <nick@feedback.com.ar>
+0	string	Begin3	Linux Software Map entry text

+ 12 - 7
Magdir/msdos

@@ -56,18 +56,23 @@
 #
 #
 
 
 # Popular applications
 # Popular applications
-2080	string	Microsoft\ Word\ 6.0\ Document	%s
+2080	string	Microsoft\ Word\ 6.0\ Document	Microsoft Word document data
+2080	string	Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
+# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
+2112	string	MSWordDoc	Microsoft Word document data
 #
 #
 0	belong	0x31be0000	Microsoft Word Document
 0	belong	0x31be0000	Microsoft Word Document
 #
 #
 2080	string	Microsoft\ Excel\ 5.0\ Worksheet	%s
 2080	string	Microsoft\ Excel\ 5.0\ Worksheet	%s
+# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
+2114	string	Biff5		Microsoft Excel 5.0 Worksheet
 #
 #
 0	belong	0x00001a00	Lotus 1-2-3
 0	belong	0x00001a00	Lotus 1-2-3
->4	belong	0x00100400	wk3 document
->4	belong	0x02100400	wk4 document
->4	belong	0x07800100	fm3 or fmb document
->4	belong	0x07800000	fm3 or fmb document
+>4	belong	0x00100400	wk3 document data
+>4	belong	0x02100400	wk4 document data
+>4	belong	0x07800100	fm3 or fmb document data
+>4	belong	0x07800000	fm3 or fmb document data
 #
 #
 0	belong	0x00000200 	Lotus 1-2-3
 0	belong	0x00000200 	Lotus 1-2-3
->4	belong	0x06040600	wk1 document
->4	belong	0x06800200	fmt document
+>4	belong	0x06040600	wk1 document data
+>4	belong	0x06800200	fmt document data

+ 39 - 0
Magdir/net

@@ -0,0 +1,39 @@
+# These entries describe the file format of pcap data files
+# (for example from tcpdump). Peter Tobias <tobias@et-inf.fho-emden.de>
+
+0	lelong		0xa1b2c3d4	pcap data (little endian),
+>4	leshort		x		version %d
+>6	leshort		x		rev %d,
+>16	lelong		x		snap length %d,
+>20	lelong		0		no link-layer encapsulation
+>20	lelong		1		Ethernet
+>20	lelong		2		Ethernet (3MB)
+>20	lelong		3		AX25
+>20	lelong		4		ProNET
+>20	lelong		5		CHAOS
+>20	lelong		6		IEEE 802
+>20	lelong		7		ARCNET
+>20	lelong		8		SLIP
+>20	lelong		9		PPP
+>20	lelong		10		FDDI
+>20	lelong		11		LLC/SNAP encapsulated ATM
+>20	lelong		12		raw IP
+
+
+0	belong		0xa1b2c3d4	pcap data (big endian),
+>4	beshort		x		version %d
+>6	beshort		x		rev %d,
+>16	belong		x		snap length %d,
+>20	belong		0		no link-layer encapsulation
+>20	belong		1		Ethernet
+>20	belong		2		Ethernet (3MB)
+>20	belong		3		AX25
+>20	belong		4		ProNET
+>20	belong		5		CHAOS
+>20	belong		6		IEEE 802
+>20	belong		7		ARCNET
+>20	belong		8		SLIP
+>20	belong		9		PPP
+>20	belong		10		FDDI
+>20	belong		11		LLC/SNAP encapsulated ATM
+>20	belong		12		raw IP

+ 7 - 0
Magdir/ppd

@@ -0,0 +1,7 @@
+#------------------------------------------------------------------------------
+# ppd:  file(1) Adobe's PostScript Printer Description (PPD) files
+#       Yves Arrouye <arrouye@marin.fdn.fr>
+#
+0      string          *PPD-Adobe:    PPD file
+>13    string          x              \b, ve
+

+ 6 - 6
Makefile

@@ -63,9 +63,9 @@ BINDIR	= /usr/bin
 # MANCDIR			/usr/man/local/man1
 # MANCDIR			/usr/man/local/man1
 # MANCEXT			1
 # MANCEXT			1
 
 
-MANCDIR	= /usr/local/man/man1
+MANCDIR	= /usr/man/man1
 MANCEXT	= 1
 MANCEXT	= 1
-MANFDIR	= /usr/local/man/man5
+MANFDIR	= /usr/man/man5
 MANFEXT	= 5
 MANFEXT	= 5
 
 
 # There are no system-dependant configuration options (except maybe CFLAGS).
 # There are no system-dependant configuration options (except maybe CFLAGS).
@@ -112,12 +112,12 @@ ascmagic.o:	names.h
 compress.o apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
 compress.o apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
 
 
 install:	file magic
 install:	file magic
-		cp file	$(BINDIR)/file
-		cp magic $(MAGIC)
+		cp file	$(DESTDIR)$(BINDIR)/file
+		cp magic $(DESTDIR)$(MAGIC)
 
 
 install.man: file.${MANCEXT} magic.${MANFEXT}
 install.man: file.${MANCEXT} magic.${MANFEXT}
-		cp file.${MANCEXT} $(MANCDIR)/file.$(MANCEXT)
-		cp magic.${MANFEXT} $(MANFDIR)/magic.$(MANFEXT)
+		cp file.${MANCEXT} $(DESTDIR)$(MANCDIR)/file.$(MANCEXT)
+		cp magic.${MANFEXT} $(DESTDIR)$(MANFDIR)/magic.$(MANFEXT)
 
 
 clean:
 clean:
 		rm -f *.o core file magic lint dist.* MANIFEST \
 		rm -f *.o core file magic lint dist.* MANIFEST \

+ 11 - 0
debian/README.debian

@@ -0,0 +1,11 @@
+This is Debian Linux's prepackaged version of file, a program to
+determine file type using "magic" numbers.
+
+This package was assembled by Nicolás Lichtmaier <nick@feedback.com.ar> with
+sources from ftp://sunsite.unc.edu/pub/Linux/utils/file/file-3.20.1.tar.gz.
+
+The copyright for packaging this software is released to the public
+domain.
+
+This package was previously maintained by Darren Stalder <torin@daft.com>
+and Bill Mitchell <mitchell@debian.org>.

+ 1 - 0
debian/conffiles

@@ -0,0 +1 @@
+/etc/magic

+ 14 - 0
debian/control

@@ -0,0 +1,14 @@
+Source: file
+Section: utils
+Priority: standard
+Maintainer: Nicolás Lichtmaier <nick@feedback.com.ar>
+Standards-Version: 2.1.2.2
+
+Package: file
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Determines file type using "magic" numbers
+ File tests each argument in an attempt to classify it.  There are three
+ sets of tests, performed in this order: filesystem tests, magic number
+ tests, and language tests.  The first test that succeeds causes the
+ file type to be printed.

+ 55 - 0
debian/rules

@@ -0,0 +1,55 @@
+#!/usr/bin/make -f 
+
+package=file
+
+build:
+	$(checkdir)
+	make COPTS=-O2 all
+	touch build
+
+clean:
+	$(checkdir)
+	-rm -f build
+	make clean
+	-rm -f `find . -name "*~"`
+	-rm -rf debian/tmp debian/files* core debian/substvars
+
+binary-indep:	checkroot build
+	$(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+
+binary-arch:	checkroot build
+	$(checkdir)
+	-rm -rf debian/tmp
+	install -d debian/tmp/usr/bin
+	install -d debian/tmp/etc
+	make install DESTDIR=`pwd`/debian/tmp
+
+	ln patchlevel.h changelog
+	ln LEGAL.NOTICE debian/copyright
+	debstd changelog README
+	rm changelog
+	rm debian/copyright
+	dpkg-gencontrol
+	chown -R root.root debian/tmp
+	chmod -R go=rX debian/tmp
+	dpkg --build debian/tmp ..
+
+define checkdir
+	test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+binary:		binary-indep binary-arch
+
+source diff:
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+checkroot:
+	$(checkdir)
+	test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot

+ 15 - 2
file.c

@@ -42,6 +42,7 @@ static char *moduleid =
 #include <utime.h>
 #include <utime.h>
 #endif
 #endif
 #include <unistd.h>	/* for read() */
 #include <unistd.h>	/* for read() */
+#include <getopt.h>	/* for long options (is this portable?)*/
 
 
 #include "readelf.h"
 #include "readelf.h"
 #include <netinet/in.h>		/* for byte swapping */
 #include <netinet/in.h>		/* for byte swapping */
@@ -89,7 +90,19 @@ char *argv[];
 {
 {
 	int c;
 	int c;
 	int check = 0, didsomefiles = 0, errflg = 0, ret = 0, app = 0;
 	int check = 0, didsomefiles = 0, errflg = 0, ret = 0, app = 0;
-
+	static struct option long_options[] =
+	{
+		{"version", 0, 0, 'v'},
+		{"checking-printout", 0, 0, 'c'},
+		{"debug", 0, 0, 'd'},
+		{"files-from", 1, 0, 'f'},
+#ifdef S_IFLNK
+		{"dereference", 0, 0, 'L'},
+#endif
+		{"magic-file", 1, 0, 'm'},
+		{"uncompress", 0, 0, 'z'},
+		{0, 0, 0, 0},
+	};
 	if ((progname = strrchr(argv[0], '/')) != NULL)
 	if ((progname = strrchr(argv[0], '/')) != NULL)
 		progname++;
 		progname++;
 	else
 	else
@@ -98,7 +111,7 @@ char *argv[];
 	if (!(magicfile = getenv("MAGIC")))
 	if (!(magicfile = getenv("MAGIC")))
 		magicfile = MAGIC;
 		magicfile = MAGIC;
 
 
-	while ((c = getopt(argc, argv, "vcdf:Lm:z")) != EOF)
+	while ((c = getopt_long(argc, argv, "vcdf:Lm:z",long_options,NULL)) != EOF)
 		switch (c) {
 		switch (c) {
 		case 'v':
 		case 'v':
 			(void) fprintf(stdout, "%s-%d.%d\n", progname,
 			(void) fprintf(stdout, "%s-%d.%d\n", progname,

+ 22 - 14
file.man

@@ -1,4 +1,4 @@
-.TH FILE __CSECTION__ "Copyright but distributable"
+.TH FILE __CSECTION__ "11 March 1997" "Debian/GNU Linux" "Copyrighted but distributable"
 .\" $Id: file.man,v 1.27 1996/06/22 22:05:07 christos Exp $
 .\" $Id: file.man,v 1.27 1996/06/22 22:05:07 christos Exp $
 .SH NAME
 .SH NAME
 file
 file
@@ -103,25 +103,25 @@ The language test routines also test for some miscellany
 .BR tar (1)
 .BR tar (1)
 archives) and determine whether an unknown file should be
 archives) and determine whether an unknown file should be
 labelled as `ascii text' or `data'. 
 labelled as `ascii text' or `data'. 
-.SH OPTIONS
-.TP 8
-.B \-v
+.SS OPTIONS
+.TP
+.I "\-v, \-\-version"
 Print the version of the program and exit.
 Print the version of the program and exit.
-.TP 8
-.B \-m list
+.TP
+.I "\-m, \-\-magic-file list"
 Specify an alternate list of files containing magic numbers.
 Specify an alternate list of files containing magic numbers.
 This can be a single file, or a colon-separated list of files.
 This can be a single file, or a colon-separated list of files.
-.TP 8
-.B \-z
+.TP
+.I "\-z, \-\-uncompress"
 Try to look inside compressed files.
 Try to look inside compressed files.
-.TP 8
-.B \-c
+.TP
+.I "\-c, \-\-checking\-printout"
 Cause a checking printout of the parsed form of the magic file.
 Cause a checking printout of the parsed form of the magic file.
 This is usually used in conjunction with 
 This is usually used in conjunction with 
 .B \-m
 .B \-m
 to debug a new magic file before installing it.
 to debug a new magic file before installing it.
-.TP 8
-.B \-f namefile
+.TP
+.I "\-f, \-\-files-from namefile"
 Read the names of the files to be examined from 
 Read the names of the files to be examined from 
 .I namefile
 .I namefile
 (one per line) 
 (one per line) 
@@ -131,7 +131,7 @@ Either
 or at least one filename argument must be present;
 or at least one filename argument must be present;
 to test the standard input, use ``-'' as a filename argument.
 to test the standard input, use ``-'' as a filename argument.
 .TP 8
 .TP 8
-.B \-L
+.I "\-L, \-\-dereference"
 option causes symlinks to be followed, as the like-named option in
 option causes symlinks to be followed, as the like-named option in
 .BR ls (1).
 .BR ls (1).
 (on systems that support symbolic links).
 (on systems that support symbolic links).
@@ -361,4 +361,12 @@ This manual page, and particularly this section, is too long.
 You should be able to obtain the original author's latest version
 You should be able to obtain the original author's latest version
 from ftp://tesla.ee.cornell.edu/pub/, but that might not work.
 from ftp://tesla.ee.cornell.edu/pub/, but that might not work.
 You can also try ftp://ftp.deshaw.com/pub/file/ or (as a last resort)
 You can also try ftp://ftp.deshaw.com/pub/file/ or (as a last resort)
-ftp://ftp.uu.net/pub/FreeBSD/FreeBSD-current/src/usr.bin/file/.
+ftp://ftp.uu.net/pub/FreeBSD/FreeBSD\-current/src/usr.bin/file/.
+.PP
+This
+.B Debian
+version adds long options and corrects some bugs. It can be
+obtained from every site carrying a
+.B Debian
+distribution (ftp.debian.org and
+mirrors).

+ 3 - 0
softmagic.c

@@ -230,6 +230,9 @@ struct magic *m;
 			t = m->offset + strlen(m->value.s);
 			t = m->offset + strlen(m->value.s);
 		}
 		}
 		else {
 		else {
+			/* nick@feedback.com.ar   Only print things before first newline */
+			char *qqq;
+			if (qqq=strchr(p->s,'\n')) *qqq='\0';
 			(void) printf(m->desc, p->s);
 			(void) printf(m->desc, p->s);
 			t = m->offset + strlen(p->s);
 			t = m->offset + strlen(p->s);
 		}
 		}