From patchwork Mon Mar 4 14:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3632 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1888:b0:559:d8ef:cc57 with SMTP id r8csp2704104max; Mon, 4 Mar 2024 06:55:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHQteYE3JlJE/iMx4vInN1n8coTFuTftSHDrWmcs62M9Etl2RiPXzQwCE/cFd+vHJy3nW9eKlopEwhQxziGrbyUtx6SJs= X-Google-Smtp-Source: AGHT+IEA6Ko6he8Pc8DACyKOTSF8xkfhSI1Lc4TmBcxUjPDbqVd1PZsKzkz0S/00ctV8XugeFsfP X-Received: by 2002:a05:6830:1e52:b0:6e4:e100:7efb with SMTP id e18-20020a0568301e5200b006e4e1007efbmr4590600otj.1.1709564120803; Mon, 04 Mar 2024 06:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709564120; cv=none; d=google.com; s=arc-20160816; b=kOBFFY7FeYnDaIhWlE9iDZw2rzz01hIsgLu2PYYiVPizPw7Tpu0xB/GptHmiyVcH4+ wivYdXGKna6sZT0Td6N6Qj1i9lHRxdewRsPKPGo8K/lFb2mRHbzLVKSvGnR38X+75lhK ItoHZJmcHedxP8ue9cQVXb9kRJf3Nl3liPf0X95k4WH0VAf6kRypT/t5HkY7gz8Nviqx 2q1TRRWeJmXvgYw020FZa6gjvetXfCzZa/tZdxPzfWO4jnf+pB184X1DXtygqv6Sf7SA 1+XGXG0jWvnv7JQ4s3a6oaIvVyCDih18DTg3tdiYfZgRqd2JhrJu9myFu1RwcrjMii+Z /mxw== 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=YLiUs2mUO0TDZDE8wMSFcuszUakwK82oyG+m+vTILEc=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=MFXDQ76faKa9nOdTYeCAlOoodjiet5JSH0adWmHbU5jpLBMfxPTjKfCBM15OoQi59h sFt6sssdQuQQA41sgsmpB04QTJuwKWVu7uI+Ce8ZI3rWB5f9AFVI92QBfJj14cSGqG7h tzD4UN5RN/9f+KlaorKEZ0jpf5LO4YgKKhmtvbL5aJfpUSvMfuJJgKLbKw+pEzp1H8b3 cjKOdQhTAVYqhgWWLs/JBnnYeG+VRe2Dm2IYw8J8BL7/K+rDaxIFnTf3+36WcnlY/k8z CXc1ZCXYVuUaij1KwW8xch9MXVq1zMisV8qOBbgEbg1JJTmQ9lZVetJYWw7vaTQAgaQ3 3K6A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bLh6lS+5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=SnStopVX; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=IJFhk6SW; 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 r6-20020a635d06000000b005dc82971734si8446646pgb.387.2024.03.04.06.55.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2024 06:55:20 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bLh6lS+5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=SnStopVX; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=IJFhk6SW; 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-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rh9iL-0005xO-Vp; Mon, 04 Mar 2024 14:54:50 +0000 Received: from [172.30.20.202] (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.95) (envelope-from ) id 1rh9iK-0005xI-Dr for openvpn-devel@lists.sourceforge.net; Mon, 04 Mar 2024 14:54:49 +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=DL75Jobx1w4GKn/6pTG4+kriaAppLhewUuYI8q48meA=; b=bLh6lS+5U/ETG+GMg01Zj+ksDK ZATVdylh1OufoyYFtB9ZP3SjTZRWZTwm7ANfHpl004VWQRU83eoyg1jmaha5kuNAIz1gLiIn7T2ik 5F3NQ7/BgkPsjD5PakZ+iO2lwcSjrSdMzWiAlI/yTI/T9g7jM/N6UU597DCNoAlkJM9w=; 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=DL75Jobx1w4GKn/6pTG4+kriaAppLhewUuYI8q48meA=; b=S nStopVXR+MU1vYYHBH9mqXf2iQ9hY5znUtyPcSc/attg9uxO99aaTDjxE1f6ZZkHQiXzGpKTnxwMX Cl4JlF4nZicq4W6HF/kKlVzavOE3Riu/knLXgJ/RAXHHemJepdvVsXP7RPgzrMOytFoRqllm2c5P/ uj6tzMGpciwIA5gg=; Received: from mail-lj1-f181.google.com ([209.85.208.181]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1rh9iE-0008B1-8Z for openvpn-devel@lists.sourceforge.net; Mon, 04 Mar 2024 14:54:49 +0000 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d33986dbc0so39477951fa.2 for ; Mon, 04 Mar 2024 06:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1709564076; x=1710168876; 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=DL75Jobx1w4GKn/6pTG4+kriaAppLhewUuYI8q48meA=; b=IJFhk6SWykbYtKVhpgSTKO52BoLEQaTqqqPyxCBBmNr7K+YdHeOylX1VzQWMNRobRg kffQVEMc3CU/86OH1n5FI6T3bGyVAo0KsCEZHf0lLMQ0X6BE1C/ffskkSBfQe5wOjb09 j+hyTPzqwO6IdijLKaARyxjxmf5YPO4wHDXko5tOVkMtc770J+7a/H2wZ02czhUm4oHp JpqrLrK0a5YMmH5DVCrEH6ywVfYeVK9TjXeFJcxB7OFdV6KTsDNJV0DFaxV6BUIuPPT1 gYtSqkxJQF5KfJqiLjrgo2HeKCuMeU0bYRP9jaSGiylCPb2HtPZv5FLArvrdu3x6swB/ ZSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709564076; x=1710168876; 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=DL75Jobx1w4GKn/6pTG4+kriaAppLhewUuYI8q48meA=; b=xKX4jb/KL2Gl+W1TDdNiRktVEyobf9BO9CW2UYcUPhI5Gsdo8qrWpibCLE9sVyi+hf 18BcHVACiCkjd9eHk+AAd9tAPKRPWsuH/2AtPY0dplxpT4Fz2EHoRB1cGIlZmQySowhP gCuIU3z1n6ERwCq5MyCf5yv7I3TV39KN/iZPhq6luTHRBWKYw4pXrMbcjZlHP30pQojS uQZObW4VcPyP95kP0LTbGaq8J03B0QYVftWU0WPGHPjL9Tc+Mzy9ZdAm60GPa9PYfgD8 ewa5NRDW01OxWLFVYqgg3xQHkIqq7pdh9Amh1hMHd2i/OYtSRuf05afOAaFzRZmzcQmw M1qw== X-Gm-Message-State: AOJu0Yw45aAHqg7iYUj0GShDVrbwaJ8TyrVkexLxza8AXq3nndqGm3UV Ctu7r/Gv+qKTAZ0XqkSOLckvMKSX9N1hpl8DxlHqm67OGXBXmMfmVbvgEIV+VxYKbGQ2yBkbRXw j X-Received: by 2002:a2e:2c15:0:b0:2d3:5629:10be with SMTP id s21-20020a2e2c15000000b002d3562910bemr4938616ljs.16.1709564076261; Mon, 04 Mar 2024 06:54:36 -0800 (PST) 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 v13-20020a05600c444d00b00412e5a359a5sm2192619wmn.15.2024.03.04.06.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 06:54:35 -0800 (PST) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 4 Mar 2024 14:54:35 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Icfc179490d6821e22d14817941fb0bad667c713f X-Gerrit-Change-Number: 533 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 76c9dfa92f6744e7e7e370daac3a624cbd148fc5 References: Message-ID: <1af6c91fafd75497cc417e91903d7eb164c00bbe-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 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.208.181 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.181 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_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 -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1rh9iE-0008B1-8Z Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Avoid SIGUR1 to SIGHUP when the configuration is read from stdin 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: arne-openvpn@rfc2549.org, 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?1792607907411952344?= X-GMAIL-MSGID: =?utf-8?q?1792607907411952344?= X-getmail-filter-classifier: gerrit message type newchange 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/+/533?usp=email to review the following change. Change subject: Avoid SIGUR1 to SIGHUP when the configuration is read from stdin ...................................................................... Avoid SIGUR1 to SIGHUP when the configuration is read from stdin If the configuration is read from stdin, we cannot reread the configuration as stdin provides the configuration only once. So whenever we hit the "close_context usr1 to hup" logic, the OpenVPN process will fail as tries to restart with an empty configuration. Change-Id: Icfc179490d6821e22d14817941fb0bad667c713f Signed-off-by: Arne Schwabe --- M src/openvpn/openvpn.c 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/33/533/1 diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c index 874facf..4d1437d 100644 --- a/src/openvpn/openvpn.c +++ b/src/openvpn/openvpn.c @@ -32,6 +32,7 @@ #include "multi.h" #include "win32.h" #include "platform.h" +#include "string.h" #include "memdbg.h" @@ -60,9 +61,10 @@ /* set point-to-point mode */ c->mode = CM_P2P; - - /* initialize tunnel instance */ - init_instance_handle_signals(c, c->es, CC_HARD_USR1_TO_HUP); + /* initialize tunnel instance, avoid SIGHUP when config is stdin since + * reading the config from stdin will not work */ + bool stdin_config = c->options.config && (strcmp(c->options.config, "stdin") == 0); + init_instance_handle_signals(c, c->es, stdin_config ? 0 : CC_HARD_USR1_TO_HUP); if (IS_SIG(c)) { return;