From patchwork Wed Nov 26 10:47:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4633 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c3:b0:7b1:439f:bdf with SMTP id j3csp3241193maw; Wed, 26 Nov 2025 02:47:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXwNot5QnvB0jWedrj8QxObNrHKJ08+jkjSMSnonP25YUt/aJm8qv2KEuzURvfaZZ2ILf+88fHiD3Q=@openvpn.net X-Google-Smtp-Source: AGHT+IG96umOd/Mo9HK4c/dC9VZcO/KJfgow5RDIoR0KQvHMQikM6omOxZrLsteqI5jc70y/NYvr X-Received: by 2002:a05:6830:63cd:b0:7c6:cf19:1df1 with SMTP id 46e09a7af769-7c798de9333mr9263515a34.30.1764154038528; Wed, 26 Nov 2025 02:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1764154038; cv=none; d=google.com; s=arc-20240605; b=ECp8Dx+rPIzvsK8SphWY8MneMxZt/KHQzwSPFhC6Q66OFNImXpFdVvMnoYvJHbZD81 chsjIv30MXLSxo+BLF5R2toAH9J5uiueQgpRF5Bjm/bpKOns2Ink3VG958vz4CMc75NL 9zC4Mxpk12KUiKPUfl6KvFJXJfVbciB3Mn8JWv1YtvFZ1ucYe4mn1smeWQEoMp6Ceb6O 6gLYbeUN7FpRzPkkyO7hHKMDy6kKudPNLgL0mSCCuPCY8NAFqUUCsn9kG1emkSlWtb/m D4ELFpG7H8e3+VhNwxMd4ZdtFCvZU0Jbg93yVE4UbbpqTM1E6Lumcj8vGxsFzM0JZR+L j2uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=farW+t3bWge+BdiCiPz2RFedHqc3Jd5tWqN58GFHkIQ=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=cN6eSTVawR7b1Wvj79tmhJ7XSapHx1/zu4Mw0EOam9IktzXOl8c3wgSQb4ZDwiEyIm zeOD0uy4qeWVE2XfpR30i6/nM3uX92rg/6asynDpJsFlOYedTMHWgwdkcCk8NjDOvNrv G+FOhLZRm/ZuygX9ViG3NFaa2T2TtaOqkmVPiSRNZheMMpJkKULk0qPgag29RXX3RqiZ C9tbKSBOqYA3w/+Nt+I0Y4WmjK1vcab9v6DSOE5PNdMewGyWeZzPBNcHuTMoTjfVsHdx Y+2AR8VG8f+GIPqUaWYDzMLjCKh6c+9OerQxwciBPrh/DMBvJ4fhU+tm1k6EM+zDR8zV yeMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="P1wp/Zp8"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EJobJhf2; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eCvXal5G; 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=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7c78d3f410asi3359330a34.275.2025.11.26.02.47.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Nov 2025 02:47:18 -0800 (PST) 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=pass header.i=@lists.sourceforge.net header.s=beta header.b="P1wp/Zp8"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EJobJhf2; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eCvXal5G; 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=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=farW+t3bWge+BdiCiPz2RFedHqc3Jd5tWqN58GFHkIQ=; b=P1wp/Zp8WygqHh3LvLwUqD/2Ye 5ukdI3V83//dLrc3vwnot02O7zkh68aa3tJ0SMixjpYLxTkL50XjWe5YbvxJJACrmsJ5d5SFqkTLc N/d4JbbZDgjNLqmxrU8gqKoFAJDqahZUwD4KeCV/UZ85IPa60u9HiElX46s9d1hS+BWg=; 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 1vOD3L-0004Vf-U5; Wed, 26 Nov 2025 10:47:16 +0000 Received: from [172.30.29.66] (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 1vOD3K-0004VY-4F for openvpn-devel@lists.sourceforge.net; Wed, 26 Nov 2025 10:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qzfXtBBsn8KVytl01J3k8LmRNpCekRQZVBcp0ET0Sqk=; b=EJobJhf2OxytA5NGRSq2VCcaHi J2D0YnxAKEBvW7OmZ/LM7thf5sOfjGjRq1FT7tYGkufr25ODyV+o5mFYw9uVrPsCcLnDq7buhEwZr MRRu3Wcg3LmndJQo1yOTeZUr4rxw3YHCJnRv0e5Rqb0Gzl0K1xRMp2u7FYuL6az+5b94=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qzfXtBBsn8KVytl01J3k8LmRNpCekRQZVBcp0ET0Sqk=; b=eCvXal5GtYKkolJoRwTUB8KlPN 7K+urB0muPcF4CRIc4mIDGlE7P7FsqnXD2EA5WSUPNStH2v+4rtFYbv75Is9bmDK6YFY2XpOhLGjN 7rnhb/4DV+yfrud+7G+wx22OsafN+UCYgh4/tWCECkOCTBgLrkf9JipVGDtmTJvDYz+8=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vOD3J-0006x3-R1 for openvpn-devel@lists.sourceforge.net; Wed, 26 Nov 2025 10:47:14 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5AQAl7ov005399 for ; Wed, 26 Nov 2025 11:47:07 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5AQAl7e4005397 for openvpn-devel@lists.sourceforge.net; Wed, 26 Nov 2025 11:47:07 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 26 Nov 2025 11:47:01 +0100 Message-ID: <20251126104706.5378-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: From: Heiko Hund GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller w [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vOD3J-0006x3-R1 Subject: [Openvpn-devel] [PATCH v3] iservice: handle ignoring itf domains correctly 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1849849584879026442?= X-GMAIL-MSGID: =?utf-8?q?1849849584879026442?= From: Heiko Hund GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong. Reported-by: Marc Heuse Reported-by: stephan@srlabs.de Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc Signed-off-by: Heiko Hund Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394 --- 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/+/1394 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 5fb7f2b..31a7ffa 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2190,14 +2190,16 @@ { if (comma) { - pos = comma + 1; + /* Overwrite the ignored domain with remaining one(s) */ + memmove(pos, comma + 1, buf_size - converted_size); + *size -= domain_size + one_glyph; continue; } else { /* This was the last domain */ *pos = '\0'; - *size += one_glyph; + *size -= domain_size; return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND; } }