From: "cron2 (Code Review)" Date: Fri, 22 Sep 2023 12:06:15 +0000 In-Reply-To: References: Reply-To: gert@...1296..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="NGbmq68HySE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Warn user if INFO control command is too long List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , flichtenheld Cc: openvpn-devel --NGbmq68HySE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/329?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Warn user if INFO control command is too long ...................................................................... Warn user if INFO control command is too long "INFO_PRE,..." command length is limited to 256 bytes. If the server implementation pushes command which is too long, warn the user and don't send the truncated command to a management client. Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld Message-Id: <20230922105055.37969-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 062.html Signed-off-by: Gert Doering (cherry picked from commit df624fb6d63db6b2a3b0c40597cee74c61b8ab2c) --- M src/openvpn/push.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/329/2 diff --git a/src/openvpn/push.c b/src/openvpn/push.c index d468211..19849c5 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -244,8 +244,14 @@ * for management greeting and we don't want to confuse the client */ struct buffer out =3D alloc_buf_gc(256, &gc); - buf_printf(&out, ">%s:%s", "INFOMSG", m); - management_notify_generic(management, BSTR(&out)); + if (buf_printf(&out, ">%s:%s", "INFOMSG", m)) + { + management_notify_generic(management, BSTR(&out)); + } + else + { + msg(D_PUSH_ERRORS, "WARNING: Received INFO command is too long= , won't notify management client."); + } gc_free(&gc); } --=20 To view, visit http://gerrit.openvpn.net/c/openvpn/+/329?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 Gerrit-Change-Number: 329 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --NGbmq68HySE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by stipa.

View Change

The following approvals got outdated and= were removed: Code-Review+2 by flichtenheld

Warn user if INFO control command is too long=


"INFO_PRE,..." command length is limited to 256 bytes. If= the server
implementation pushes command which is too long, warn the us= er and
don't send the truncated command to a management client.
<= br>Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542
Signed-off-by: L= ev Stipakov <lev@...515...>
Acked-by: Frank Lichtenheld <frank@= ...2641...>
Message-Id: <20230922105055.37969-1-frank@...2641...&g= t;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net= /msg27062.html
Signed-off-by: Gert Doering <gert@...1296...>
(c= herry picked from commit df624fb6d63db6b2a3b0c40597cee74c61b8ab2c)
---M src/openvpn/push.c
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/32=
9/2
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
= index d468211..19849c5 100644
--- a/src/openvpn/push.= c
+++ b/src/openvpn/push.c
@@ -244,8 +244,1= 4 @@
* for management greeting and we don't w= ant to confuse the client
*/
= struct buffer out =3D alloc_buf_gc(256, &gc);
- buf_printf(&out, ">%s:= %s", "INFOMSG", m);
- management_notify_generic(management, BSTR(&out));=
+ if (buf_pri= ntf(&out, ">%s:%s", "INFOMSG", m))
+ {
+ management_notify_generic(man= agement, BSTR(&out));
+ }
+ = else
+ {
+ msg(D_PUS= H_ERRORS, "WARNING: Received INFO command is too long, won't notif= y management client.");
+ }

gc_free(&= gc);
}

To view, vi= sit chang= e 329. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: If3c27a2a2ba24f2af0e3e3c95ee= a57ed420b2542
Gerrit-Change-Number: 329
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--NGbmq68HySE=--