]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Add a comment to Capsicum sandbox setup.
authorJia Tan <jiat0218@gmail.com>
Thu, 21 Dec 2023 08:39:53 +0000 (16:39 +0800)
committerJia Tan <jiat0218@gmail.com>
Thu, 21 Dec 2023 12:53:27 +0000 (20:53 +0800)
This comment is repeated in xzdec.c to help remind us why all the
capabilities are removed from stdin in certain situations.

src/xz/file_io.c

index 4a2c8392fa68f9387557076909b83a7644659d12..9b89434f9f8831563ca0eacfe74006346443f4e6 100644 (file)
@@ -226,6 +226,7 @@ io_sandbox_enter(int src_fd)
                        CAP_EVENT, CAP_FCNTL, CAP_LOOKUP, CAP_READ, CAP_SEEK)))
                goto error;
 
+       // If not reading from stdin, remove all capabilities from it.
        if (src_fd != STDIN_FILENO && cap_rights_limit(
                        STDIN_FILENO, cap_rights_clear(&rights)))
                goto error;