Bug 278378

Summary: man(1) ignores corrupt gzip'd manual pages
Product: Base System Reporter: Wolfram Schneider <wosch>
Component: binAssignee: Wolfram Schneider <wosch>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: ---    
Version: 15.0-CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on: 223516    
Bug Blocks:    

Description Wolfram Schneider freebsd_committer freebsd_triage 2024-04-15 12:59:11 UTC
man(1) ignores errors from gzip if a file is corrupt. You can see the errors from gzip on stderr, but the exit status of man(1) will be zero.

How to repeat:

$ touch /tmp/bla.1.gz

$ /usr/bin/man /tmp/bla.1.gz >/dev/null; echo $?
gzcat: /tmp/bla.1.gz: unexpected end of file
gzcat: /tmp/bla.1.gz: unexpected end of file
gzcat: /tmp/bla.1.gz: unexpected end of file
0

In case of an error, man(1) should exit with a non-zero status.
Comment 1 Wolfram Schneider freebsd_committer freebsd_triage 2024-04-20 08:34:51 UTC
Fixed by 14a5c1068d3751173dc41f3097b12e95791b2160