From patchwork Tue Oct 11 00:01:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2812 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id KFfLN1ZNRWPTOgAAIUCqbw (envelope-from ) for ; Tue, 11 Oct 2022 07:02:46 -0400 Received: from proxy6.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id SOfAN1ZNRWMKLgAAovjBpQ (envelope-from ) for ; Tue, 11 Oct 2022 07:02:46 -0400 Received: from smtp18.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.iad3b.rsapps.net with LMTPS id AIQ1MlZNRWP1EQAARawThA (envelope-from ) for ; Tue, 11 Oct 2022 07:02:46 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp18.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 3c1f1daa-4954-11ed-b57f-5254009ad1d4-1-1 Received: from [216.105.38.7] ([216.105.38.7:50184] helo=lists.sourceforge.net) by smtp18.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 5B/2F-18652-55D45436; Tue, 11 Oct 2022 07:02:46 -0400 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 1oiD1C-0006F6-Mv; Tue, 11 Oct 2022 11:01:50 +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 1oiD0x-0006Eu-CD for openvpn-devel@lists.sourceforge.net; Tue, 11 Oct 2022 11:01:35 +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=BXRcUZXLVw0U0wAs9YBVRfJMEUyvWEvHYHjiQpLKc4o=; b=Gp8mXv7W7VaV3d6tivmRTFw+FZ lPn5wFfaaNp6UtB7ymE0oTBYU6D3NsDTlbqbpEOVayPH+Hx8Z6vfM/HWi76sMFXyp8MnWxgfNrV7F aLtgvkcGUSBmeH/eeBH+9YSpxJXMHtuyp1Wz2skUlO3pCzRjFfpSUA/xXBzMIEh18sVU=; 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=BXRcUZXLVw0U0wAs9YBVRfJMEUyvWEvHYHjiQpLKc4o=; b=ejq+1timKA+RkZEVE8HCSrP3p9 XCE7VPuWmXRYeJ5E5azPGzEG6M3zZ+YYJj6SiriT2gYB17K2zGRcP4Xt+0RHnQ1hFYAr+JU5qIRMb pLp4l4r24ybWjvlvkPcpDA9mjAxPgrRj4qhvTpJ4bBGM/Tusgw8nq/7YiTPNiGv1FJvE=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oiD0v-0003BU-Kl for openvpn-devel@lists.sourceforge.net; Tue, 11 Oct 2022 11:01:35 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1oiD0o-000KLa-64 for openvpn-devel@lists.sourceforge.net; Tue, 11 Oct 2022 13:01:26 +0200 Received: (nullmailer pid 1798160 invoked by uid 10006); Tue, 11 Oct 2022 11:01:26 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 11 Oct 2022 13:01:26 +0200 Message-Id: <20221011110126.1798114-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: From the implemention and the fact that it is a an OCC message (basically the rudimentary predecessor to control channel), this message is very old. I think in the past this feature fit nicely to the weird inetd + openvpn mode that seems to have far to many hacks still left in our code. With inetd, it made sense that the server instance quits if y [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1oiD0v-0003BU-Kl Subject: [Openvpn-devel] [PATCH] Change explicit exit notification to be a SIGUSR1 instead of a SIGTERM signal 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 From the implemention and the fact that it is a an OCC message (basically the rudimentary predecessor to control channel), this message is very old. I think in the past this feature fit nicely to the weird inetd + openvpn mode that seems to have far to many hacks still left in our code. With inetd, it made sense that the server instance quits if you press C-c on the client. In our current state where inetd is no longer supported, this behaviour to exit makes little sense and this patch changes the behaviour to SIGUSR1. Signed-off-by: Arne Schwabe --- src/openvpn/occ.c | 2 +- src/openvpn/push.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/occ.c b/src/openvpn/occ.c index 1ed0d3771..eb1f2fae7 100644 --- a/src/openvpn/occ.c +++ b/src/openvpn/occ.c @@ -431,7 +431,7 @@ process_received_occ_msg(struct context *c) case OCC_EXIT: dmsg(D_PACKET_CONTENT, "RECEIVED OCC_EXIT"); - c->sig->signal_received = SIGTERM; + c->sig->signal_received = SIGUSR1; c->sig->signal_text = "remote-exit"; break; } diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 26259c6b8..da8c456b1 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -193,7 +193,7 @@ void receive_exit_message(struct context *c) { dmsg(D_STREAM_ERRORS, "Exit message received by peer"); - c->sig->signal_received = SIGTERM; + c->sig->signal_received = SIGUSR1; c->sig->signal_text = "remote-exit"; #ifdef ENABLE_MANAGEMENT if (management)