From 75b1e24babb146d4dbfe4b4899ea82104417fbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 7 Feb 2014 05:32:57 +0100 Subject: [PATCH] qubes-rpc, qrexec: register callbacks for qrexec-lib Now qrexec-lib do not use exported symbols of particular names, but explicitly registered callbacks. --- qrexec/qrexec-agent.c | 3 +++ qubes-rpc/qfile-agent.c | 1 + qubes-rpc/qfile-unpacker.c | 5 ----- qubes-rpc/tar2qfile.c | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qrexec/qrexec-agent.c b/qrexec/qrexec-agent.c index d7d42ac..164dd0b 100644 --- a/qrexec/qrexec-agent.c +++ b/qrexec/qrexec-agent.c @@ -71,6 +71,8 @@ int passfd_socket; int meminfo_write_started = 0; +void do_exec(const char *cmd); + void init() { peer_server_init(REXEC_PORT); @@ -80,6 +82,7 @@ void init() umask(077); trigger_fd = open(QREXEC_AGENT_TRIGGER_PATH, O_RDONLY | O_NONBLOCK); + register_exec_func(do_exec); } void wake_meminfo_writer() { diff --git a/qubes-rpc/qfile-agent.c b/qubes-rpc/qfile-agent.c index 7ef61ee..e7981d2 100644 --- a/qubes-rpc/qfile-agent.c +++ b/qubes-rpc/qfile-agent.c @@ -49,6 +49,7 @@ int main(int argc, char **argv) signal(SIGPIPE, SIG_IGN); // this will allow checking for possible feedback packet in the middle of transfer set_nonblock(0); + register_notify_progress(¬ify_progress); notify_progress(0, PROGRESS_FLAG_INIT); crc32_sum = 0; cwd = getcwd(NULL, 0); diff --git a/qubes-rpc/qfile-unpacker.c b/qubes-rpc/qfile-unpacker.c index b99d324..61dee40 100644 --- a/qubes-rpc/qfile-unpacker.c +++ b/qubes-rpc/qfile-unpacker.c @@ -31,11 +31,6 @@ int prepare_creds_return_uid(const char *username) return pwd->pw_uid; } - -void notify_progress(int p1, int p2) -{ - } - int main(int argc, char ** argv) { char *incoming_dir; diff --git a/qubes-rpc/tar2qfile.c b/qubes-rpc/tar2qfile.c index d508a1f..fb473bd 100644 --- a/qubes-rpc/tar2qfile.c +++ b/qubes-rpc/tar2qfile.c @@ -963,6 +963,7 @@ int main(int argc, char **argv) signal(SIGPIPE, SIG_IGN); // this will allow checking for possible feedback packet in the middle of transfer // if disabled, the copy_file process could hang + register_notify_progress(¬ify_progress); notify_progress(0, PROGRESS_FLAG_INIT); //set_size_limit(1500000000, 2048);