Bug #80944 [NEW]: gzencode() sets a strange OS byte on Windows
| From: | christoph at burschka dot de | Date: | Thu, 08 Apr 2021 23:53:57 +0000 |
| Subject: | Bug #80944 [NEW]: gzencode() sets a strange OS byte on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233336@lists.php.net to get a copy of this message | ||
From: christoph at burschka dot de
Operating system: Windows
PHP version: 8.0.3
Package: Zlib related
Bug Type: Bug
Bug description:gzencode() sets a strange OS byte on Windows
Description:
------------
The tenth byte of a gzip file identifies (in theory) the OS or file
system on which the file was compressed.
Running the test script on Linux produces a file where the byte is
0x03.
On Windows, we get a somewhat strange value of 0x0A. (Meanwhile, the
GnuWin utility on Windows set this byte to 0x0B for NT, while the gzip
utility in Git Bash for Windows uses 0x03 as if it was Linux.)
The standards document (RFC-1952) says that 0x0A is "TOPS-20", and sure
enough - running the
file utility on the resulting file shows:
"test1.gz: gzip compressed data, from TOPS/20".
I'm not sure if I can call this a bug, since it doesn't really matter in
practice what gets written there (for example writing the same value on
all platforms would be understandable), but it seems odd that we *do*
get a platform-specific value, and it is for a different, long-dead
platform.
Test script:
---------------
<?php
file_put_contents('test1.gz', gzencode('Hello world'));
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=80944&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80944&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80944&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80944&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80944&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80944&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80944&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80944&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80944&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80944&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80944&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80944&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80944&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80944&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80944&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80944&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80944&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80944&r=mysqlcfg