From patchwork Mon Aug 1 05:08:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2617 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.27.255.54]) by backend30.mail.ord1d.rsapps.net with LMTP id YOd+NI7s52LSDwAAIUCqbw (envelope-from ) for ; Mon, 01 Aug 2022 11:09:02 -0400 Received: from proxy15.mail.iad3a.rsapps.net ([172.27.255.54]) by director8.mail.ord1d.rsapps.net with LMTP id gM+PNI7s52J5bAAAfY0hYg (envelope-from ) for ; Mon, 01 Aug 2022 11:09:02 -0400 Received: from smtp19.gate.iad3a ([172.27.255.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3a.rsapps.net with LMTPS id uGc2LI7s52KleAAAHi9b9g (envelope-from ) for ; Mon, 01 Aug 2022 11:09:02 -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: smtp19.gate.iad3a.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=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: e00fb450-11ab-11ed-8cae-5254005d39f2-1-1 Received: from [216.105.38.7] ([216.105.38.7:46276] helo=lists.sourceforge.net) by smtp19.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 0E/D3-07850-E8CE7E26; Mon, 01 Aug 2022 11:09:02 -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.94.2) (envelope-from ) id 1oIX1O-0003jh-H4; Mon, 01 Aug 2022 15:07:55 +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.94.2) (envelope-from ) id 1oIX1L-0003jb-Mn for openvpn-devel@lists.sourceforge.net; Mon, 01 Aug 2022 15:07:52 +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:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OStqHSrYt7C2Lhh4d16P3+RtIwJLMzd0H2tQnQzAW6E=; b=D1szn5NCKW8eqDp8ErBRzOKf8a E+GlYhKjLSbgzNIH3USupPN4c3JwTcgkKaSXeeMfWYNIPxwzCXgCDf6r2tKecYmZ0TSr65ZX9KV7H 2wubjOkkIkPYSDzmDyslXd9b51tTV6aeefySgAVpVJtF3zrFqOvbpaYeIpGAxVEwxJV4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=OStqHSrYt7C2Lhh4d16P3+RtIwJLMzd0H2tQnQzAW6E=; b=c Gc84BCxY0A86NGHgPxY+3y9CFJl9Mx2lSRa1IQtLm+M4Sz/UIpULps5NqcUvtIoco+I6p3oZHuDlC cwpTpzBJEWH4wmA7ut31TvbGv9IUHUfwxYRyftosldQ48cubMtZ3XCVE0zRZv4vNZWajkh+eq2tTp newiohU/G8J6gBQA=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oIX1K-00HQsp-AF for openvpn-devel@lists.sourceforge.net; Mon, 01 Aug 2022 15:07:52 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Mon, 1 Aug 2022 17:08:12 +0200 Message-Id: <20220801150812.32561-1-a@unstable.cc> 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: The DCO logic is uanble to proceed without --dev argument, therefore just disable DCO if no --dev was specified by the user. Right now, calling openvpn with DCO enabled (default) and no --dev specified leads to a crash, because --dev is assumed to always be there. Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1oIX1K-00HQsp-AF Subject: [Openvpn-devel] [PATCH] disable DCO if no --dev was specified 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The DCO logic is uanble to proceed without --dev argument, therefore just disable DCO if no --dev was specified by the user. Right now, calling openvpn with DCO enabled (default) and no --dev specified leads to a crash, because --dev is assumed to always be there. Reported-by: Frank Lichtenheld Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- src/openvpn/dco.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index b3fd135f..a3a081b2 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -109,6 +109,11 @@ dco_check_option_conflict(int msglevel, const struct options *o) return false; } + if (!o->dev) + { + return false; + } + if (!dco_check_option_conflict_platform(msglevel, o)) { return false;