mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-05 15:27:31 +00:00
set close-on-exec flag on command socket
When we accept a connection, we have to set the close-on-exec flag, otherwise that won't be possible to reboot a container through a lxc-console command. Reported-by: Katoh Yasufumi <karma@jazz.email.ne.jp> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
d755a9e6b4
commit
9ccb2dbcd2
@ -236,6 +236,11 @@ static int incoming_command_handler(int fd, void *data,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fcntl(connection, F_SETFD, FD_CLOEXEC)) {
|
||||
SYSERROR("failed to set close-on-exec on incoming connection");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
if (setsockopt(connection, SOL_SOCKET,
|
||||
SO_PASSCRED, &opt, sizeof(opt))) {
|
||||
SYSERROR("failed to enable credential on socket");
|
||||
|
Loading…
Reference in New Issue
Block a user