summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 7fa098bea8..1ba248f6d6 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2273,7 +2273,7 @@ static int drop_capabilities(void) {
static int register_machine(pid_t pid, int local_ifindex) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_bus_close_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL;
int r;
if (!arg_register)
@@ -2430,7 +2430,7 @@ static int register_machine(pid_t pid, int local_ifindex) {
static int terminate_machine(pid_t pid) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
- _cleanup_bus_close_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_flush_close_unref_ sd_bus *bus = NULL;
const char *path;
int r;
@@ -4313,6 +4313,10 @@ static int outer_child(
if (r < 0)
return r;
+ r = determine_uid_shift(directory);
+ if (r < 0)
+ return r;
+
/* Turn directory into bind mount */
if (mount(directory, directory, NULL, MS_BIND|MS_REC, NULL) < 0)
return log_error_errno(errno, "Failed to make bind mount: %m");
@@ -4491,10 +4495,6 @@ int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
- r = determine_uid_shift(arg_directory);
- if (r < 0)
- return r;
-
if (geteuid() != 0) {
log_error("Need to be root.");
r = -EPERM;