Problems with accented characters in username on Windows?
Hi,
I've been skimming through the bug reports and stumbled upon this:
<https://community.openvpn.net/openvpn/ticket/278>
If I understood the bug report correctly, just having a non-ASCII character in the Windows username would prevent OpenVPN from working unless tmp-dir was changed. Has anyone here had this issue?
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
PATCH 1/1 Support non-ASCII characters in Windows tmp path
Get the temporary path from the system as UCS-2 and convert it to UTF-8 and return that for internal use.
--- src/openvpn/win32.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
src/openvpn/win32.c +21 -13
@@ -996,19 +996,27 @@ set_win_sys_path_via_env (struct env_set *es)const char *win_get_tempdir () { -static char buf[MAX_PATH ]; -char *tmpdir = buf; - -CLEAR (buf); - -if (!GetTempPath (sizeof (buf),buf)) { -/* Warn if we can't find a valid temporary directory, which should -* be unlikely. -*/ -msg (M_WARN ,"Could not find a suitable temporary directory." -" (GetTempPath() failed). Consider to use --tmp-dir" ); - tmpdir =NULL ; - } +static char tmpdir[MAX_PATH ]; +WCHAR wtmpdir[MAX_PATH ]; + +if (!GetTempPathW (_countof (wtmpdir), wtmpdir)) + { +/* Warn if we can't find a valid temporary directory, which should +* be unlikely. +*/ +msg (M_WARN ,"Could not find a suitable temporary directory." +" (GetTempPath() failed). Consider to use --tmp-dir" ); +return NULL ; + } + +if (WideCharToMultiByte (CP_UTF8 ,0 , wtmpdir,-1 ,NULL ,0 ,NULL ,NULL ) >sizeof (tmpdir)) + { +msg (M_WARN ,"Could not get temporary directory. Path is too long." +" Consider to use --tmp-dir" ); +return NULL ; + } + +WideCharToMultiByte (CP_UTF8 ,0 , wtmpdir,-1 , tmpdir,sizeof (tmpdir),NULL ,NULL );return tmpdir; }#endif
Signature · 1 line
1.7.9.5
Re: [Openvpn-devel] [PATCH] Support non-ASCII characters in Windows tmp path
I confirm such a bug. Patch resolves it.
still not commited to https://github.com/openvpn/openvpn ?
2013/11/19 Heiko Hund <[email protected]...>:
Quoted 67 lines
Get the temporary path from the system as UCS-2 and convert it to UTF-8 and return that for internal use.
Signed-off-by Heiko Hund <[email protected]...>--- src/openvpn/win32.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)src/openvpn/win32.c +21
-14@@ -996,19 +996,27 @@ set_win_sys_path_via_env (struct env_set *es)const char *win_get_tempdir () { -static char buf[MAX_PATH ]; -char *tmpdir = buf; - -CLEAR (buf); - -if (!GetTempPath (sizeof (buf),buf)) { -/* Warn if we can't find a valid temporary directory, which should -* be unlikely. -*/ -msg (M_WARN ,"Could not find a suitable temporary directory." -" (GetTempPath() failed). Consider to use --tmp-dir" ); - tmpdir =NULL ; - } +static char tmpdir[MAX_PATH ]; +WCHAR wtmpdir[MAX_PATH ]; + +if (!GetTempPathW (_countof (wtmpdir), wtmpdir)) + { +/* Warn if we can't find a valid temporary directory, which should +* be unlikely. +*/ +msg (M_WARN ,"Could not find a suitable temporary directory." +" (GetTempPath() failed). Consider to use --tmp-dir" ); +return NULL ; + } + +if (WideCharToMultiByte (CP_UTF8 ,0 , wtmpdir,-1 ,NULL ,0 ,NULL ,NULL ) >sizeof (tmpdir)) + { +msg (M_WARN ,"Could not get temporary directory. Path is too long." +" Consider to use --tmp-dir" ); +return NULL ; + } + +WideCharToMultiByte (CP_UTF8 ,0 , wtmpdir,-1 , tmpdir,sizeof (tmpdir),NULL ,NULL );return tmpdir; }#endif --1.7.9.5
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Re: [Openvpn-devel] [PATCH] Support non-ASCII characters in Windows tmp path
Hi,
Quoted 2 lines · ???? ???????
I confirm such a bug. Patch resolves it.
still not commited to https://github.com/openvpn/openvpn ?
Waiting for an ACK from Samuli, tbh...
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...[Openvpn-devel] English language? Re: [PATCH] Support non-ASCII characters in Windows tmp path
In reply to Heiko HundAm 19.11.2013 18:36, schrieb Heiko Hund:
Quoted 6 lines
Get the temporary path from the system as UCS-2 and convert it to UTF-8 and return that for internal use.
Signed-off-by Heiko Hund <[email protected]...>
src/openvpn/win32.c set_win_sys_path_via_env (struct env_set *es) · line 1015
Quoted 9 lines
src/openvpn/win32.c +9
-0+msg (M_WARN ,"Could not find a suitable temporary directory." +" (GetTempPath() failed). Consider to use --tmp-dir" ); +return NULL ; + } + +if (WideCharToMultiByte (CP_UTF8 ,0 , wtmpdir,-1 ,NULL ,0 ,NULL ,NULL ) >sizeof (tmpdir)) + { +msg (M_WARN ,"Could not get temporary directory. Path is too long." +" Consider to use --tmp-dir" );
I think when touching the code, we ought to change all occurrences to "Consider using --tmp-dir".
Native speakers or linguists correct me, but since most usage references I found were "consider + object" (object often a noun), the -ing form would have to be used here.
The closest I found is on
<http://www.merriam-webster.com/dictionary/consider> which has "He seriously considered changing careers." (under Examples), among lots of "consider + noun" patterns.
Re: [Openvpn-devel] English language? Re: [PATCH] Support non-ASCII characters in Windows tmp path
Quoted 12 lines · Matthias Andree
Am 19.11.2013 18:36, schrieb Heiko Hund:
Quoted 1 line
+ msg (
M_WARN, "Could not get temporary directory. Path is toolong."
Quoted 1 line
+ " Consider to use --tmp-dir");
I think when touching the code, we ought to change all occurrences to "Consider using --tmp-dir".
Native speakers or linguists correct me, but since most usage references I found were "consider + object" (object often a noun), the -ing form would have to be used here.
As a native English speaker, I agree; "Consider using --tmp-dir" is correct.
(As an American, I have almost no formal knowledge of grammar or diction, so I can't cite why :-)
Re: [Openvpn-devel] English language? Re: [PATCH] Support non-ASCII characters in Windows tmp path
I've looked through the code and I do not understand why do we need that temporary directory on windows platfrom ?
anyone can explain idea behind initializing tmp-dir ? especially on Windows platform.
2013/12/4 Jonathan K. Bullard <[email protected]...>:
Quoted 31 lines
Quoted 6 lines · Matthias Andree
Am 19.11.2013 18:36, schrieb Heiko Hund:
Quoted 3 lines
+ msg (
M_WARN, "Could not get temporary directory. Path is too
long."
+ " Consider to use --tmp-dir");Quoted 6 lines
I think when touching the code, we ought to change all occurrences to "Consider using --tmp-dir".
Native speakers or linguists correct me, but since most usage references I found were "consider + object" (object often a noun), the -ing form would have to be used here.
As a native English speaker, I agree; "Consider using --tmp-dir" is correct.
(As an American, I have almost no formal knowledge of grammar or diction, so I can't cite why :-)
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base. Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Re: [Openvpn-devel] English language? Re: [PATCH] Support non-ASCII characters in Windows tmp path
Hi,
Quoted 4 lines · ???? ???????
I've looked through the code and I do not understand why do we need that temporary directory on windows platfrom ?
anyone can explain idea behind initializing tmp-dir ? especially on Windows platform.
tmp-dir is used to create, well, temporary files :-) - usually in the context of a script being called (--client-connect) or a plugin.
I'm not sure if it is ever used in *client* mode, but since people do run OpenVPN server instances on Windows, and server definitely needs --tmp-dir for full functionality, it needs to work.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Re: [Openvpn-devel] English language? Re: [PATCH] Support non-ASCII characters in Windows tmp path
In reply to Илья ШипицинQuoted 4 lines · Илья Шипицин
I've looked through the code and I do not understand why do we need that temporary directory on windows platfrom ?
anyone can explain idea behind initializing tmp-dir ? especially on Windows platform.
The client side most likely won't need --tmp-dir at all. But if running a server on Windows, OpenVPN will create some temporary files upon client authentication.
See commit ca4c6d618d7 for more info.
Signature · 3 lines
kind regards, David Sommerseth
Re: [Openvpn-devel] [PATCH] Support non-ASCII characters in Windows tmp path
In reply to Heiko HundI also found http://moser-isi.ethz.ch/docs/english_verb_inf_ing.pdf
after my earlier post.
[Openvpn-devel] [PATCH applied] Re: Support non-ASCII characters in Windows tmp path
In reply to Heiko HundACK, the code looks reasonable.
Your patch has been applied to the master and release/2.3 branch, with the language fixes by Matthias Andree.
commit 925b8a463b78620c1f856a0224396ac7d53e6295 (master) commit 1146c724e4d966248d23a0b350bc76d1af35a00c (release/2.3)
Author: Heiko Hund Date: Tue Nov 19 18:36:14 2013 +0100
Support non-ASCII characters in Windows tmp path
Signed-off-by: Heiko Hund <[email protected]...>
Acked-by: <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8002
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering