From patchwork Mon Sep 11 12:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3342 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:390:b0:d7:3b0f:3938 with SMTP id 16csp2228402dyq; Mon, 11 Sep 2023 05:43:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgbkrvs3OANvIhJuWlD0W4bbjsFLPYKPc1k+POQMSPyp19mxOsMwTxg2XHk+VP5l98bWqX X-Received: by 2002:a05:6870:d60f:b0:1d0:e371:db33 with SMTP id a15-20020a056870d60f00b001d0e371db33mr8301374oaq.3.1694436219783; Mon, 11 Sep 2023 05:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694436219; cv=none; d=google.com; s=arc-20160816; b=yOeojXWhtokP7kquh2rnqsvGv7prGGH2YybWhvOQgI4YqUjWO1JvZo4Wb7qZeHv/dV xH9jFwN5KBtM5iXxbI6Ogo+Vk6+oatppGKwtjHUR0nscLDrMqumR5fuqzwqLqRbhUJm+ IhVIu/ocfC5s9asWW52TdKURTEBujWLWilplynTWOxVjxniFFBiDHd/BzOU00RuRGLIr it0S9EEZb+pQYaX6eOgl3nCvWUDh4hsq1dcxWrG7q9gJvfdag8u+zQvrF8NDDt9YnbW7 hIAfzvApbWTkPByMEByu4QLto9uBAbE0S1YDrnJfMXF9n7hmX1mob2KYThR/VsmLC8WR 7fIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=i+xk2yh+DKvFWFAfE4C83oTvfxNW1VepM1r/nWJO+MM=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=ljQb7VX9SxZFJRq5yuYkTtTj/9ChWNBk+lJEPVUNYEZf+CEkoqfv9OqkDbx2AvKU6a Yha/cljvbfIN0dVhi4HhgnH3xpTxhUTHjz6XVMSXrH+8id4BWDcfolvzX7+aJTpCGrcw v616M1wQYWutHXhmrs/PYN8G6eVdYvBdThSUWCwb7SagQywl1DiPdpwGW6/95itnEjhT /kFLRP84GjUBenYHjat8M2JPDccnLYzf0U2oV8LJqNdRD+57vo8n1nrZwgkQOmPW3yje aac25t2pKF6lMo+q492MJaVuvMHK+ndfEdPWoTCg2WV4qLlbqxnVrMiwKjaaUpKofhyJ v4uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=UepLl299; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OEgWfKvW; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=dejZxQgQ; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id w25-20020a631619000000b0055c872b768fsi5976326pgl.531.2023.09.11.05.43.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2023 05:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=UepLl299; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OEgWfKvW; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=dejZxQgQ; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qfgFX-0004Iv-IZ; Mon, 11 Sep 2023 12:42:42 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qfgFV-0004Ii-E4 for openvpn-devel@lists.sourceforge.net; Mon, 11 Sep 2023 12:42:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1T7gYnx7xKfqZ/FP9K+WNHm2KK9VeWomL3KK02fHFqE=; b=UepLl299o4jm460Gkk4vEl84yI oLd6JwAqc3Zuqu2QoKB8a6NX3VQgYkPZyABCXSD/GOKFg+WWmUlssr3CmyLJQuRYbw/vLh15n6LNU QsvZs6A0L36TLjSz0KX0T4bz7NU3J2jI306wkkdauDhsdnHP4jXhcE90qAORaWwCPbtA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=1T7gYnx7xKfqZ/FP9K+WNHm2KK9VeWomL3KK02fHFqE=; b=O EgWfKvWcphig2laU60uHw8gETNBkpVWR2ykvhrJGap8D6VV//Og8B2xkxq0vNmDi+nvkP7vcR9eyX Bf6g/fdM3gehYzszJRvIqon/NfKF7yQum1Edfzs456ICzQXtGXBaFCtg/I3YJsmlwi6qhoUggEErU fz+wH92weA5sS1is=; Received: from mail-wm1-f45.google.com ([209.85.128.45]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qfgFK-000Iy2-RP for openvpn-devel@lists.sourceforge.net; Mon, 11 Sep 2023 12:42:40 +0000 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-401da71b7faso51255295e9.2 for ; Mon, 11 Sep 2023 05:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1694436144; x=1695040944; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=1T7gYnx7xKfqZ/FP9K+WNHm2KK9VeWomL3KK02fHFqE=; b=dejZxQgQGqIIorOEhLfwHwhEzfMSzn7bAfDdqLjt637G6Tkgbzu00oiCeXfeXaTOKh QdJtDpp0hICQ84DhSEXZ9bsjkvYA6c/0rGSXhWcD+wUvFVRmN+UcoXwzVf6XiVVLGOZB 2uLlxwqipA2pqCAFOA6qYuFoSEEjqzkKtWP0+++hSUt8UsIsob8HWHPdnyTFLgvWQHI2 nCw6gAczI8O2EDuMYFH185PHaeXnECrvgM9HRt+5R3RouMkPfMH44BI/xoynWEOsrdtS sLTZxvZNaPmbfr4bjRYTTrzNlGTZSrSN4qVb7cXps+vrNz+f8lONEDFnR1j/XHvem86A yo3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694436144; x=1695040944; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1T7gYnx7xKfqZ/FP9K+WNHm2KK9VeWomL3KK02fHFqE=; b=BQPzAp6g53qQYp/araqFvl4V7GSmiNLuRtywlSh7VBkxhqPf/3KPIll/Rnxk0z2r4J 8OD07p7o2Uhli6ldNKDUOnxf70yWCDtFZnQWBJd1PMDN4ZZeNjSUuEv3sXVaNJtX/ZUG HWRAB66N6BNTI3rnEzSoplTAcJJNzZ1vux4JWI5ULdafRLkJIncf2MTrKg9EAMoQz2Vm kfG4JL6cPW14e33XL3LRCaamHxcr5Fq4SlFFFOk0eBLBsLrdZtj8+ReGw6Ge0vzHF9E8 YXkYt3mjH9gkJbeHSG+7Ps7ha4WOMIbYuaosyPxLmnjImfi0M2/NqaAdB9ITcBmt3Sh+ t7hQ== X-Gm-Message-State: AOJu0YzDUEJpareVr9liKg2FAHvHKY8vmp4EsKMpDYeYRrbqgN/1A0gG MITDlOXoGyXSkLkcqjzb+g12ZXdmTODNfI5F8DY= X-Received: by 2002:a05:600c:2901:b0:3fc:dd9:91fd with SMTP id i1-20020a05600c290100b003fc0dd991fdmr7661078wmd.40.1694436144165; Mon, 11 Sep 2023 05:42:24 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id f11-20020a7bcd0b000000b003fee53feab5sm9976607wmj.10.2023.09.11.05.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 05:42:23 -0700 (PDT) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 11 Sep 2023 12:42:23 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 X-Gerrit-Change-Number: 329 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 490c13fc46a822a09223da73ce5fde942633f0e8 References: Message-ID: <37df9e97b8e8ea8db6f576e861e934f4252899a2-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.45 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.45 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1qfgFK-000Iy2-RP Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Warn user if INFO control command is too long X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: lstipakov@gmail.com, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1776745153448235573?= X-GMAIL-MSGID: =?utf-8?q?1776745153448235573?= Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/329?usp=email to review the following change. 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 --- M src/openvpn/push.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/329/1 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 = 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); }