Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-codedC:\WINDOWS for temp directory path

2011-04-08 Thread David Sommerseth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/04/11 18:03, Gisle Vanem wrote: > "David Sommerseth" wrote: > >> - /* Try to use %TEMP% or %TMP% */ >> - tmpdir = getenv("TEMP"); >> - if( !tmpdir ) { >> -tmpdir = getenv("TMP"); >> + CLEAR (tmpdir); >> + >> + /* Try to use %TEMP%, %TM

Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-codedC:\WINDOWS for temp directory path

2011-04-08 Thread Alon Bar-Lev
On Fri, Apr 8, 2011 at 7:03 PM, Gisle Vanem wrote: > Why not a bit simpler; GetTempPath() (kernel32.dll) already does these tests. > Ref: http://msdn.microsoft.com/en-us/library/aa364992(v=vs.85).aspx : Good catch. Alon.

Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-codedC:\WINDOWS for temp directory path

2011-04-08 Thread Gisle Vanem
"David Sommerseth" wrote: - /* Try to use %TEMP% or %TMP% */ - tmpdir = getenv("TEMP"); - if( !tmpdir ) { -tmpdir = getenv("TMP"); + CLEAR (tmpdir); + + /* Try to use %TEMP%, %TMP% or %SystemRoot%\Temp */ + envptr = getenv("TEMP"); + if( envptr ) { +return envptr; } - if( !tmp

Re: [Openvpn-devel] [PATCH] Change the default --tmp-dir path to a more suitable path

2011-04-08 Thread Carsten Krüger
Hello David, > On Windows, it will look up %TEMP% and %TMP% first, and if that doesn't give > any clues, it > will fallback to C:\WINDOWS\Temp in the end. I think that's not the right location. Use http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx with this constant

Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-coded C:\WINDOWS for temp directory path

2011-04-08 Thread Alon Bar-Lev
On Fri, Apr 8, 2011 at 2:40 PM, David Sommerseth wrote: > + > +  envptr = getenv(SYS_PATH_ENV_VAR_NAME); > +  if( !envptr ) { > +    /* This indicates something is really wrong with the Windows > +     * environment, and we shouldn't try to start OpenVPN in this case > +     */ > +    msg (M_FATAL

Re: [Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-coded C:\WINDOWS for temp directory path

2011-04-08 Thread Gert Doering
Hi, On Fri, Apr 08, 2011 at 01:40:05PM +0200, David Sommerseth wrote: > It is expected that %SystemRoot% is always defined to the directory of the > Windows system. If this is undefined, Windows do not work properly. > > So instead of hard-coding C:\WINDOWS\Temp as the default temporary director

Re: [Openvpn-devel] [PATCH 1/2] Make use of $TMPDIR on non-Windows

2011-04-08 Thread Gert Doering
Hi, On Fri, Apr 08, 2011 at 01:40:04PM +0200, David Sommerseth wrote: > According to the Single Unix Specification (SuS) [1] the $TMPDIR environment > variable may define another temporary directory than the standard /tmp > directory. As it is considered safe to assume /tmp will always exist, rem

[Openvpn-devel] [PATCH 1/2] Make use of $TMPDIR on non-Windows

2011-04-08 Thread David Sommerseth
According to the Single Unix Specification (SuS) [1] the $TMPDIR environment variable may define another temporary directory than the standard /tmp directory. As it is considered safe to assume /tmp will always exist, remove the possibility to change this at compile time. With this path the tempo

[Openvpn-devel] [PATCH 2/2] Use %SystemRoot% instead of hard-coded C:\WINDOWS for temp directory path

2011-04-08 Thread David Sommerseth
It is expected that %SystemRoot% is always defined to the directory of the Windows system. If this is undefined, Windows do not work properly. So instead of hard-coding C:\WINDOWS\Temp as the default temporary directory if %TEMP% or %TMP% is not found, use %SystemRoot%\Temp instead as the fallbac

[Openvpn-devel] [PATCH 0/2] Updates to --tmp-dir patch

2011-04-08 Thread David Sommerseth
These patches goes on-top of the previous --tmp-dir patch [1]. In summary, these patches implement the consensus of the following discussion. * Remove compile time configuration option for default temp dir. In non-Windows environments it is most likely that /tmp will exist anyway. For Windows en

[Openvpn-devel] Summary of the IRC meeting (7th Apr 2011)

2011-04-08 Thread Samuli Seppänen
Hi, Here's the summary of the previous community meeting. --- COMMUNITY MEETING Place: #openvpn-devel on irc.freenode.net List-Post: openvpn-devel@lists.sourceforge.net Date: Thursday, 7th Apr 2011 Time: 18:00 UTC Planned meeting topics for this meeting were on this page: