mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
import,home: update $SYSTEMD_EXEC_PID= if it is set
The subsequent execv() or execl() always calls tools provided by systemd. So, it is safe to update the variable.
This commit is contained in:
parent
43f565c677
commit
d754890843
@ -1038,6 +1038,10 @@ static int home_start_work(Home *h, const char *verb, UserRecord *hr, UserRecord
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
r = setenv_systemd_exec_pid(true);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to update $SYSTEMD_EXEC_PID, ignoring: %m");
|
||||
|
||||
r = rearrange_stdio(stdin_fd, stdout_fd, STDERR_FILENO);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to rearrange stdin/stdout/stderr: %m");
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "def.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "float.h"
|
||||
#include "hostname-util.h"
|
||||
@ -403,6 +404,10 @@ static int transfer_start(Transfer *t) {
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
r = setenv_systemd_exec_pid(true);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to update $SYSTEMD_EXEC_PID, ignoring: %m");
|
||||
|
||||
switch (t->type) {
|
||||
|
||||
case TRANSFER_IMPORT_TAR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user