From f4e46b63a4d6d6cf4d4a75c5f65b512cf98c9915 Mon Sep 17 00:00:00 2001 From: Rafal Wojtczuk Date: Thu, 9 Sep 2010 12:33:48 +0200 Subject: [PATCH] qmemman: in client code, set FD_CLOEXEC on qmmemman.socket --- dom0/qmemman/qmemman_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dom0/qmemman/qmemman_client.py b/dom0/qmemman/qmemman_client.py index b4bc77e6..e1d5234c 100755 --- a/dom0/qmemman/qmemman_client.py +++ b/dom0/qmemman/qmemman_client.py @@ -1,9 +1,14 @@ import socket - +import fcntl class QMemmanClient: def request_memory(self, amount): self.sock = socket.socket(socket.AF_UNIX) + + flags = fcntl.fcntl(self.sock.fileno(), fcntl.F_GETFD) + flags |= fcntl.FD_CLOEXEC + fcntl.fcntl(self.sock.fileno(), fcntl.F_SETFD, flags) + self.sock.connect("/var/run/qubes/qmemman.sock") self.sock.send(str(amount)+"\n") self.received = self.sock.recv(1024).strip()