From patchwork Sat Oct 3 13:26:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5430 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:2999:b0:8b3:6e77:b38b with SMTP id f25csp1727092max; Sat, 3 Oct 2026 06:26:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByQ5bgzzTiHtWrnxWxw6vbj43oqs5vjE97yKPkFVo/B8QJHAojOrlHFn8BMhPc3lpXGe+b+oqDmZv0=@openvpn.net X-Received: by 2002:a05:687c:4088:b0:455:d4ba:1dc6 with SMTP id 586e51a60fabf-49e158f72c3mr5367217fac.5.1791033994285; Sat, 03 Oct 2026 06:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791033994; cv=none; d=google.com; s=arc-20260327; b=meYC+pDCMy1xfUNCaQip0OnMX0MFCLEd0x1LsHToy4hoPNxMDGwcB3NiktQkTj76c1 RjVaL8AX2ojN0q9tcpv18881S8tLBXv2DDTtd50yOrysO1v9QqTDd1Is1WE4a/WbOTP/ QOvP2np8lO7ipxY7Uvi+Lkueo6j9DaQuPrs7NyjJxnhF/KO0p7U3VdrLKvP1r0GGu3eP RZS7fITXKwBroGe4KSmJO2sjh8Yc0Kk+IfXBg+f445C9XAWTP9H0vLpzbSzlnWky+4fj o7ja9y3hkYauUeQ20/Q5PgHC9FsO+8Tg/VGwl63d3hBlMOmTyBzCIa7zRwDNSCk9ZdIn L22A== 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=vwCCEQBqciJdzgxqqpRRjWhMTtK6lzchZMFN0z/nBk4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=IgQN75t/jiomxn9suYPDjMvR6ievueSFN4QbpdieAMlLwAvKTkpe8lfOnhGSWLHd38 v1IAqToEKrAo+owRuw+i8X/J9O2w8ni1nWDE+vEFZTLoP6EsTCyYD3cnzGUG1Z+NTS4d f5JffoQp7CfUKFzQ3wq/1V+0lM5CVU+EPMgDR7Kpwf1R2IcoB8T2U6M1KrWw41k6pLpA gIoeK06XHT/0J3A94MaWQ9+HRTv2LUGu1cJbxuyfRs6bGGYokczFTOJQeuBocKyDeS/H DqUaVL+MwTx8sjrJzRioVamxeLvgvQn5tQ+zuMBP0FfOvWbZXB0XHsHjXgiyb57KVdHw +fRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=T1NRpK6m; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FiU3zZEA; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=fYc3Jt5e; 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 586e51a60fabf-49e16e02c3dsi8348185fac.72.2026.10.03.06.26.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Oct 2026 06:26:34 -0700 (PDT) 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=T1NRpK6m; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=FiU3zZEA; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=fYc3Jt5e; 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-Owner; bh=vwCCEQBqciJdzgxqqpRRjWhMTtK6lzchZMFN0z/nBk4=; b=T1NRpK6mlZft4+RGIfo7HK2jf6 iMUbJ+1nwOYZCJNgf/pcpV/hVBKGomDMjcJDT6r18a5wl5HipzGzuH4NA558IvzhkMabdyL3+aVsB AUyyh43Fpmf/P/6InK8Boxgv/4I3xPhzQStj8wF8ZaTHU0mNhMwWtYyVgmkj4DQkQbLA=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1xCzl1-0004J6-4Z; Sat, 03 Oct 2026 13:26:31 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1xCzkz-0004Iz-Ci for openvpn-devel@lists.sourceforge.net; Sat, 03 Oct 2026 13:26:30 +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=XqAkZ0a/1VVQLRpHBNXePRKZZnnBtjj3+hINsiml8uc=; b=FiU3zZEAcwStCnhl3OD+LeFMws MobbdG4p2DWyKpTOzylC2N6HTLApZeXAWqsamzB9f8NgRHEsPOGaxcTcG1e/+jGBT1dPzKAHs/ADZ mJLBcBCCiruw8MdfAlZ297tzJrww4HnQY9Lz3hlw6Sxp/7RW4jxBe11fVnxPx9gC+uGw=; 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=XqAkZ0a/1VVQLRpHBNXePRKZZnnBtjj3+hINsiml8uc=; b=fYc3Jt5eJPQFwtQdp4Ui423W1n JTkGGhCMNgDLbnCKfexwydL4kgzImslp+ufCd1ac4JDfWoW8qUwWbaXsppv6+/sAGytyy4dLsY96X Td3z7JpejCHvtVSKpRsR3ixdlAyNlOOBKk2Vj27bgaUt2EtWJbSPJWdYBHiy9Hor30/Q=; 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.95) id 1xCzky-0006fi-Rx for openvpn-devel@lists.sourceforge.net; Sat, 03 Oct 2026 13:26:30 +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 693DQKPb012306 for ; Sat, 3 Oct 2026 15:26:20 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 693DQKRS012305 for openvpn-devel@lists.sourceforge.net; Sat, 3 Oct 2026 15:26:20 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sat, 3 Oct 2026 15:26:14 +0200 Message-ID: <20261003132620.12292-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.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: Arne Schwabe Checking for something that is available on all (non Windows) platforms is not very useful. So just always use termios.h Change-Id: I09b055f15e35614eab112ff69166c6985f8770da Signed-off-by: Arne Schwabe Acked-by: Gert Doering Acked-by: Frank Lichtenheld Ger [...] 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: 1xCzky-0006fi-Rx Subject: [Openvpn-devel] [PATCH v2] Assume termios.h is available on all non Windows platforms 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: 1878035261958576887 X-GMAIL-MSGID: 1878035261958576887 From: Arne Schwabe Checking for something that is available on all (non Windows) platforms is not very useful. So just always use termios.h Change-Id: I09b055f15e35614eab112ff69166c6985f8770da Signed-off-by: Arne Schwabe Acked-by: Gert Doering Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1967 --- 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/+/1967 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering Frank Lichtenheld diff --git a/configure.ac b/configure.ac index 1fa0e63..195116f 100644 --- a/configure.ac +++ b/configure.ac @@ -459,7 +459,7 @@ sys/time.h sys/ioctl.h sys/stat.h \ sys/mman.h sys/file.h sys/wait.h \ libgen.h stropts.h \ - syslog.h pwd.h grp.h termios.h \ + syslog.h pwd.h grp.h \ sys/sockio.h sys/uio.h \ poll.h sys/epoll.h err.h \ ]) diff --git a/src/openvpn/console_builtin.c b/src/openvpn/console_builtin.c index 9c8d72a..10369283 100644 --- a/src/openvpn/console_builtin.c +++ b/src/openvpn/console_builtin.c @@ -37,7 +37,7 @@ #include "buffer.h" #include "misc.h" -#ifdef HAVE_TERMIOS_H +#ifndef _WIN32 #include #endif @@ -134,10 +134,7 @@ return false; } -#endif /* _WIN32 */ - - -#ifdef HAVE_TERMIOS_H +#else /** * Open the current console TTY for read/write operations @@ -176,7 +173,7 @@ } } -#endif /* HAVE_TERMIOS_H */ +#endif /** @@ -197,10 +194,8 @@ ASSERT(capacity > 0); input[0] = '\0'; -#if defined(_WIN32) +#ifdef _WIN32 return get_console_input_win32(prompt, echo, input, capacity); -#elif !defined(HAVE_TERMIOS_H) - msg(M_FATAL, "Sorry, but I can't get console input on this OS (%s)", prompt); #else bool restore_tty = false; bool ret = false; @@ -261,7 +256,7 @@ close_tty(fp); return ret; -#endif /* if defined(_WIN32) */ +#endif } /**