Skip to contentSkip to conversation

Remove management_write_peer_info_file and related code

PATCH In review [email protected]... 3 participants 3 messages Jul 1, 2022 – Jul 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove management_write_peer_info_file and related code

From: Selva Nair <[email protected]...>

Use of this has never been documented and the code was dead for a long while now.

---

Alternative for [PATCH 2/3] Reactivate record_peer_info in manage.c

 src/openvpn/init.c    |  1 -
 src/openvpn/manage.c  | 49 -------------------------------------------
 src/openvpn/manage.h  |  2 --
 src/openvpn/options.c |  5 +----
 src/openvpn/options.h |  1 -
 5 files changed, 1 insertion(+), 57 deletions(-)
src/openvpn/init.c +0 -1
index 03221cbb..1bfbf4eb 100644
@@ -3862,7 +3862,6 @@ open_management(struct context *c)
                                 c->options.management_log_history_cache,
                                 c->options.management_echo_buffer_size,
                                 c->options.management_state_buffer_size,
-                                c->options.management_write_peer_info_file,
                                 c->options.remap_sigusr1,
                                 flags))
             {
src/openvpn/manage.c +0 -49

91 lines not on this page · raw message

src/openvpn/manage.h +0 -2
index 44a5d964..f46274e6 100644
@@ -229,7 +229,6 @@ struct man_settings {
     int log_history_cache;
     int echo_buffer_size;
     int state_buffer_size;
-    char *write_peer_info_file;
     int client_uid;
     int client_gid;
 
@@ -351,7 +350,6 @@ bool management_open(struct management *man,
                      const int log_history_cache,
                      const int echo_buffer_size,
                      const int state_buffer_size,
-                     const char *write_peer_info_file,
                      const int remap_sigusr1,
                      const unsigned int flags);
 
src/openvpn/options.c +1 -4
index 233c02e0..e9dd6b2c 100644
@@ -1893,7 +1893,6 @@ show_settings(const struct options *o)
     SHOW_STR(management_user_pass);
     SHOW_INT(management_log_history_cache);
     SHOW_INT(management_echo_buffer_size);
-    SHOW_STR(management_write_peer_info_file);
     SHOW_STR(management_client_user);
     SHOW_STR(management_client_group);
     SHOW_INT(management_flags);
@@ -2380,7 +2379,6 @@ options_postprocess_verify_ce(const struct options *options,
 #ifdef ENABLE_MANAGEMENT
     if (!options->management_addr
         && (options->management_flags
-            || options->management_write_peer_info_file
             || options->management_log_history_cache != defaults.management_log_history_cache))
     {
         msg(M_USAGE, "--management is not specified, however one or more options which modify the behavior of --management were specified");
@@ -5718,11 +5716,10 @@ add_option(struct options *options,
         VERIFY_PERMISSION(OPT_P_GENERAL);
         options->management_flags |= MF_UP_DOWN;
     }
-    else if (streq(p[0], "management-client") && !p[2])
+    else if (streq(p[0], "management-client") && !p[1])
     {
         VERIFY_PERMISSION(OPT_P_GENERAL);
         options->management_flags |= MF_CONNECT_AS_CLIENT;
-        options->management_write_peer_info_file = p[1];
     }
 #ifdef ENABLE_MANAGEMENT
     else if (streq(p[0], "management-external-key"))
src/openvpn/options.h +0 -1
index f7e3f265..1a9d9291 100644
@@ -421,7 +421,6 @@ struct options
     int management_log_history_cache;
     int management_echo_buffer_size;
     int management_state_buffer_size;
-    const char *management_write_peer_info_file;
 
     const char *management_client_user;
     const char *management_client_group;
Signature · 1 line
2.30.2
#2 lore raw
In reply to [email protected]...

Nobody has spoken up so far "I REALLY NEED THIS!!", and if you say it hasn't worked anyway, out it goes... less code, less arguments, less variables...

I have only skimmed the code change and did a quick test build on FreeBSD.

Your patch has been applied to the master branch.

commit 57d0046e8ab158a055c40a961d71cfe15656b27c

Author: Selva Nair
Date:   Thu Jun 30 20:07:26 2022 -0400
     Remove management_write_peer_info_file and related code

     Signed-off-by: Selva Nair <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24624.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering