goto finish;
}
if (r == 0) {
- const char *mount_inside;
+ const char *mount_inside, *q;
int mntfd;
- const char *q;
errno_pipe_fd[0] = safe_close(errno_pipe_fd[0]);
(void) mkdir_p(dest, 0755);
else {
(void) mkdir_parents(dest, 0755);
- safe_close(open(dest, O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC|O_NOCTTY, 0600));
+ (void) mknod(dest, S_IFREG|0600, 0);
}
}
- /* Fifth, move the mount to the right place inside */
- mount_inside = strjoina("/run/systemd/nspawn/incoming/", basename(mount_outside));
+ mount_inside = strjoina("/run/host/incoming/", basename(mount_outside));
if (mount(mount_inside, dest, NULL, MS_MOVE, NULL) < 0) {
r = log_error_errno(errno, "Failed to mount: %m");
goto child_fail;
p = strjoina("/run/systemd/nspawn/propagate/", arg_machine);
(void) mkdir_p(p, 0600);
- r = userns_mkdir(root, "/run/systemd", 0755, 0, 0);
+ r = userns_mkdir(root, "/run/host", 0755, 0, 0);
if (r < 0)
- return log_error_errno(r, "Failed to create /run/systemd: %m");
+ return log_error_errno(r, "Failed to create /run/host: %m");
- r = userns_mkdir(root, "/run/systemd/nspawn", 0755, 0, 0);
+ r = userns_mkdir(root, "/run/host/incoming", 0600, 0, 0);
if (r < 0)
- return log_error_errno(r, "Failed to create /run/systemd/nspawn: %m");
+ return log_error_errno(r, "Failed to create /run/host/incoming: %m");
- r = userns_mkdir(root, "/run/systemd/nspawn/incoming", 0600, 0, 0);
- if (r < 0)
- return log_error_errno(r, "Failed to create /run/systemd/nspawn/incoming: %m");
-
- q = prefix_roota(root, "/run/systemd/nspawn/incoming");
+ q = prefix_roota(root, "/run/host/incoming");
r = mount_verbose(LOG_ERR, p, q, NULL, MS_BIND, NULL);
if (r < 0)
return r;
if (r < 0)
return r;
- /* machined will MS_MOVE into that directory, and that's only
- * supported for non-shared mounts. */
+ /* machined will MS_MOVE into that directory, and that's only supported for non-shared mounts. */
return mount_verbose(LOG_ERR, NULL, q, NULL, MS_SLAVE, NULL);
}