>Number: 4389 >Category: mod_mime >Synopsis: MIME type for files ending with .xls aren't set anymore >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Tue May 11 17:50:01 PDT 1999 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.6 >Environment: # uname -a SunOS amazon 5.6 Generic_105181-13 sun4m sparc SUNW,SPARCstation-5
The cc compiler used to compile httpd was the Sun C compiler version 3.0 >Description: We store Excel files (ending with .xls) on Solaris machine and our developers access these Excel files from their PCs using Netscape 4.5. It was working fine, until I applied these Solaris patches to the machine : 105633-20 105181-13 105490-07 105669-07 106125-06 106292-03 Now a URL for a .xls gets interpreted as if its content type were text/plain. If I use Internet Explorer 5.0 then the Excel file is viewed properly. If I view a Word document (ending with .doc) with Netscape 4.5 is is viewed properly. Thus the problem seems to be pertinent to files ending with .xls. I should emphasize that this working a week ago. The Apache Web server hasn't been recompiled. I called Sun but they are a bit puzzled to say the least. I did some investigation : # /usr2/apache_1.3.6/bin/httpd -X # ps -ef | grep httpd nobody 6578 6451 0 19:01:33 ? 0:00 /usr2/apache_1.3.6/bin/httpd This is what happens when I try to view http://amazon.mt.att.com/~roque/deepthoughts.xls with Netscape 4.5 (Notice "C o n t e n t - T y p e : t e x t / p l a i n") : # truss -a -e -v all -r all -w all -p 6578 psargs: /usr2/apache_1.3.6/bin/httpd fcntl(18, F_SETLKW, 0xEF770020) (sleeping...) fcntl(18, F_SETLKW, 0xEF770020) = 0 typ=F_WRLCK whence=SEEK_SET start=0 len=0 sys=0 pid=0 accept(15, 0xEFFFEB04, 0xEFFFEB14) (sleeping...) accept(15, 0xEFFFEB04, 0xEFFFEB14) = 3 name = 135.21.26.234/34282 fcntl(18, F_SETLKW, 0xEF76FFFC) = 0 typ=F_UNLCK whence=SEEK_SET start=0 len=0 sys=0 pid=0 sigaction(SIGUSR1, 0xEFFFE9C0, 0xEFFFEA40) = 0 new: hand = 0x00000001 mask = 0 0 0 0 flags = 0x0000 old: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 getsockname(3, 0xEFFFEAF4, 0xEFFFEB14) = 0 name = 135.21.26.234/80 setsockopt(3, 6, 1, 0xEFFFEA7C, 4) = 0 read(3, 0x0002AE78, 4096) = 346 G E T / ~ r o q u e / d e e p t h o u g h t s . x l s H T T P / 1 . 0\r\n R e f e r e r : h t t p : / / a m a z o n . m t . a t t . c o m / ~ r o q u e /\r\n C o n n e c t i o n : K e e p - A l i v e\r\n U s e r - A g e n t : M o z i l l a / 4 . 5 [ e n ] ( X 1 1 ; I ; S u n O S 5 . 6 s u n 4 m ) \r\n H o s t : a m a z o n . m t . a t t . c o m\r\n A c c e p t : i m a g e / g i f , i m a g e / x - x b i t m a p , i m a g e / j p e g , i m a g e / p j p e g , i m a g e / p n g , * / *\r\n A c c e p t - E n c o d i n g : g z i p\r\n A c c e p t - L a n g u a g e : e n\r\n A c c e p t - C h a r s e t : i s o - 8 8 5 9 - 1 , * , u t f - 8\r\n\r\n sigaction(SIGUSR1, 0xEFFFC8F0, 0xEFFFC970) = 0 new: hand = 0x00000001 mask = 0 0 0 0 flags = 0x0000 old: hand = 0x00000001 mask = 0 0 0 0 flags = 0x0000 time() = 926464228 door_info(4, 0xEFFFE3B0) = 0 door_call(4, 0xEFFFE398) = 0 stat("/export/home/roque/public_html/deepthoughts.xls", 0x000589E0) = 0 d=0x0080001F i=83082 m=0100644 l=1 u=1470 g=10 sz=42496 at = May 11 12:48:59 EDT 1999 [ 926441339 ] mt = Aug 31 19:29:37 EDT 1998 [ 904606177 ] ct = Aug 31 19:29:37 EDT 1998 [ 904606177 ] bsz=8192 blks=84 fs=ufs open("/.htaccess", O_RDONLY) Err#2 ENOENT open("/export/.htaccess", O_RDONLY) Err#2 ENOENT open("/export/home/.htaccess", O_RDONLY) Err#2 ENOENT open("/export/home/roque/.htaccess", O_RDONLY) Err#2 ENOENT open("/export/home/roque/public_html/.htaccess", O_RDONLY) Err#2 ENOENT open("/export/home/roque/public_html/deepthoughts.xls", O_RDONLY) = 6 mmap(0x00000000, 42496, PROT_READ, MAP_PRIVATE, 6, 0) = 0xEF480000 writev(3, 0xEFFFE818, 2) = 33056 iov_base = 0x000568D0 iov_len = 288 H T T P / 1 . 1 2 0 0 O K\r\n D a t e : T u e , 1 1 M a y 1 9 9 9 2 3 : 1 0 : 2 8 G M T\r\n S e r v e r : A p a c h e / 1 . 3 . 6 ( U n i x )\r\n L a s t - M o d i f i e d : M o n , 3 1 A u g 1 9 9 8 2 3 : 2 9 : 3 7 G M T\r \n E T a g : " 1 4 4 8 a - a 6 0 0 - 3 5 e b 3 1 e 1 "\r\n A c c e p t - R a n g e s : b y t e s\r\n C o n t e n t - L e n g t h : 4 2 4 9 6\r\n K e e p - A l i v e : t i m e o u t = 1 5 , m a x = 1 0 0\r\n C o n n e c t i o n : K e e p - A l i v e\r\n C o n t e n t - T y p e : t e x t / p l a i n\r\n\r\n iov_base = 0xEF480000 iov_len = 32768 D0CF11E0A1B11AE1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 >\003\0FEFF\t\0 06\0\0\0\0\0\0\0\0\0\0\001\0\0\0 P\0\0\0\0\0\0\0\010\0\0FEFFFFFF \0\0\0\0FEFFFFFF\0\0\0\0 O\0\0\0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF \t\b10\0\00605\0D310CC07C9\0\0\006\0\0\0E1\002\0B004C1\002\0\0\0 E2\0\0\0 \\0 p\010\0\0 s h a b n a m m e r c h a n t ...bytes skipped... FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF llseek(6, 0, SEEK_CUR) = 0 close(6) = 0 time() = 926464229 time() = 926464229 write(17, 0x000598A0, 177) = 177 1 3 5 . 2 1 . 2 6 . 2 3 4 - - [ 1 1 / M a y / 1 9 9 9 : 1 9 : 1 0 : 2 9 - 0 4 0 0 ] " G E T / ~ r o q u e / d e e p t h o u g h t s . x l s H T T P / 1 . 0 " 2 0 0 4 2 4 9 6 " h t t p : / / a m a z o n . m t . a t t . c o m / ~ r o q u e / " " M o z i l l a / 4 . 5 [ e n ] ( X 1 1 ; I ; S u n O S 5 . 6 s u n 4 m ) "\n munmap(0xEF480000, 42496) = 0 sigaction(SIGUSR1, 0xEFFFE9C0, 0xEFFFEA40) = 0 new: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 old: hand = 0x00000001 mask = 0 0 0 0 flags = 0x0000 read(3, 0x0002AE78, 4096) (sleeping...) Received signal #14, SIGALRM, in read() [caught] siginfo: SIGALRM pid=6451 uid=0 read(3, 0x0002AE78, 4096) Err#4 EINTR close(3) = 0 getcontext(0xEFFFC3E8) setcontext(0xEFFFC3E8) sigaction(SIGURG, 0xEFFFE9C0, 0xEFFFEA40) = 0 new: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 old: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 sigaction(SIGALRM, 0xEFFFE9C0, 0xEFFFEA40) = 0 new: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 old: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 sigaction(SIGUSR1, 0xEFFFE9C0, 0xEFFFEA40) = 0 new: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 old: hand = 0xEF5B88C4 mask = 0 0 0 0 flags = 0x0000 fcntl(18, F_SETLKW, 0xEF770020) (sleeping...) This explains why the Excel file is being interpreted as a text file. The reason why the httpd daemon couldn't figure the MIME type is still unknown to me. >How-To-Repeat: Unfortunately our Web server is behind a firewall. I just wondered if other have reported this problem on Solaris 2.6 (after some patches are applied to the OS). >Fix: If we modify the mime.types file to look like this : amazon$ diff /usr2/apache_1.3.6/conf/mime.types /usr2/apache_1.3.6/conf/mime.types.default *** mime.types Tue May 11 19:55:23 1999 --- mime.types.default Wed Mar 24 17:55:55 1999 *************** *** 120 **** ! application/vnd.ms-excel xls --- 120 ---- ! application/vnd.ms-excel then it works. It may have other side effects too (because there are many terminations that can be used to Excel files). However, I don't like this workaround. It was working before with the standard mime.types in the Apache distribution and therefore it should keep working. I believe it is a bug in some Sun patch but I also realize it is very hard for them to track this problem down. Thus I write to you in hope that I'm not the only one having this problem and a fix exists. It would be great if you tell me which Apache C function might be yielding this behaviour so I could add some debug statements. >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]