Debian Packages fail with file names > 100 characters #20

Closed
opened 2026-01-29 16:27:27 +00:00 by claunia · 4 comments
Owner

Originally created by @qmfrederik on GitHub (Nov 4, 2017).

The TarHeader class defines the filename as char[100] so anything beyond 100 characters isn't accepted as a file name.

There seem to be various extensions to the original tar format which work around this; from the dpkg manual:

The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (new style long pathnames and long linknames, supported since dpkg 1.4.1.17; large file metadata since dpkg 1.18.24), and the POSIX ustar format (long names supported since dpkg 1.15.0). Unrecognized tar typeflags are considered an error. Each tar entry size inside a tar archive is limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes and negative timestamps, and 63-bit UID, GID and device numbers.

Originally created by @qmfrederik on GitHub (Nov 4, 2017). The `TarHeader` class defines the filename as `char[100]` so anything beyond 100 characters isn't accepted as a file name. There seem to be various extensions to the original tar format which work around this; [from the dpkg manual](https://manpages.debian.org/testing/dpkg-dev/deb.5.en.html): > The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (new style long pathnames and long linknames, supported since dpkg 1.4.1.17; large file metadata since dpkg 1.18.24), and the POSIX ustar format (long names supported since dpkg 1.15.0). Unrecognized tar typeflags are considered an error. Each tar entry size inside a tar archive is limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes and negative timestamps, and 63-bit UID, GID and device numbers.
Author
Owner

@qmfrederik commented on GitHub (Nov 4, 2017):

Example of a Debian package with file names > 100 characters (to figure out how Debian handles this natively):

https://packages.debian.org/stretch/all/libmono-system-runtime-interopservices-runtimeinformation4.0-cil/filelist

@qmfrederik commented on GitHub (Nov 4, 2017): Example of a Debian package with file names > 100 characters (to figure out how Debian handles this natively): https://packages.debian.org/stretch/all/libmono-system-runtime-interopservices-runtimeinformation4.0-cil/filelist
Author
Owner

@ichan-akira commented on GitHub (Jul 22, 2021):

Hi @qmfrederik this solution you've created 4 years ago really help me to solve the same problem which is file name > 100 characters in *.deb package. That's why I am planning to fix issue I open at https://github.com/ygoe/DotnetMakeDeb/issues/3. It is ok for me to adapt your method?

Thanks in advance 🙇

@ichan-akira commented on GitHub (Jul 22, 2021): Hi @qmfrederik this solution you've created 4 years ago really help me to solve the same problem which is file name > 100 characters in *.deb package. That's why I am planning to fix issue I open at https://github.com/ygoe/DotnetMakeDeb/issues/3. It is ok for me to adapt your method? Thanks in advance :bow:
Author
Owner

@qmfrederik commented on GitHub (Jul 22, 2021):

Sure, go ahead! If you're just drawing inspiration from here (which is basically a reflection of what the standards say): glad I could help. If you're copying non-trivial of the code: then please keep track of the copyright statements & licenses 😄 .

@qmfrederik commented on GitHub (Jul 22, 2021): Sure, go ahead! If you're just drawing inspiration from here (which is basically a reflection of what the standards say): glad I could help. If you're copying non-trivial of the code: then please keep track of the copyright statements & licenses 😄 .
Author
Owner

@ichan-akira commented on GitHub (Jul 22, 2021):

Thanks @qmfrederik, the specific code that inspired from your solution is this.
I hope everything is ok and no copyright infringement is made. 🙇 🙏

@ichan-akira commented on GitHub (Jul 22, 2021): Thanks @qmfrederik, the specific code that inspired from your solution is [this](https://github.com/ygoe/DotnetMakeDeb/pull/6/files#diff-923ce7b9fcaa1a368b097711deb47f6c8754f810d1258c5d2c2de61ef5b0e512R122-R143). I hope everything is ok and no copyright infringement is made. 🙇 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#20