nspawn: change owner/group of /run/systemd/nspawn/notify to userns-root
Fixes #4944
This commit is contained in:
parent
542ca7c9d2
commit
adc7d9f0da
|
@ -2363,6 +2363,12 @@ static int setup_sd_notify_child(void) {
|
|||
return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path);
|
||||
}
|
||||
|
||||
r = userns_lchown(NSPAWN_NOTIFY_SOCKET_PATH, 0, 0);
|
||||
if (r < 0) {
|
||||
safe_close(fd);
|
||||
return log_error_errno(r, "Failed to chown " NSPAWN_NOTIFY_SOCKET_PATH ": %m");
|
||||
}
|
||||
|
||||
r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
|
||||
if (r < 0) {
|
||||
safe_close(fd);
|
||||
|
|
Loading…
Reference in New Issue