[Openvpn-devel,v3] iservice: validate config path case-insensitive

Message ID 20251112093911.24196-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v3] iservice: validate config path case-insensitive | expand

Commit Message

Gert Doering Nov. 12, 2025, 9:39 a.m. UTC
From: Heiko Hund <heiko@ist.eigentlich.net>

Windows filesystems do not differentiate by case, so we shouldn't either.

Reported-by: stephan@srlabs.de
Change-Id: I4d905da3add9b8a3daf349eb1bc830a017cf493d
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1362
---

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/+/1362
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Lev Stipakov <lstipakov@gmail.com>

Comments

Gert Doering Nov. 12, 2025, 10:40 a.m. UTC | #1
Split off #1307 to give proper attribution - thanks for that.  This is
really important, to give due credits.

The change itself is straightforward and got its +2 already over there ;-)

Your patch has been applied to the master branch.

commit 39581501ebf85336c8219296c6440226947cbe52
Author: Heiko Hund
Date:   Wed Nov 12 10:39:05 2025 +0100

     iservice: validate config path case-insensitive

     Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1362
     Message-Id: <20251112093911.24196-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34340.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpnserv/validate.c b/src/openvpnserv/validate.c
index b3189b7..3381503 100644
--- a/src/openvpnserv/validate.c
+++ b/src/openvpnserv/validate.c
@@ -78,7 +78,7 @@ 
         res = PathCchCanonicalize(config_path, _countof(config_path), fname);
     }
 
-    return res == S_OK && wcsncmp(config_path, s->config_dir, wcslen(s->config_dir)) == 0;
+    return res == S_OK && wcsnicmp(config_path, s->config_dir, wcslen(s->config_dir)) == 0;
 }