Skip to content

Commit adc7d9f

Browse files
committed
nspawn: change owner/group of /run/systemd/nspawn/notify to userns-root
Fixes systemd#4944
1 parent 542ca7c commit adc7d9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/nspawn/nspawn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,12 @@ static int setup_sd_notify_child(void) {
23632363
return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path);
23642364
}
23652365

2366+
r = userns_lchown(NSPAWN_NOTIFY_SOCKET_PATH, 0, 0);
2367+
if (r < 0) {
2368+
safe_close(fd);
2369+
return log_error_errno(r, "Failed to chown " NSPAWN_NOTIFY_SOCKET_PATH ": %m");
2370+
}
2371+
23662372
r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
23672373
if (r < 0) {
23682374
safe_close(fd);

0 commit comments

Comments
 (0)