#------------------------------------------------------------------------------
# amanda: file(1) magic for amanda file format
#
-0 string AMANDA:\ TAPESTART\ DATE AMANDA dump header file,
->23 string X
->>25 string >\ Unused %s
->23 string >\ DATE %s
+0 string AMANDA:\ AMANDA
+>8 string TAPESTART\ DATE tape header file,
+>>23 string X
+>>>25 string >\ Unused %s
+>>23 string >\ DATE %s
+>8 string FILE\ dump file,
+>>13 string >\ DATE %s
0 string TOC TOC sound file
# sidfiles <pooka@iki.fi>
-0 string PSID PlaySID v2.2+ (AMIGA) sidtune,
0 string SIDPLAY\ INFOFILE Sidplay info file
+0 string PSID PlaySID v2.2+ (AMIGA) sidtune
+>4 beshort >0 w/ header v%d,
>14 beshort =1 single song,
>14 beshort >1 %d songs,
+>16 beshort >0 default song: %d
0 belong&0377777777 042600507 NetBSD/pmax core
>12 string >\0 from '%s'
-0 belong&0377777777 043000413 NetBSD/vax demand paged
+0 belong&0377777777 043000413 NetBSD/vax 1k 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 belong&0377777777 043000410 NetBSD/vax pure
+0 belong&0377777777 043000410 NetBSD/vax 1k pure
>0 byte &0x80 dynamically linked executable
>0 byte ^0x80 executable
>16 lelong >0 not stripped
-0 belong&0377777777 043000407 NetBSD/vax
+0 belong&0377777777 043000407 NetBSD/vax 1k
>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&0377777777 043000507 NetBSD/vax core
+0 belong&0377777777 043000507 NetBSD/vax 1k core
+>12 string >\0 from '%s'
+
+0 belong&0377777777 045400413 NetBSD/vax 4k 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 belong&0377777777 045400410 NetBSD/vax 4k pure
+>0 byte &0x80 dynamically linked executable
+>0 byte ^0x80 executable
+>16 lelong >0 not stripped
+0 belong&0377777777 045400407 NetBSD/vax 4k
+>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&0377777777 045400507 NetBSD/vax 4k core
>12 string >\0 from '%s'
# NetBSD/alpha does not support (and has never supported) a.out objects,
+++ /dev/null
-LOOK AT THE README!! THE DOCUMENTATION IS ONE DELTA OUT OF SYNC
-WITH THE SOURCE CODE. THIS IS AN INTERIM RELEASE ONLY. DO NOT
-REPEAT DO NOT REDISTRIBUTE THIS RELEASE OR INCORPORATE IT INTO
-ANYTHING. CONTACT THE AUTHOR FOR FURTHER INSTRUCTIONS. STOP.
-
-This interim release is just to let a few friends have a look at
-it and make some last-minute changes before I go public with
-this release. The real release should be in a week or two.
-If you can, hold off until then. Thanks for your cooperation.
-
-$Id: AAWARN.TXT,v 1.2 1992/06/30 13:38:50 ian Exp $
+++ /dev/null
-Portability of the new file(1) command.
-@(#) $Id: PORTING,v 1.11 1993/09/23 21:47:23 christos Exp $
-
-Read this file only if the program doesn't compile on your system.
-
-This release has been around UNIX; it has been compiled and tested
-in the following environments:
-
-SunOS sqarc 4.1.1 8 sun4
- No problems.
-ULTRIX squint 4.2 0 RISC
- No problems.
-A/UX sqmac 3.0a9 SVR22 mc68020
- No problems.
-AIX sqibm 2 3 000XXXXXX100
- Had weird "make" problems making "magic" file automatically; just
- built it by hand. Your mileage may vary.
-SCO sqwang 3.2 2 i386
- Compiles fine; their weird make can't handle "[a-z]*" as a dependancy,
- so build magic by hand. Runs fine.
-sqzme sqzme 3.1.1 3 3B2
- The 3B2 SVR3 needed a few tweaks as well as COPTS = -Ilocalinc
- in order to compile.
-
-This version, reluctanly, includes <stdlib.h>, which won't exist
-on older systems or those that aren't even close to the ANSI C
-standard. There is a null "stdlib.h", and some other bogus headers,
-in subdirectory "localinc"; if you get complaints about missing
-stdlib.h and others, uncomment the line with COPTS=-Ilocalinc
-in the Makefile, and try again.
-
-You must have either <stdarg.h> or the older <varargs.h>, otherwise you'll
-have to butcher some routines in print.c.
-
-Beyond that, I have tried to make a program that doesn't need any
-command-line defines (-D) to specify what version of UNIX is in use,
-by using the definitions available in the system #include
-files. For example, the lstat(2) call is normally found in
-4BSD systems, but might be grafted into some other variant
-of UNIX. If it's done right (ie., using the same definitions),
-my program will compile and work correctly. Look at the #ifdefs
-to see how it's done.
-
-I've also tried to include source for all the non-portable library routines
-I used (getopt, str*). Non-portable here means `not in every
-reasonably standard UNIX out there: V7, System V, 4BSD'.
-These are in subdirectory "localsrc", and not used unless you
-need them; again, see the Makefile.
-
-There is one area that just might cause problems. On System
-V, they moved the definition of major() and minor() out of
-<sys/types.h> into <sys/sysmacros.h>. Hence, if major isn't
-defined after including types.h, I automatically include sys/sysmacros.h.
-This will work for 99% of the systems out there. ONLY if you
-have a system in which neither types.h nor sysmacros.h defines
-`major' will this automatic include fail (I hope). On such
-systems, you will get a compilation error in trying to compile
-a warning message. Please do the following:
-
- 1) change the appropriate #include at the start of fsmagic.c
-and 2) let me know the name of the system, the release number,
- and the name of the header file that *does* include
- this "standard" definition.
-
-If you are running the old Ritchie PDP-11 C compiler or
-some other compiler that doesn't know about `void', you will have
-to include `-Dvoid=int' in the variable COPTS in the Makefile.
-
-Other than this, there should be no portability problems,
-but one never knows these days. Please let me know of any
-other problems you find porting to a UNIX system. I don't much
-care about non-UNIX systems but will collect widely-used magic
-numbers for them as well as for UNIX systems.
-
-Mark Moraes and Christos Zoulas
-(address in README)
+++ /dev/null
-This directory has two files, dist.src and dist.magic.
-They are both shar (shell archive) files; to unpack, just
-run them through /bin/sh.
-
-dist.src contains only the source code, Makefile, and various odds and ends.
-
-dist.magic contains only the pieces to make up /etc/magic.
-
-See README, LEGAL.NOTICE, and PORTING for more information.
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.28 1998/09/12 13:17:52 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.29 1999/10/31 22:23:03 christos Exp $")
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
struct magic *m;
char *t, *s;
-#define ALLOC_INCR 20
+#define ALLOC_INCR 200
if (nd+1 >= maxmagic){
maxmagic += ALLOC_INCR;
if ((magic = (struct magic *) realloc(magic,
}
/* get type, skip it */
- if (strncmp(l, "byte", NBYTE)==0) {
+ if (strncmp(l, "char", NBYTE)==0) { /* HP/UX compat */
+ m->type = BYTE;
+ l += NBYTE;
+ } else if (strncmp(l, "byte", NBYTE)==0) {
m->type = BYTE;
l += NBYTE;
} else if (strncmp(l, "short", NSHORT)==0) {
case '=':
m->reln = *l;
++l;
+ if (*l == '=') {
+ /* HP compat: ignore &= etc. */
+ ++l;
+ }
break;
case '!':
if (m->type != STRING) {
* using method, return sizeof new
*/
#include "file.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <sys/wait.h>
#endif
#ifndef lint
-FILE_RCSID("@(#)$Id: compress.c,v 1.13 1999/02/14 17:16:01 christos Exp $")
+FILE_RCSID("@(#)$Id: compress.c,v 1.14 1999/10/31 22:23:03 christos Exp $")
#endif
* 4. This notice may not be removed or altered.
*/
#include "file.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "patchlevel.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: file.c,v 1.46 1999/02/14 17:16:05 christos Exp $")
+FILE_RCSID("@(#)$Id: file.c,v 1.47 1999/10/31 22:23:03 christos Exp $")
#endif /* lint */
case 'v':
(void) fprintf(stdout, "%s-%d.%d\n", progname,
FILE_VERSION_MAJOR, patchlevel);
+ (void) fprintf(stdout, "magic file from %s\n",
+ magicfile);
return 1;
case 'b':
++bflag;
*/
#include "file.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#undef HAVE_MAJOR
#ifndef lint
-FILE_RCSID("@(#)$Id: fsmagic.c,v 1.29 1999/02/14 17:16:08 christos Exp $")
+FILE_RCSID("@(#)$Id: fsmagic.c,v 1.30 1999/10/31 22:23:03 christos Exp $")
#endif /* lint */
int
return 1;
}
+#ifdef S_ISUID
if (sb->st_mode & S_ISUID) ckfputs("setuid ", stdout);
+#endif
+#ifdef S_ISGID
if (sb->st_mode & S_ISGID) ckfputs("setgid ", stdout);
+#endif
+#ifdef S_ISVTX
if (sb->st_mode & S_ISVTX) ckfputs("sticky ", stdout);
+#endif
switch (sb->st_mode & S_IFMT) {
case S_IFDIR:
ckfputs("directory", stdout);
return 1;
+#ifdef S_IFCHR
case S_IFCHR:
/*
* If -s has been specified, treat character special files
(void) printf("character special");
#endif
return 1;
+#endif
+#ifdef S_IFBLK
case S_IFBLK:
/*
* If -s has been specified, treat block special files
(void) printf("block special");
#endif
return 1;
+#endif
/* TODO add code to handle V7 MUX and Blit MUX files */
#ifdef S_IFIFO
case S_IFIFO:
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#if __STDC__
+#ifdef __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#include <time.h>
#ifndef lint
-FILE_RCSID("@(#)$Id: print.c,v 1.28 1999/02/14 17:16:10 christos Exp $")
+FILE_RCSID("@(#)$Id: print.c,v 1.29 1999/10/31 22:23:04 christos Exp $")
#endif /* lint */
#define SZOF(a) (sizeof(a) / sizeof(a[0]))
#include "readelf.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.10 1999/02/14 17:16:10 christos Exp $")
+FILE_RCSID("@(#)$Id: readelf.c,v 1.11 1999/10/31 22:23:04 christos Exp $")
#endif
#ifdef ELFCORE
for ( ; num; num--) {
if (read(fd, sh_addr, size) == -1)
error("read failed (%s).\n", strerror(errno));
- if (shs_type == SHT_SYMTAB || shs_type == SHT_DYNSYM) {
+ if (shs_type == SHT_SYMTAB /* || shs_type == SHT_DYNSYM */) {
(void) printf (", not stripped");
return;
}