Skip to content

tar -x fails with libtrash on some archives; wrongly creates mode 000 extracts #2

@dreirund

Description

@dreirund

it appeared to me with https://github.com/openwrt/openwrt/archive/v17.01.4.tar.gz
(sha256sum v17.01.4.tar.gz: a833a0c1c212209fdb6717ee943b0d8c6ce60a33c6e2792e6b59302387c69b44 v17.01.4.tar.gz)

When I extract it with LIBTRASH preloaded (and I am not in a directory
which is listed at TEMPORARY_DIRS or somewhere else in ~/.libtrash):

tar -xvzf v17.01.4.tar.gz

at the end I sometimes get the error

tar: openwrt-17.01.4/target/linux/layerscape/32b/profiles/00-default.mk: Cannot unlink: Permission denied
tar: openwrt-17.01.4/package/base-files/files/etc/os-release: Cannot unlink: Permission denied
tar: Exiting with failure status due to previous errors

and sometimes the error

tar: Exiting with failure status due to previous errors

(Always one of those two).

If I look at the files openwrt-17.01.4/target/linux/layerscape/32b/profiles/00-default.mk and openwrt-17.01.4/package/base-files/files/etc/os-release, they have permission 000 (i.e. no read, write or execute permission for user, for group and for all).

The complete output of

tar -xvzf v17.01.4.tar.gz 2>&1 | tee logfile

is here: error-variant 1 (size: ca. 612 kB), error-variant 2 (size: ca. 612 kB).

I have also attached the output of

strace tar -xvzf v17.01.4.tar.gz 2>&1 | tee logfile

(for the second error variant): here (size: ca. 4.5 MB).

When I extract it with

TRASH_OFF=YES tar -xvzf v17.01.4.tar.gz

or with

LD_PRELOAD='' tar -xvzf v17.01.4.tar.gz

everything works fine.

Error also happens if I

gunzip v17.01.4.tar.gz

first and then just

tar -xvf v17.01.4.tar

Attached you also find my current ~/.libtrash:
here (size: ca. 18 kB)

Note: My ~/.libtrash is a symlink to a system-wide libtrash config file
I use for all users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions