Commit 967b3456 by Daniel Lezcano Committed by Daniel Lezcano

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: 's avatarKatoh Yasufumi <karma@jazz.email.ne.jp> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 57d6d671
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment