Hello, Please see exact details further down, but first two comments: There is a workaround for STR #3059 by way of a configuration change in mime.types. application/x-shell sh application/x-shell printable(0,1024) + string(0,#!) +\ (contains(2,80,/bash) contains(2,80,/ksh)\ contains(2,80,/sh) contains(2,80,/zsh)) or application/x-shell sh (printable(0,1024) + string(0,#!) +\ (contains(2,80,/bash) contains(2,80,/ksh)\ contains(2,80,/sh) contains(2,80,/zsh))) and similarly for application/x-cshell application/x-perl The workaround for STR #3055 is adding "-odocument-name=<the doc name>" +++ This bug was initially created as a clone of Bug #426089 +++ Description of problem: By my understanding the default installed mime.convs and mime.types should correctly get the type of *.sh files to be application/x-shell. This doesn't happen. Version-Release number of selected component (if applicable): cups-1.3.7-6 How reproducible: Always. Steps to Reproduce: 1. lp -d printer -o prettyprint foo.bash Actual results: 1. error_log (debug level) has: envp[20]="CONTENT_TYPE=text/plain" Expected results: 1. The scheduler should auto-type as "application/x-shell". Additional info: 1. Typing: lp -d printer -o prettyprint -o document-format=application/x-shell foo.bash has CUPS mark the correct MIME type on the file. In error_log: envp[20]="CONTENT_TYPE=application/x-shell" --- Additional comment from twaugh on 2007-12-18 08:51:08 EDT --- The mime.types entry is this: application/x-shell sh printable(0,1024) + string(0,#!) +\ (contains(2,80,/bash) contains(2,80,/ksh)\ contains(2,80,/sh) contains(2,80,/zsh)) which checks that the first 1k of the file contains printable characters, that the first two characters are '#!' (the "shebang"), and that the first line contains of those recognised shell names. What does the first line of the shell script you are trying to print look like? --- Additional comment from ophers.il on 2007-12-18 10:19:29 EDT --- Hi, The file is in the attached zip archive. It has #!/bin/ksh as the first line. I split the application/x-shell entry in two: application/x-shell sh application/x-shell printable(0,1024) + string(0,#!) +\ (contains(2,80,/bash) contains(2,80,/ksh)\ contains(2,80,/sh) contains(2,80,/zsh)) restarted cups and now both `foo.sh' and `foo.ksh' (exact same content) are typed correctly :). The head of mime.types documents that: Multiple occurrences of a type will cause the provided rules to be appended to the existing definition. so the two forms should be equivalent. It seems not to be the case. --- Additional comment from ophers.il on 2007-12-18 10:51:03 EDT --- Hey, further testing showed this to work too!! application/x-shell sh sh printable(0,1024) + string(0,#!) +\ (contains(2,80,/bash) contains(2,80,/ksh)\ contains(2,80,/sh) contains(2,80,/zsh)) notice `sh' is doubled. --- Additional comment from twaugh on 2008-01-08 13:11:06 EDT --- I think this might be to do with a bug I just filed upstream: http://cups.org/str.php?L2659 --- Additional comment from twaugh on 2008-02-26 11:39:06 EDT --- Believed fixed in 1.3.6-2.fc8. --- Additional comment from ophers.il on 2009-01-06 08:52:29 EDT --- I don't believe this is so. Please look at scheduler/ipp.c line 7637: doc_name = ippFindAttribute(con->request, "document-name", IPP_TAG_NAME); filetype = mimeFileType(MimeDatabase, con->filename, doc_name ? doc_name->values[0].string.text : NULL, &compression); The scheduler is looking for an attribute "document-name", BUT the client ONLY sends this attribute when printing more than one file per job: in cups/util.c this attribute is sent in cupsPrintFiles2, BUT cupsDoFileRequest in cups/request.c does not. Filed STR #3055 upstream. --- Additional comment from ophers.il on 2009-01-12 03:44:26 EDT --- I'm afraid the fat lady has not sung yet :) Further code review revealed a bug(?) in function mimeAddTypeRule() in scheduler/type.c that is the *real* culprit. Please see STR #3059 (that I've filed upstream) for details. The code for v1.4 is the same so this is not resolved for Fedora 11 either at this point. Regards, Opher Shachar.
*** Bug 479471 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1360.html