Skip to content

borg import-tar does not strip leading ./ from filenames, making mount access impossible #7099

@ghost

Description

Have you checked borgbackup docs, FAQ, and open Github issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Bug report

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

borg 1.2.2 (not sure what version Hetzner uses as I can't execute the borg command directly on their storage box)

Operating system (distribution) and version.

Debian 11

Hardware / network configuration, and filesystems used.

Source is a .tar file, file system should be irrelevant. But just in case, the .tar file was created on ext4, the current system is running btrfs, and the backup was made to a ZFS remote.

How much data is handled by borg?

About 100 GB at most.

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg import-tar --tar-filter='zstd -d' --progress --compression zstd ssh://XXX@XXX.your-storagebox.de:23/./backup/cadoth::2022-07-29 ~/Downloads/backup-20220729.tar.zst
sudo borg mount -v XXX@XXX.your-storagebox.de:23/./backup/cadoth /mnt/backup

Describe the problem you're observing.

When a tar archive was created as tar -cf NAME.tar . or similar (emphasis on the .), it leads to filenames starting with ./ in the archive. Borg does not strip this either on import-tar or mount by default, which results in it creating a second . directory, but that is "shadowed" by the regular "current directory" . entry, making it impossible to access. I even tried checkijng inode numbers but they seem to show up as identical.

root@cadoth /mnt/backup/2022-07-30 # ls -ail
total 0
4 drwxr-xr-x 1 root root 0 Oct 22 02:08 .
4 drwxr-xr-x 1 root root 0 Oct 22 02:08 .
1 drwxr-xr-x 1 root root 0 Oct 22 11:11 ..

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Yes, this is consistently reproducible with a tar archive created using the above syntax.

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