sniper Tue Nov 4 00:15:56 2003 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/mime_magic phpmimemagic.h
Modified files:
/php-src/ext/mime_magic mime_magic.c mime_magic.dsp
php_mime_magic.h
Log:
MFH: Possible fix for bug #26103
Index: php-src/ext/mime_magic/mime_magic.c
diff -u php-src/ext/mime_magic/mime_magic.c:1.13.2.10
php-src/ext/mime_magic/mime_magic.c:1.13.2.11
--- php-src/ext/mime_magic/mime_magic.c:1.13.2.10 Mon Oct 20 10:37:02 2003
+++ php-src/ext/mime_magic/mime_magic.c Tue Nov 4 00:15:55 2003
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe [EMAIL PROTECTED] |
+--+
- $Id: mime_magic.c,v 1.13.2.10 2003/10/20 14:37:02 iliaa Exp $
+ $Id: mime_magic.c,v 1.13.2.11 2003/11/04 05:15:55 sniper Exp $
This module contains a lot of stuff taken from Apache mod_mime_magic,
so the license section is a little bit longer than usual:
@@ -156,6 +156,7 @@
#include php_ini.h
#include ext/standard/info.h
#include php_mime_magic.h
+#include phpmimemagic.h
#include fcntl.h
#include sys/types.h
Index: php-src/ext/mime_magic/mime_magic.dsp
diff -u php-src/ext/mime_magic/mime_magic.dsp:1.1
php-src/ext/mime_magic/mime_magic.dsp:1.1.4.1
--- php-src/ext/mime_magic/mime_magic.dsp:1.1 Thu Aug 22 09:16:03 2002
+++ php-src/ext/mime_magic/mime_magic.dsp Tue Nov 4 00:15:55 2003
@@ -103,6 +103,10 @@
SOURCE=.\php_mime_magic.h
# End Source File
+# Begin Source File
+
+SOURCE=.\phpmimemagic.h
+# End Source File
# End Group
# End Target
# End Project
Index: php-src/ext/mime_magic/php_mime_magic.h
diff -u php-src/ext/mime_magic/php_mime_magic.h:1.4.4.1
php-src/ext/mime_magic/php_mime_magic.h:1.4.4.2
--- php-src/ext/mime_magic/php_mime_magic.h:1.4.4.1 Tue Dec 31 11:34:54 2002
+++ php-src/ext/mime_magic/php_mime_magic.h Tue Nov 4 00:15:55 2003
@@ -15,360 +15,12 @@
| Author: |
+--+
- $Id: php_mime_magic.h,v 1.4.4.1 2002/12/31 16:34:54 sebastian Exp $
+ $Id: php_mime_magic.h,v 1.4.4.2 2003/11/04 05:15:55 sniper Exp $
*/
#ifndef PHP_MIME_MAGIC_H
#define PHP_MIME_MAGIC_H
-#define MIME_MAGIC_DEBUG0
-
-#define MIME_BINARY_UNKNOWNapplication/octet-stream
-#define MIME_TEXT_UNKNOWNtext/plain
-
-#define MAXMIMESTRING256
-
-#define MIME_MAGIC_OK 0
-#define MIME_MAGIC_DECLINED -1
-#define MIME_MAGIC_DONE -2
-#define MIME_MAGIC_ERROR -3
-
-#define DIR_MAGIC_TYPE httpd/unix-directory
-
-/* HOWMANY must be at least 4096 to make gzip -dcq work */
-#define HOWMANY4096
-/* SMALL_HOWMANY limits how much work we do to figure out text files */
-#define SMALL_HOWMANY 1024
-#define MAXDESC50 /* max leng of text description */
-#define MAXstring 64 /* max leng of string types */
-
-struct magic {
-struct magic *next;/* link to next entry */
-int lineno;/* line number from magic file */
-
-short flag;
-#define INDIR1 /* if '(...)' appears, */
-#defineUNSIGNED 2 /* comparison is unsigned */
-short cont_level; /* level of */
-struct {
- char type; /* byte short long */
- long offset;/* offset from indirection */
-} in;
-long offset; /* offset to magic number */
-unsigned char reln;/* relation (0=eq, ''=gt, etc) */
-char type; /* int, short, long or string. */
-char vallen; /* length of string value, if any */
-#define BYTE1
-#define SHORT2
-#define LONG4
-#define STRING5
-#define DATE6
-#define BESHORT7
-#define BELONG8
-#define BEDATE9
-#define LESHORT10
-#define LELONG11
-#define LEDATE12
-union VALUETYPE {
- unsigned char b;
- unsigned short h;
- unsigned long l;
- char s[MAXstring];
- unsigned char hs[2];/* 2 bytes of a fixed-endian short */
- unsigned char hl[4];/* 2 bytes of a fixed-endian long */
-} value; /* either number or string */
-unsigned long mask;/* mask before comparison with value */
-char nospflag; /* supress space character */
-
-/* NOTE: this string is suspected of overrunning - find it! */
-char desc[MAXDESC];/* description */
-};
-
-/*
- * data structures for tar file recognition
- * --
- * Header file for public domain tar (tape archive) program.
- *
- * @(#)tar.h 1.20 86/10/29Public Domain. Created 25 August 1985 by John
- * Gilmore, ihnp4!hoptoad!gnu.
- *
- * Header