[GH-ISSUE #358] Firejail discards exit code #255

Closed
opened 2026-05-05 05:25:58 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @gnunicorn on GitHub (Mar 7, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/358

Hello,

we are using firejail to securely run a compiler and linter in the clippy-service. First off, I wanted to thank you for this great project and the work you've put in it. It works great for us and allowed us to quickly setup a sandbox to allow third-party access without security risks. Thank you very much!


Coming to our specific problem: firejail currently swallows the exit-code of the program it runs internally. As this gives us an indication whether the compiler exited successfully or whether there was a problem, this is a big problem for us.

I've identified that it would only require to keep the variable from the waitpid (instead of NULL) and forward that on process exit, but that is currently not done. Would you accept a Pull-Request implementing this behavior? And/or do you want this new behavior be hidden behind a command-line option (like --preserve-exit-code)? I could prepare a PR about that but first wanted to make sure you'd want this, or maybe you had other good reasons to discard the exit code...

Highly appreciate you looking at this and all the work you've put in this already.
Thanks for your time!

Originally created by @gnunicorn on GitHub (Mar 7, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/358 Hello, we are using firejail to securely [run a compiler and linter](http://clippy.bashy.io/docs/clippy.html#section-4) in the [clippy-service](http://clippy.bashy.io/). First off, I wanted to thank you for this great project and the work you've put in it. It works great for us and allowed us to quickly setup a sandbox to allow third-party access without security risks. Thank you very much! --- Coming to our specific problem: firejail currently **swallows the exit-code of the program it runs internally**. [As this gives us an indication whether the compiler exited successfully](https://github.com/ligthyear/clippy-service/issues/22) or whether there was a problem, this is a big problem for us. I've identified that it would only require to keep the variable from the waitpid (instead of NULL) and forward that on process exit, but [that is currently not done](https://github.com/netblue30/firejail/blob/fca9d8e346cc4525159b9b2257387bf679a218a5/src/firejail/main.c#L1774-L1795). Would you accept a Pull-Request implementing this behavior? And/or do you want this new behavior be hidden behind a command-line option (like `--preserve-exit-code`)? I could prepare a PR about that but first wanted to make sure you'd want this, or maybe you had other good reasons to discard the exit code... Highly appreciate you looking at this and all the work you've put in this already. Thanks for your time!
gitea-mirror 2026-05-05 05:25:58 -06:00
Author
Owner

@netblue30 commented on GitHub (Mar 7, 2016):

Sure, if you send a patch I'll merge it, thanks!

<!-- gh-comment-id:193437068 --> @netblue30 commented on GitHub (Mar 7, 2016): Sure, if you send a patch I'll merge it, thanks!
Author
Owner

@netblue30 commented on GitHub (Mar 31, 2016):

It is already in the master branch, a testing release will follow shortly.

<!-- gh-comment-id:203961154 --> @netblue30 commented on GitHub (Mar 31, 2016): It is already in the master branch, a testing release will follow shortly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#255
No description provided.