// Redirect any logging to our log pipe
pakfire_set_log_callback(jail->pakfire, pakfire_jail_log, &ctx->pipes);
- // Die with parent
- r = prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
- if (r) {
- ERROR(jail->pakfire, "Could not configure to die with parent: %m\n");
- return 126;
- }
-
// Fetch my own PID
pid_t pid = getpid();
if (r)
return r;
- // Perform further initialization
+ // Die with parent
+ r = prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
+ if (r) {
+ ERROR(jail->pakfire, "Could not configure to die with parent: %m\n");
+ return 126;
+ }
+
+ // Make this process dumpable
+ r = prctl (PR_SET_DUMPABLE, 1, 0, 0, 0);
+ if (r) {
+ ERROR(jail->pakfire, "Could not make the process dumpable: %m\n");
+ return 126;
+ }
+
+ // Don't drop any capabilities on setuid()
+ r = prctl(PR_SET_KEEPCAPS, 1);
+ if (r) {
+ ERROR(jail->pakfire, "Could not set PR_SET_KEEPCAPS: %m\n");
+ return 126;
+ }
// Fetch UID/GID
uid_t uid = getuid();
if (r)
return r;
- // Don't drop any capabilities on execve()
- r = prctl(PR_SET_KEEPCAPS, 1);
- if (r) {
- ERROR(jail->pakfire, "Could not set PR_SET_KEEPCAPS: %m\n");
- return r;
- }
-
// Set capabilities
r = pakfire_jail_set_capabilities(jail);
if (r)