Skip to content

archive: tar_stream refuses trees with a colon in a file name #2597

Backlog

Description

@caretaker-janitor

Since #2185, tar_stream raises UnsafeArchivePathError for any tree entry with a : in its name. git accepts those paths on Linux and git archive exports them, so some repositories can no longer be exported. The Debian kmod packaging repository (https://salsa.debian.org/md/kmod.git) has usb:btusb in its test suite, and klaus tarball links for it fail too.

$ dulwich archive HEAD > /dev/null
...
dulwich.archive.UnsafeArchivePathError: unsafe path in tree: b'usb:btusb'
$ git archive HEAD | tar t | grep btusb
...
testsuite/rootfs-pristine/test-loaded/sys/module/btusb/drivers/usb:btusb
...

The colon is in _UNSAFE_PATH_CHARS in dulwich/archive.py, still there on main. I would expect the archive to take the names git takes, as checkout does since #2235 fixed #2205.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions