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.

Bug 1771242

Summary: file is recognized as "Linux Journalled Flash File system" if the beginning of the file content is "1984"
Product: Red Hat Enterprise Linux 7 Reporter: Jing Huo <jhuo>
Component: fileAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.7CC: jhuo, kdudka, kvolny
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: file-5.11-37.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1773477 (view as bug list) Environment:
Last Closed: 2020-09-29 19:53:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1773477    
Bug Blocks:    

Description Jing Huo 2019-11-12 03:00:03 UTC
Description of problem:

Version-Release number of selected component (if applicable):
RHEL 6, RHEL 7, RHEL 8

How reproducible:
I easily reproduced the issue on RHEL 6.7,RHEL 7.7, RHEL 8.0.

use RHEL 7.7 as example:

[root@vm77 tmp]# uname -a
Linux vm77 3.10.0-1062.el7.x86_64 #1 SMP Thu Jul 18 20:25:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@vm77 tmp]# rpm -qa file
file-5.11-35.el7.x86_64

Steps to Reproduce:
1.
create a file with content "1984"

[root@vm77 tmp]# vi test
[root@vm77 tmp]# cat test 
1984
[root@vm77 tmp]# file test 
test: Linux Journalled Flash File system, little endian

2.
change file content to "1985", the file is recognized as "ASCII text"

[root@vm77 tmp]# cat test 
1985
[root@vm77 tmp]# file test 
test: ASCII text

3.

Actual results:

[root@vm77 tmp]# cat test 
1984
[root@vm77 tmp]# file test 
test: Linux Journalled Flash File system, little endian

Expected results:

the text file should be recognized as "ASCII text"

[root@vm77 tmp]# cat test 
1985
[root@vm77 tmp]# file test 
test: ASCII text

Additional info:

Comment 2 Kamil Dudka 2019-11-12 08:49:45 UTC
I can see that 0x1984 is magic of an old JFFS2 file system format:

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/uapi/linux/jffs2.h?h=v5.3.10#n24

I need to double check it but there might be a mistake in file's magic database that the pattern is ASCII encoded while it should be binary encoded.

Comment 3 Kamil Dudka 2019-11-12 09:43:27 UTC
I have proposed a patch upstream:

https://mailman.astron.com/pipermail/file/2019-November/000231.html

Comment 4 Kamil Dudka 2019-11-16 23:02:09 UTC
upstream commit:

https://github.com/file/file/commit/FILE5_37-108-g5ad78c72

Comment 5 Kamil Dudka 2019-11-18 10:43:33 UTC
fixed in file-5.37-9.fc32:

https://src.fedoraproject.org/rpms/file/c/ca697060

Comment 12 errata-xmlrpc 2020-09-29 19:53:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (file bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3917