]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Landlock: Fix error message if input file is a directory.
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 22 Feb 2024 13:18:25 +0000 (15:18 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 22 Feb 2024 13:18:25 +0000 (15:18 +0200)
commitde4337fd89ca7db5feb97b5c40143404f6e22986
treea76e4d53af285937571fe6365566ee7e95cd788c
parent120da10ae139ea52ca4275452adf8eda02d07cc8
xz: Landlock: Fix error message if input file is a directory.

If xz is given a directory, it should look like this:

    $ xz /usr/bin
    xz: /usr/bin: Is a directory, skipping

The Landlock rules didn't allow opening directories for reading:

    $ xz /usr/bin
    xz: /usr/bin: Permission denied

The simplest fix was to allow opening directories for reading.
While it's a bit silly to allow it solely for the error message,
it shouldn't make the sandbox significantly weaker.

The single-file use case (like when called from GNU tar) is
still as strict as possible: all Landlock restrictions are
enabled before (de)compression starts.
src/xz/sandbox.c