[PR #363] [MERGED] Forward exit code from child process #3602

Closed
opened 2026-05-05 10:04:29 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/363
Author: @gnunicorn
Created: 3/10/2016
Status: Merged
Merged: 3/10/2016
Merged by: @netblue30

Base: masterHead: fixing-exit-code


📝 Commits (1)

  • fcb17bf Forward exit code from child process

📊 Changes

2 files changed (+23 additions, -7 deletions)

View changed files

📝 src/firejail/main.c (+9 -2)
📝 src/firejail/sandbox.c (+14 -5)

📄 Description

This PR reads the status code of the child process run inside the
sandbox and forwards it to the outer process. Which in turn makes that
result its own exiting status code.

This changes the behaviour of firejail in the sense that the following would prior give you the (misleading) status 0:

$> firejail 'echo 1'
Parent pid 13488, child pid 13489
The new log directory is /proc/13489/root/var/log

Child process initialized
/bin/bash: echo 1: command not found

parent is shutting down, bye...
$> echo $?
127

Fixes #358.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/363 **Author:** [@gnunicorn](https://github.com/gnunicorn) **Created:** 3/10/2016 **Status:** ✅ Merged **Merged:** 3/10/2016 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `fixing-exit-code` --- ### 📝 Commits (1) - [`fcb17bf`](https://github.com/netblue30/firejail/commit/fcb17bf090893d65a9007ecbef021efb18fd13a4) Forward exit code from child process ### 📊 Changes **2 files changed** (+23 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/main.c` (+9 -2) 📝 `src/firejail/sandbox.c` (+14 -5) </details> ### 📄 Description This PR reads the status code of the child process run inside the sandbox and forwards it to the outer process. Which in turn makes that result its own exiting status code. This changes the behaviour of firejail in the sense that the following would prior give you the (misleading) status `0`: ``` $> firejail 'echo 1' Parent pid 13488, child pid 13489 The new log directory is /proc/13489/root/var/log Child process initialized /bin/bash: echo 1: command not found parent is shutting down, bye... $> echo $? 127 ``` Fixes #358. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:04:29 -06:00
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#3602
No description provided.