You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/08/18 01:09:21 UTC

DO NOT REPLY [Bug 22493] New: - mod_mime_magic "unexpected state 3" on C/C++ source code files whose contents begins with "/*"; results in files not showing up in directory index listing

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22493>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22493

mod_mime_magic "unexpected state 3" on C/C++ source code files whose contents begins with "/*"; results in files not showing up in directory index listing

           Summary: mod_mime_magic "unexpected state 3" on C/C++ source code
                    files whose contents begins with "/*"; results in files
                    not showing up in directory index listing
           Product: Apache httpd-2.0
           Version: 2.0.47
          Platform: PC
               URL: http://bwiberg.idz.net/kurser/exjobb/files/
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_mime_magic
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: bjorn.wiberg@home.se


When viewing a directory index listing (Fancy Indexing) with mod_mime_magic
loaded, some C/C++ source code/header files (.c, .cc, .h) disappear from the
listing.

All these files begin with C/C++ multiline comments (i.e., begin with /*).

The error message given is:
[Mon Aug 18 00:34:46 2003] [error] [client xx.xxx.xxx.xxx] mod_mime_magic: unexp
ected state 3; could be caused by bad data in magic file, referer: http://bwiber
g.dyndns.org/kurser/exjobb/files/

The example files are:
http://bwiberg.idz.net/kurser/exjobb/files/miscellaneous/endian.c
http://bwiberg.idz.net/kurser/exjobb/files/trace-based%20simulation/sourcedrop_errmodel.cc
http://bwiberg.idz.net/kurser/exjobb/files/trace-based%20simulation/sourcedrop_errmodel.h

The magic file used is the one bundled with Apache ("magic"):

MD5 checksum:
d6fe64c5fe7b01857ba643f3405b3da7 *magic
d6fe64c5fe7b01857ba643f3405b3da7 *magic.default

2003-07-09  14:37            13 341 magic
2002-03-26  10:41            13 341 magic.default

An example directory listing (where files are missing) is shown below:

                  Index of /kurser/exjobb/files/miscellaneous

 Icon   Name                    Last modified      Size  Description
  __________________________________________________________________________
 [DIR]  Parent Directory                             -
 [CMP]  miscellaneous.tar.gz    20-Jun-2003 14:52  3.2K  GZIP compressed document
 [TXT]  scale_test.pl           21-Aug-2002 12:46  6.1K  Perl script
  __________________________________________________________________________


Changing the contents of the .c/.cc/.h files so that they begin with something
else, e.g. a slash followed by a newline and then asterisks, makes the files
appear in the directory index listing as they should. (Of course, that breaks
the C/C++ source code.) Disabling mod_mime_magic is another workaround. The
correct directory listing is shown below:

                  Index of /kurser/exjobb/files/miscellaneous

 Icon   Name                    Last modified      Size  Description
  __________________________________________________________________________
 [DIR]  Parent Directory                             -
 [   ]  endian.c                03-Nov-2002 16:38  1.7K
 [CMP]  miscellaneous.tar.gz    20-Jun-2003 14:52  3.2K  GZIP compressed document
 [   ]  scale_test.pl           21-Aug-2002 12:46  6.1K  Perl script
  __________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org