]> granicus.if.org Git - file/commitdiff
Recent changes FILE3_28
authorChristos Zoulas <christos@zoulas.com>
Sun, 31 Oct 1999 22:23:03 +0000 (22:23 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 31 Oct 1999 22:23:03 +0000 (22:23 +0000)
12 files changed:
magic/Magdir/amanda
magic/Magdir/audio
magic/Magdir/netbsd
src/AAWARN.TXT [deleted file]
src/PORTING [deleted file]
src/README.ftp [deleted file]
src/apprentice.c
src/compress.c
src/file.c
src/fsmagic.c
src/print.c
src/readelf.c

index 57c4359fc169b3a9b7a9a7c63ebf0bd0f01da6ca..2b9565083ee0f63681a970f0e18dd89942cdd08b 100644 (file)
@@ -1,7 +1,10 @@
 #------------------------------------------------------------------------------
 # 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
index 93ba187582e92d646deb56b9657abe238e2d5564..cb051c8efb3fc0a5b7d658e03302383bef3d9593 100644 (file)
 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
index 2ab15b317886c43ce061d045bdc175c3688bf4a9..3b50b08c160c41a57f60040733e8eeb3de5174e6 100644 (file)
 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,
diff --git a/src/AAWARN.TXT b/src/AAWARN.TXT
deleted file mode 100644 (file)
index 087041f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-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 $
diff --git a/src/PORTING b/src/PORTING
deleted file mode 100644 (file)
index 06790e6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-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)
diff --git a/src/README.ftp b/src/README.ftp
deleted file mode 100644 (file)
index da90983..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-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.
index d1dcd3367b375d0e2f6545a2c932776e29e00aef..46ac353d129ceefb0d426e3d5c37dc02fb962871 100644 (file)
@@ -33,7 +33,7 @@
 #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) && \
@@ -182,7 +182,7 @@ int *ndx, check;
        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, 
@@ -291,7 +291,10 @@ int *ndx, check;
        }
 
        /* 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) {
@@ -346,6 +349,10 @@ int *ndx, check;
        case '=':
                m->reln = *l;
                ++l;
+               if (*l == '=') {
+                  /* HP compat: ignore &= etc. */
+                  ++l;
+               }
                break;
        case '!':
                if (m->type != STRING) {
index 6020cedc2b2d60a0e5371c57278e66d84d6e1a20..951f864f554a839f9f786951cd93d134e4ab81e6 100644 (file)
@@ -6,6 +6,9 @@
  *                                         using method, return sizeof new
  */
 #include "file.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef HAVE_UNISTD_H
@@ -16,7 +19,7 @@
 #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
 
 
index 9000f745b21a1e7adcf96a3a0baf7dce72856e0e..dc64bdb1b9810c6321a72573898e2b8e2b192b3a 100644 (file)
@@ -25,6 +25,9 @@
  * 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>
@@ -52,7 +55,7 @@
 #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 */
 
 
@@ -120,6 +123,8 @@ main(argc, argv)
                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;
index 9fd74f8cb6fd9a5688f0029105aa692ba004607c..ef5b5fbde31126283b4c24ec344be9441f3bf540 100644 (file)
@@ -26,6 +26,9 @@
  */
 
 #include "file.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -54,7 +57,7 @@
 #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
@@ -83,14 +86,21 @@ struct stat *sb;
                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
@@ -113,6 +123,8 @@ struct stat *sb;
                (void) printf("character special");
 #endif
                return 1;
+#endif
+#ifdef S_IFBLK
        case S_IFBLK:
                /* 
                 * If -s has been specified, treat block special files
@@ -135,6 +147,7 @@ struct stat *sb;
                (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:
index 146e8bb3153854b7c440feebabe24d3b64f185a2..03f9b0c5b04134594801d357e7e7dc88b2e42076 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
-#if __STDC__
+#ifdef __STDC__
 # include <stdarg.h>
 #else
 # include <varargs.h>
@@ -41,7 +41,7 @@
 #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]))
index daaf431e8d7ba25620215ba8b1434889caa0e9c0..74ee33259078793d7692fef0dcc650033c65df84 100644 (file)
@@ -14,7 +14,7 @@
 #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
@@ -147,7 +147,7 @@ doshn(class, swap, fd, off, num, size)
        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;
                }