[packages/ettercap] - added no-common patch from Fedora

qboosh qboosh at pld-linux.org
Sat May 23 22:19:45 CEST 2020


commit 87d4c0bde54edb858b4064ce1d4aab6a4e43387f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat May 23 22:20:21 2020 +0200

    - added no-common patch from Fedora

 ettercap-no-common.patch | 77 ++++++++++++++++++++++++++++++++++++++++++++++++
 ettercap.spec            |  2 ++
 2 files changed, 79 insertions(+)
---
diff --git a/ettercap.spec b/ettercap.spec
index e1ea4b3..2b35fe2 100644
--- a/ettercap.spec
+++ b/ettercap.spec
@@ -20,6 +20,7 @@ Source0:	https://github.com/Ettercap/ettercap/releases/download/v%{version}/%{na
 Patch0:		%{name}-buildtype.patch
 Patch1:		%{name}-gtk3.patch
 Patch2:		%{name}-link.patch
+Patch3:		%{name}-no-common.patch
 URL:		https://www.ettercap-project.org/
 %{?with_geoip:BuildRequires:	GeoIP-devel}
 BuildRequires:	bison
@@ -98,6 +99,7 @@ hosts na rede local, portas abertas, versão de serviços, tipo de host
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 install -d build
diff --git a/ettercap-no-common.patch b/ettercap-no-common.patch
new file mode 100644
index 0000000..f1ec3be
--- /dev/null
+++ b/ettercap-no-common.patch
@@ -0,0 +1,77 @@
+From 2168090f5b023573ebea0f83574950401ed5d67b Mon Sep 17 00:00:00 2001
+From: Alexander Koeppe <format_c at online.de>
+Date: Wed, 29 Jan 2020 21:09:31 +0100
+Subject: [PATCH] define EC_PTHREAD_NULL as global heap variable
+
+---
+ include/ec_globals.h | 7 +++++++
+ include/ec_threads.h | 2 +-
+ src/ec_globals.c     | 3 +++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/include/ec_globals.h b/include/ec_globals.h
+index 5033f5dc0..45e12514c 100644
+--- a/include/ec_globals.h
++++ b/include/ec_globals.h
+@@ -176,6 +176,11 @@ struct wifi_env {
+ 	size_t wkey_len;
+ };
+ 
++/* threads structure */
++struct thread_env {
++   pthread_t ec_pthread_null;
++};
++
+ /* the globals container */
+ struct ec_globals {
+    struct ec_conf *conf;
+@@ -191,6 +196,7 @@ struct ec_globals {
+    struct target_env *t1;
+    struct target_env *t2;
+    struct wifi_env *wifi;
++   struct thread_env *thread;
+    LIST_HEAD(, hosts_list) hosts_list;
+    TAILQ_HEAD(gbl_ptail, host_profile) profiles_list_head;
+    struct filter_list *filters;
+@@ -213,6 +219,7 @@ EC_API_EXTERN struct ec_globals *ec_gbls;
+ #define EC_GBL_TARGET1        (EC_GBLS->t1)
+ #define EC_GBL_TARGET2        (EC_GBLS->t2)
+ #define EC_GBL_WIFI           (EC_GBLS->wifi)
++#define EC_GBL_THREAD         (EC_GBLS->thread)
+ #define EC_GBL_HOSTLIST       (EC_GBLS->hosts_list)
+ #define EC_GBL_PROFILES       (EC_GBLS->profiles_list_head)
+ #define EC_GBL_FILTERS        &(EC_GBLS->filters)
+diff --git a/include/ec_threads.h b/include/ec_threads.h
+index 6cd2c1084..f63f3ee3a 100644
+--- a/include/ec_threads.h
++++ b/include/ec_threads.h
+@@ -12,7 +12,7 @@ struct ec_thread {
+ };
+ 
+ /* a value to be used to return errors in fuctcions using pthread_t values */
+-pthread_t EC_PTHREAD_NULL;
++#define EC_PTHREAD_NULL EC_GBL_THREAD->ec_pthread_null
+ #define EC_PTHREAD_SELF EC_PTHREAD_NULL
+ #define PTHREAD_ID(id)  (*(unsigned long*)&(id)) 
+ 
+diff --git a/src/ec_globals.c b/src/ec_globals.c
+index 1bc313c15..e45dba5cf 100644
+--- a/src/ec_globals.c
++++ b/src/ec_globals.c
+@@ -52,6 +52,7 @@ void ec_globals_alloc(void)
+    SAFE_CALLOC(ec_gbls->t1, 1, sizeof(struct target_env));
+    SAFE_CALLOC(ec_gbls->t2, 1, sizeof(struct target_env));
+    SAFE_CALLOC(ec_gbls->wifi, 1, sizeof(struct wifi_env));
++   SAFE_CALLOC(ec_gbls->thread, 1, sizeof(struct thread_env));
+    /* filter list entries are allocated as needed */
+    ec_gbls->filters = NULL;
+ 
+@@ -72,6 +73,8 @@ void ec_globals_free(void)
+    EC_GBL_FREE(ec_gbls->bridge);
+    EC_GBL_FREE(ec_gbls->sm);
+    EC_GBL_FREE(ec_gbls->filters);
++   EC_GBL_FREE(ec_gbls->wifi);
++   EC_GBL_FREE(ec_gbls->thread);
+ 
+    free_ip_list(ec_gbls->t1);
+    EC_GBL_FREE(ec_gbls->t1);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ettercap.git/commitdiff/87d4c0bde54edb858b4064ce1d4aab6a4e43387f



More information about the pld-cvs-commit mailing list