Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cd" option fails in OpenVPN version 2.6.7 #448

Closed
trispace opened this issue Nov 10, 2023 · 2 comments
Closed

"cd" option fails in OpenVPN version 2.6.7 #448

trispace opened this issue Nov 10, 2023 · 2 comments
Assignees

Comments

@trispace
Copy link

Describe the bug
After updating to OpenVPN 2.6.7 [git:v2.6.7/53c9033317b3b8fd] from OpenVPN 2.6.6 the "cd" option in the configuration file prevents OpenVPN from connecting due to the following error:

2023-11-10 16:28:13 cd to 'c:\Program Files\OpenVPN\config\test' failed: No such file or directory (errno=2)
2023-11-10 16:28:13 Exiting due to fatal error

in the configuration file "cd" was used like this:

[...]
cd "c:\\Program Files\\OpenVPN\\config\\test"
ca ca.crt
tls-auth ta.key 1
[...]

the mentioned directory exists and also the ACEs were not changed

PS C:\> Get-Item "c:\Program Files\OpenVPN\config\test"

    Directory: C:\Program Files\OpenVPN\config

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          06.06.2021    14:59                test

A trace of the I/O operations of the openvpn.exe process shows that the configuration file is opened and read, but no access to the "test" directory or attempt to read files from it are visible in the trace.

Also replacing the "\" with "//" does not resolve the issue.

To Reproduce
Create a OpenVPN configuration file with the "cd" option and try to connect.

Expected behavior
OpenVPN connects as it did in previous version 2.6.6

Version information (please complete the following information):

  • OS: Windows 22H2 Build 19045.3570
  • OpenVPN version: 2.6.7
@cron2
Copy link
Contributor

cron2 commented Nov 10, 2023

Thanks for the report. From 2.6.6 to 2.6.7, windows building was changed from "MSVC with MSVC build files" to "CMake" (as we do in master since quite a while). The CMakefile had an omission regarding chdir() on windows, so the compile resulted in "there is no chdir() function on Windows" and thus all --cd configs failed. We are sorry about this.

A new windows installer will be released "really soon". A build system patch is already in review.

@trispace
Copy link
Author

Many thanks for the extremely fast response and fix!

cron2 pushed a commit to cron2/openvpn that referenced this issue Nov 11, 2023
This broke in the CMake build since previously we
just always set HAVE_CHDIR to 1 in the MSVC build.
But actually the code should just not check HAVE_CHDIR
on Windows.

Github: fixes OpenVPN/openvpn#448

Change-Id: I0c78ce452135fe2c80275da449215ba926471018
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20231111081808.30967-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27362.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 012ea92)
@cron2 cron2 closed this as completed in 012ea92 Nov 11, 2023
lstipakov added a commit to lstipakov/openvpn-windows-test that referenced this issue Nov 16, 2023
This is to make sure we won't get regressions
like

 OpenVPN/openvpn#448
 OpenVPN/openvpn#454

Signed-off-by: Lev Stipakov <lev@openvpn.net>
cron2 pushed a commit to OpenVPN/openvpn-windows-test that referenced this issue Nov 17, 2023
This is to make sure we won't get regressions
like

 OpenVPN/openvpn#448
 OpenVPN/openvpn#454

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants