Blob Blame History Raw
From 1e37d7b1eefca9087afa7f82e3928ca1ff8b47e1 Mon Sep 17 00:00:00 2001
From: Andrew Beekhof <andrew@beekhof.net>
Date: Thu, 23 Mar 2017 11:26:00 +1100
Subject: [PATCH 1/2] PE: Bundle: Fix use-after-free of control port

---
 lib/pengine/container.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pengine/container.c b/lib/pengine/container.c
index 71b74ed..6f3a3b9 100644
--- a/lib/pengine/container.c
+++ b/lib/pengine/container.c
@@ -576,7 +576,7 @@ container_unpack(resource_t * rsc, pe_working_set_t * data_set)
         container_data->mounts = g_list_append(container_data->mounts, mount);
 
         if(container_data->control_port) {
-            container_data->ports = g_list_append(container_data->ports, container_data->control_port);
+            container_data->ports = g_list_append(container_data->ports, strdup(container_data->control_port));
         } else {
             container_data->ports = g_list_append(container_data->ports, crm_itoa(DEFAULT_REMOTE_PORT));
         }
-- 
1.8.3.1


From 3ffafe02f63b2e57b866782c4693ef9ed6e7b1db Mon Sep 17 00:00:00 2001
From: Andrew Beekhof <andrew@beekhof.net>
Date: Thu, 23 Mar 2017 11:57:56 +1100
Subject: [PATCH 2/2] remote: Correctly expose the -p option

---
 lrmd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lrmd/main.c b/lrmd/main.c
index 5f5873a..ca8cdf2 100644
--- a/lrmd/main.c
+++ b/lrmd/main.c
@@ -399,7 +399,7 @@ static struct crm_option long_options[] = {
     {"verbose", 0, 0,    'V', "\tIncrease debug output"},
 
     {"logfile", 1, 0,    'l', "\tSend logs to the additional named logfile"},
-#ifndef ENABLE_PCMK_REMOTE
+#ifdef ENABLE_PCMK_REMOTE
     {"port", 1, 0,       'p', "\tPort to listen on"},
 #endif
 
-- 
1.8.3.1