Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Prior to this update, file patterns for LaTeX checked only the first 400 bytes of a file to determine the pattern type. This caused an incorrect pattern type recognition as some files could have contained a larger number of comments at the beginning of the file. Furthermore, file patterns which matched a Python script were tried before the LaTex patterns and this undesired behavior could have caused an incorrect pattern type recognition as LaTex files could have included a source code written in Python. With this update, the aforementioned problems have been fixed by increasing the number of first bytes checked for a LaTex file to 4096 bytes, and by trying the LaTex patterns before the Python patterns.
Description of problem:
Version-Release number of selected component (if applicable):
file-5.04-6.el6
How reproducible:
always
Steps to Reproduce:
# rpm -ql PyXML | grep -F .tex | xargs file
/usr/share/doc/PyXML-0.8.4/xml-howto.tex: Python script text executable
/usr/share/doc/PyXML-0.8.4/xml-ref.tex: Python script text executable
# rpm -ql emacs-common | grep -F .tex | xargs file
/usr/share/emacs/23.1/etc/refcards/calccard.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/cs-dired-ref.tex: ISO-8859 English text
/usr/share/emacs/23.1/etc/refcards/cs-refcard.tex: TeX document text
/usr/share/emacs/23.1/etc/refcards/cs-survival.tex: LaTeX document text
/usr/share/emacs/23.1/etc/refcards/de-refcard.tex: TeX document text
/usr/share/emacs/23.1/etc/refcards/dired-ref.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/fr-dired-ref.tex: ISO-8859 English text
/usr/share/emacs/23.1/etc/refcards/fr-refcard.tex: TeX document text
/usr/share/emacs/23.1/etc/refcards/fr-survival.tex: LaTeX document text
/usr/share/emacs/23.1/etc/refcards/gnus-refcard.tex: LaTeX 2e document text
/usr/share/emacs/23.1/etc/refcards/orgcard.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/pl-refcard.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/pt-br-refcard.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/refcard.tex: ASCII English text
/usr/share/emacs/23.1/etc/refcards/ru-refcard.tex: LaTeX 2e document text
/usr/share/emacs/23.1/etc/refcards/sk-dired-ref.tex: ISO-8859 English text
/usr/share/emacs/23.1/etc/refcards/sk-refcard.tex: TeX document text
/usr/share/emacs/23.1/etc/refcards/sk-survival.tex: LaTeX document text
/usr/share/emacs/23.1/etc/refcards/survival.tex: LaTeX document text
/usr/share/emacs/23.1/etc/refcards/vipcard.tex: TeX document text
/usr/share/emacs/23.1/etc/refcards/viperCard.tex: TeX document text
#
Actual results:
Expected results:
There are 2 problems:
1. File patterns for LaTeX check only first 400 bytes of file to determine its type and some of those files have long comment in the beginning, I will increase that limit.
2. Patterns which match Python script are tried before Latex which is bad in case there's python code in latex.
I'll send patch to upstream mailing list and then attach it here.
Created attachment 477581[details]
proposed patch
Check 4096 bytes from TeX file instead of 400 bytes. Increate strength of TeX patterns to beat Python, because it's more usual to have Python in LaTeX than LaTeX in Python.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Prior to this update, file patterns for LaTeX checked only the first 400 bytes of a file to determine the pattern type. This caused an incorrect pattern type recognition as some files could have contained a larger number of comments at the beginning of the file. Furthermore, file patterns which matched a Python script were tried before the LaTex patterns and this undesired behavior could have caused an incorrect pattern type recognition as LaTex files could have included a source code written in Python. With this update, the aforementioned problems have been fixed by increasing the number of first bytes checked for a LaTex file to 4096 bytes, and by trying the LaTex patterns before the Python patterns.
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-2011-0934.html