Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complains about length of 0x5855 data field. #12

Closed
madler opened this issue May 5, 2023 · 2 comments
Closed

Complains about length of 0x5855 data field. #12

madler opened this issue May 5, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@madler
Copy link

madler commented May 5, 2023

Why is zipdetails happy with a length 12 0x5855 extensible data field in the local header:

000000025 Extra ID #0001        5855 'UX: Unix Extra type 1'
000000027   Length              000C
000000029   Access Time         62DF1FC7 'Mon Jul 25 15:57:11 2022'
00000002D   Mod Time            62DF0738 'Mon Jul 25 14:12:24 2022'
000000031   UID                 01F5
000000033   GID                 0014

but then complains about the exact same field in the central directory?

CC90F4A05 Extra ID #0001        5855 'UX: Unix Extra type 1'
CC90F4A07   Length              000C
# ERROR: Offset 0xCC90F4A07: 'Length' field in 'Extra ID' 0x5855 (Unix Extra type 1) invalid: expected 0x8, got 0xC
@pmqs
Copy link
Owner

pmqs commented May 5, 2023

The file extrafld.txt in the infozip sources says the local & central versions have different sizes. No idea of the history of that.

         -Info-ZIP Unix Extra Field (type 1):
          ==================================

          The following is the layout of the old Info-ZIP extra block for
          Unix.  It has been replaced by the extended-timestamp extra block
          (0x5455) and the Unix type 2 extra block (0x7855).
          (Last Revision 19970118)

          Local-header version:

          Value         Size        Description
          -----         ----        -----------
  (Unix1) 0x5855        Short       tag for this extra block type ("UX")
          TSize         Short       total data size for this block
          AcTime        Long        time of last access (UTC/GMT)
          ModTime       Long        time of last modification (UTC/GMT)
          UID           Short       Unix user ID (optional)
          GID           Short       Unix group ID (optional)

          Central-header version:

          Value         Size        Description
          -----         ----        -----------
  (Unix1) 0x5855        Short       tag for this extra block type ("UX")
          TSize         Short       total data size for this block
          AcTime        Long        time of last access (GMT/UTC)
          ModTime       Long        time of last modification (GMT/UTC)

...

          The local-header extra block may optionally contain UID and GID
          info for the file.  The local-header TSize value is the only
          indication of this.  Note that Unix UIDs and GIDs are usually
          specific to a particular machine, and they generally require root
          access to restore.

@pmqs pmqs self-assigned this May 5, 2023
@madler
Copy link
Author

madler commented May 5, 2023

Interesting. Ok.

@madler madler closed this as completed May 5, 2023
@pmqs pmqs added the question Further information is requested label May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants