]> 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>
Fri, 22 Dec 2023 12:02:06 +0000 (20:02 +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 28280293ef3970033e8bb66b01377987f9c32dfb..78fbdf724eea1d4e19fdf744fe0d1b14c8979827 100644 (file)
@@ -199,6 +199,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;