Bug 51594 - univention.lib.compression_mime_type_of_buffer() broken
Summary: univention.lib.compression_mime_type_of_buffer() broken
Status: NEW
Alias: None
Product: UCS
Classification: Unclassified
Component: univention-lib
Version: UCS 4.4
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: UCS maintainers
QA Contact: UCS maintainers
URL:
Keywords:
: 35062 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-30 18:29 CEST by Florian Best
Modified: 2024-11-21 11:15 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Customer ID:
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-06-30 18:29:47 CEST
univention.lib.compression_mime_type_of_buffer() is broken since a patch in `file` which does:

debian/patches/0006-gzip.patch / debian/patches/local.report-gz-as-application-gzip.patch:
-!:mime»application/x-gzip
+!:mime»application/gzip

This must happen somewhere between UCS 4.2 and UCS 4.3. At least I don't find the patch in UCS 4.0 but in UCS 4.3 and UCS 4.2-errata449.

Patch:
 compression_mime_type_handlers = {
        "application/x-gzip": lambda x: zlib.decompress(x, 16 + zlib.MAX_WBITS),
-       "application/x-bzip2": bz2.decompress
+       "application/gzip": lambda x: zlib.decompress(x, 16 + zlib.MAX_WBITS),
+       "application/x-bzip2": bz2.decompress,
+       "application/bzip2": bz2.decompress,
 }
Comment 1 Florian Best univentionstaff 2020-08-20 16:25:56 CEST
*** Bug 35062 has been marked as a duplicate of this bug. ***