[Openvpn-devel,v2] manage: use report_command_status() for client-deny, client-kill, push-update

Message ID 20261122113822.710-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v2] manage: use report_command_status() for client-deny, client-kill, push-update |

Commit Message

Gert Doering Nov. 22, 2026, 11:38 a.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

These printed the same SUCCESS/ERROR lines by hand. Output is unchanged.

Change-Id: Ied65202d269dedfa7ce69e62ef68d775ec0da36c
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2231
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2231
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Patch

diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index 86c498e..ab814d5 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -1286,14 +1286,7 @@ 
         {
             const bool status = (*man->persist.callback.client_auth)(
                 man->persist.callback.arg, cid, kid, false, reason, client_reason, NULL);
-            if (status)
-            {
-                msg(M_CLIENT, "SUCCESS: client-deny command succeeded");
-            }
-            else
-            {
-                msg(M_CLIENT, "ERROR: client-deny command failed");
-            }
+            report_command_status(status, "client-deny");
         }
         else
         {
@@ -1312,14 +1305,7 @@ 
         {
             const bool status =
                 (*man->persist.callback.kill_by_cid)(man->persist.callback.arg, cid, kill_msg);
-            if (status)
-            {
-                msg(M_CLIENT, "SUCCESS: client-kill command succeeded");
-            }
-            else
-            {
-                msg(M_CLIENT, "ERROR: client-kill command failed");
-            }
+            report_command_status(status, "client-kill");
         }
         else
         {
@@ -1523,12 +1509,7 @@ 
         status = (*man->persist.callback.push_update_by_cid)(man->persist.callback.arg, cid, p[2]);
     }
 
-    if (status)
-    {
-        msg(M_CLIENT, "SUCCESS: push-update command succeeded");
-        return;
-    }
-    msg(M_CLIENT, "ERROR: push-update command failed");
+    report_command_status(status, "push-update");
 }
 
 static void