From abd8b7986430aadf876e22c67666e71c0cdf3e7c Mon Sep 17 00:00:00 2001 From: Rafal Wojtczuk Date: Fri, 22 Jul 2011 13:47:34 +0200 Subject: [PATCH] qrexec: impose startup time limit for qrexec_daemon --- qrexec/qrexec_daemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qrexec/qrexec_daemon.c b/qrexec/qrexec_daemon.c index d2a777b4..c0733cc6 100644 --- a/qrexec/qrexec_daemon.c +++ b/qrexec/qrexec_daemon.c @@ -82,12 +82,14 @@ int create_qrexec_socket(int domid, char *domname) return get_server_socket(socket_address); } +#define MAX_STARTUP_TIME 120 /* do the preparatory tasks, needed before entering the main event loop */ void init(int xid) { char qrexec_error_log_name[256]; int logfd; + int i; if (xid <= 0) { fprintf(stderr, "domain id=0?\n"); @@ -102,11 +104,12 @@ void init(int xid) break; default: fprintf(stderr, "Waiting for VM's qrexec agent."); - for (;;) { + for (i=0;i