From patchwork Thu Nov 5 13:47:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5605 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp1844545laa; Thu, 5 Nov 2026 05:47:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBwf49ZxT8Mhj5R4bGRwUMBIJqmJ0U187bucjQsWre4RSDx1/yWunqL/2Jf+um0q/a2msvUtnNPN9j0=@openvpn.net X-Received: by 2002:a05:6830:2313:b0:81b:a5f9:3490 with SMTP id 46e09a7af769-85d365eec32mr15471028a34.24.1793886458492; Thu, 05 Nov 2026 05:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793886458; cv=none; d=google.com; s=arc-20260327; b=GotFB3xhnf7runJXDi2xu71xx1USxtuppAXR1Sf4TQdK0FAt34vIRlg9rs4V3myIu4 gAdZ7vJRpdWQnoCdTOoGgo11gN2o5X5TNWT77zxSJmFw9mzU9PEDCbMB7Tprgn+MI2/2 K96c4bxxAWjfhMSp0ehcF1SNHJO1DfYcITo7dcPrrYuWKC3lzxEuyRu2DCD/I9OBVo1O 4hv0Wkq9Md399sE7/+Vpnd+/OJ/oHRfZZA4F0gxz8Z1VHEJIE2ZZff/tafavJ7yoi7xY DhINs8PnXKGaoRSIcC7FaeTwTDLvPIxTRMuXN7nz5zwfSVAdhLaVU2bqLgjk0Ul/+sMX oLSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=WmLPkBQ/JrIqtM6jWQvFlwc1ZnC8gWj2yUrjCL5/sZY=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=EDdguB3QdGMP5bAlri3snnmXofpLBXDDlKhmi8WjRo9J1D+ROxKZWsmxTsiR2py9VR cwpT/Irxo54bhMVMf4EyeB5XtzwlqwQ8zTHCCfvWHwlO/E2IwplTCJHiBKTeh9Tmq+sR ERXqWNlVEyQ3IjsslelGBk7V4bAVBYKJrnyuPJpwhok4rLbzRhvjYBtDwQvOJm4pukPC ilJOz8EUitKyIAmOtKpS8LA58qJsCRLl5UJsLg/gz+HFRqlU/5eODb2JnenGFo5yqt9S RJDF/J3DYZdRcI8UraJP25tvuJhFZYWp7zq9K2xT+5pBZDh7z5jOJXukB0YPmHhNxHjZ lECQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=BTo5cunc; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=loUPqNTh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OX0nvkn1; 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-85ef4016068si7220606a34.141.2026.11.05.05.47.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2026 05:47:38 -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=BTo5cunc; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=loUPqNTh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OX0nvkn1; 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-Unsubscribe-Post: List-Owner; bh=WmLPkBQ/JrIqtM6jWQvFlwc1ZnC8gWj2yUrjCL5/sZY=; b=BTo5cunc5ux75I 1EVATaq0+2Yw7+X567w/jAzMKtki2+zY0YasLLThrINgeirICpflNBWQN7DPGMdQ0nFONJMqcoHFR p5v6PQQUBBLS6xpWdiXggMQKIGLGttZrnOTqakd+ct+jTHyBHvsVf79bOCG07TGeDBXJdGYZMhCRE SqU=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xOxoV-000000007og-1dAx; Thu, 05 Nov 2026 13:47:35 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xOxoT-000000007oa-3Utq for openvpn-devel@lists.sourceforge.net; Thu, 05 Nov 2026 13:47:33 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WR4GPHANCbl80IHadmUf6BEmzrsoVLGtDSk2E5So558=; b=loUPqNThMvfUDwtA5bwMxUW9wR CoH5FPKPwYiHAOdIvQ7IkTlHR3IB47zTnr1TdOIZK8yXiQooVkQwFakcXlyvttg8h4+3pnds63YOv 9O2kplXkOcboCB7Sn3egsdNnC+SqVdGQcoiVrlKipPVTS23lJEEIyu72ka4UIG9/bcVM=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WR4GPHANCbl80IHadmUf6BEmzrsoVLGtDSk2E5So558=; b=OX0nvkn1cdxyGUXNVyYN7a/oGu o3ekC9QhpHBlgpnU3w/A07NJZj/tAYYft1GGiEfqwnmWo5hrIQ6POZP6AraBXgr0LYLellIp2pXnv Lh9fSgmpQt4wTL0RoGDPGyrN/HWssUlOLqNHqeZlziwsstOdu40rAZcq+BmgFaJL+B38=; Received: from [193.149.48.129] (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.100.1) id 1xOxoR-000000005Gt-47TE for openvpn-devel@lists.sourceforge.net; Thu, 05 Nov 2026 13:47:33 +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 6A5DlOPr006637 for ; Thu, 5 Nov 2026 14:47:24 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A5DlOqc006636 for openvpn-devel@lists.sourceforge.net; Thu, 5 Nov 2026 14:47:24 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 5 Nov 2026 14:47:19 +0100 Message-ID: <20261105134724.6621-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 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 If the first pipe instance could not be created, the service stopped with exit code 0, e.g. when another process already owned the name. Keep the error code of CreateClientPipeInstance() intact, logging it before LocalFree() may change it, and use it as the exit code. 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: 1xOxoR-000000005Gt-47TE Subject: [Openvpn-devel] [PATCH v1] openvpnserv: report error if the pipe cannot be created on start 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: 1881026287360917728 X-GMAIL-MSGID: 1881026287360917728 From: Heiko Hund If the first pipe instance could not be created, the service stopped with exit code 0, e.g. when another process already owned the name. Keep the error code of CreateClientPipeInstance() intact, logging it before LocalFree() may change it, and use it as the exit code. Change-Id: I056164a3016d62152dfcbd57f75d58534dda8fc8 Signed-off-by: Heiko Hund Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2113 --- 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/+/2113 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 5e4b555..bffc9da 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -3832,7 +3832,9 @@ if (!ConvertStringSecurityDescriptorToSecurityDescriptor(sddlString, SDDL_REVISION_1, &sd, NULL)) { - MsgToEventLog(M_SYSERR, L"ConvertStringSecurityDescriptorToSecurityDescriptor failed."); + DWORD error = + MsgToEventLog(M_SYSERR, L"ConvertStringSecurityDescriptorToSecurityDescriptor failed."); + SetLastError(error); return INVALID_HANDLE_VALUE; } @@ -3871,14 +3873,15 @@ &sa); } - LocalFree(sd); - if (pipe == INVALID_HANDLE_VALUE) { - MsgToEventLog(M_SYSERR, L"Could not create named pipe"); + DWORD error = MsgToEventLog(M_SYSERR, L"Could not create named pipe"); + LocalFree(sd); + SetLastError(error); return INVALID_HANDLE_VALUE; } + LocalFree(sd); return pipe; } @@ -4043,6 +4046,7 @@ pipe = CreateClientPipeInstance(); if (pipe == INVALID_HANDLE_VALUE) { + error = GetLastError(); goto out; }