Bug 2080014

Summary: zless doesn't display gzipped xml file
Product: [Fedora] Fedora Reporter: moschleg
Component: gzipAssignee: Jakub Martisko <jamartis>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: jamartis, kdudka, pstodulk
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-25 16:53:07 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:

Description moschleg 2022-04-28 18:04:20 UTC
Description of problem:
zless on Fedora 36 PreRelease does not work with gzipped text files. A dnf filelist gzipped file was attempted to be viewed with zless. zless stated the file was "binary" and asked to view it anyway.

Version-Release number of selected component (if applicable):


How reproducible:
Use "zless filename.gz" to view a "filename" that should be text (for example gzipped xml), zless fails to uncompress through gzip and tried to view the gz file directly showing binary data.

Steps to Reproduce:
1. use zless on Fedora 36 to view a gzipped text file, for example a dnf filelist.xml.gz
2. zless 7eec258c5aee56524c63da094fa8bd9c41b859f58a80f4356e92e9d438c88d74-filelists.xml.gz
3.

Actual results:
zless displays that the file is binary and asks to display it anyway
"7eec258c5aee56524c63da094fa8bd9c41b859f58a80f4356e92e9d438c88d74-filelists.xml.gz" may be a binary file.  See it anyway?

Expected results:
zless should uncompress the file through gzip and display the resulting plain text in a readable way

Additional info:
zless is a subcomponent of 'gzip' package, the version of gzip on Fedora 36 for this report was gzip-1.11-2.fc36.x86_64
To debug, the /usr/bin/zless script was modified to echo the values of :

echo "LESSOPEN: $LESSOPEN"
echo "check_exit_status: $check_exit_status"
echo "use_input_pipe_on_stdin: $use_input_pipe_on_stdin"

after the "LESSOPEN" export but before the call to 
exec less "$@"

the values of those three were:

LESSOPEN: ||-gzip -cdfq -- %s
check_exit_status: |
use_input_pipe_on_stdin: -

Comment 1 Ben Cotton 2023-04-25 17:03:30 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Jakub Martisko 2023-04-26 12:52:29 UTC
Hello, 

seems to work on my system (f37), are you still able to reproduce this?

Installed Packages
Name         : gzip
Version      : 1.12
Release      : 2.fc37
Architecture : x86_64
Size         : 381 k
Source       : gzip-1.12-2.fc37.src.rpm



[jamartis@jamartisT480s tmp]$ cat foo.xml 
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

[jamartis@jamartisT480s tmp]$ gzip foo.xml 
[jamartis@jamartisT480s tmp]$ zless foo.xml.gz
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

Comment 3 moschleg 2023-04-26 14:33:41 UTC
No, still broken here and I upgraded to Fedora 38 official

$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="38 (KDE Plasma)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (KDE Plasma)"
....

04/26 10:31 [mos@asus ~]$ cat rsync_exclude 
.cache/
Downloads/
isos/
junk/
kernel/
koji/
.local/
local/
.nv/
rpms/
.p2/
6.2.12-300.fc38 wayland
04/26 10:31 [mos@asus ~]$ gzip -c rsync_exclude  > rsync_exclude.gz

6.2.12-300.fc38 wayland
04/26 10:31 [mos@asus ~]$ file rsync_exclude.gz 
rsync_exclude.gz: gzip compressed data, was "rsync_exclude", last modified: Sun Oct 23 03:23:22 2022, from Unix, original size modulo 2^32 76

6.2.12-300.fc38 wayland
04/26 10:31 [mos@asus ~]$ gzip -tv rsync_exclude.gz 
rsync_exclude.gz:        OK

6.2.12-300.fc38 wayland
04/26 10:31 [mos@asus ~]$ zless rsync_exclude.gz 
"rsync_exclude.gz" may be a binary file.  See it anyway? 
      1 ^_<8B>^H^H<AA><B3>Tc^@^Crsync_exclude^@<D3>KNL<CE>H<D5><E7>r<C9>/<CF><CB><C9>OL)<D6><E7><CA>,<CE>^G<92>Y<A5>y<D9><FA>\٩Ey<A9>9@:      1 ?+S<9F>K/'?9^QȃRzye<FA>\E^E<B9>@<D5>z^EF<FA>\^@{<8E>{<D8>L^@^@^@

Comment 4 Ludek Smid 2023-05-25 16:53:07 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 moschleg 2023-05-25 22:04:20 UTC
Reopening against Fedora 38 since comment #3 [https://bugzilla.redhat.com/show_bug.cgi?id=2080014#c3] shows it's also a bug on that version