Skip to content

Commit

Permalink
xz: Add a comment to Capsicum sandbox setup.
Browse files Browse the repository at this point in the history
This comment is repeated in xzdec.c to help remind us why all the
capabilities are removed from stdin in certain situations.
  • Loading branch information
JiaT75 committed Dec 21, 2023
1 parent 4e1c695 commit 710cbc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/xz/file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 710cbc1

Please sign in to comment.