From patchwork Wed Apr 21 03:43:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1754 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id wHbVAlosgGB7MQAAIUCqbw (envelope-from ) for ; Wed, 21 Apr 2021 09:44:58 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director11.mail.ord1d.rsapps.net with LMTP id 4FWpAlosgGAdVAAAvGGmqA (envelope-from ) for ; Wed, 21 Apr 2021 09:44:58 -0400 Received: from smtp34.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTPS id 2AhAAlosgGBeCAAAAY1PeQ (envelope-from ) for ; Wed, 21 Apr 2021 09:44:58 -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: smtp34.gate.ord1d.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: c2124982-a2a7-11eb-a911-5254008bd48f-1-1 Received: from [216.105.38.7] ([216.105.38.7:48778] helo=lists.sourceforge.net) by smtp34.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 6F/A3-25660-85C20806; Wed, 21 Apr 2021 09:44:57 -0400 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.90_1) (envelope-from ) id 1lZD9F-0005qw-61; Wed, 21 Apr 2021 13:44:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZD9C-0005q2-8S for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 13:44:06 +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=eUhBj5pQNLAmbi2i2hwPchQ5l17cMI2G+qwReeF9qCw=; b=GCkeXzwIJOpdtsiKQCxzetXy1p YemhitWyClf/yB6AMrEDC/KBuckhjMolBO3GIeKf/eaCurWxph6jlqxlUwoa13gEW8x50tLVU7xEh QkoCjbs5y8zXmZlfv0orXIzWrthlFMMcKhZOZg61Nk6Znx7gvUOnvtLngdAAQpNQCvD4=; 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=eUhBj5pQNLAmbi2i2hwPchQ5l17cMI2G+qwReeF9qCw=; b=VGIaf/ekb98QjkLptuGSsyO1B9 m1flpGK63y812i0M48ipjbzJdbzGAfK4CWR8bKd1bKGDBdiRsUYd1/XzzP+zIP/LGraHMjvqnd4JD autx9yf2uSCgCiUekzgDWjmTHUGLvczvfyWOiu/F6czvjLLkRQd10VfuMV5g5mwe5Wfs=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lZD95-0088oW-CZ for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 13:44:06 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lZD8u-0004QX-8w for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 15:43:48 +0200 Received: (nullmailer pid 1950457 invoked by uid 10006); Wed, 21 Apr 2021 13:43:48 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 21 Apr 2021 15:43:47 +0200 Message-Id: <20210421134348.1950392-6-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210421134348.1950392-1-arne@rfc2549.org> References: <20210421134348.1950392-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 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 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lZD95-0088oW-CZ Subject: [Openvpn-devel] [PATCH 6/7] Replace OS_SPECIFIC_DIRSEP with PATH_SEPARATOR 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 We have two define that do exactly the same. Also move the check from configure.ac to syshead.h since it is really only checking for Windows. Signed-off-by: Arne Schwabe --- configure.ac | 8 -------- src/openvpn/platform.c | 2 +- src/openvpn/ssl_verify.c | 2 +- src/openvpn/syshead.h | 6 ++++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index a67bf2595..3b4d3cbc7 100644 --- a/configure.ac +++ b/configure.ac @@ -1133,14 +1133,6 @@ if test -n "${GIT}" -a -d "${srcdir}/.git"; then fi AC_MSG_RESULT([${GIT_CHECKOUT}]) -if test -n "${SP_PLATFORM_WINDOWS}"; then - AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['\\\\'], [Path separator]) #" - AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["\\\\"], [Path separator]) #" -else - AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['/'], [Path separator]) - AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["/"], [Path separator]) -fi - dnl enable --x509-username-field feature if requested if test "${enable_x509_alt_username}" = "yes"; then if test "${with_crypto_library}" = "mbedtls" ; then diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index c63c1d994..bf7b1aa0a 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -486,7 +486,7 @@ platform_gen_path(const char *directory, const char *filename, struct buffer out = alloc_buf_gc(outsize, gc); char dirsep[2]; - dirsep[0] = OS_SPECIFIC_DIRSEP; + dirsep[0] = PATH_SEPARATOR; dirsep[1] = '\0'; if (directory) diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index 7608155cd..14aaf2bf7 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -616,7 +616,7 @@ verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert, goto cleanup; } - if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, OS_SPECIFIC_DIRSEP, serial)) + if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, PATH_SEPARATOR, serial)) { msg(D_HANDSHAKE, "VERIFY CRL: filename overflow"); goto cleanup; diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index a964ffd35..28ccca087 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -432,9 +432,11 @@ typedef unsigned short sa_family_t; * Directory separation char */ #ifdef _WIN32 -#define OS_SPECIFIC_DIRSEP '\\' +#define PATH_SEPARATOR '\\' +#define PATH_SEPARATOR_STR "\\" #else -#define OS_SPECIFIC_DIRSEP '/' +#define PATH_SEPARATOR '/' +#define PATH_SEPARATOR_STR "/" #endif /*