Taro Yamazaki | 1 Dec 2011 12:28
Picon

Re: Japanese translation


Hi Heiko,

I checked a new snapshot, and I found the words that needed to be adjusted.
Please use an attached file.

Thanks.

Regards,
Taro

--

-- 
::: Taro Yamazaki [ taro <at> plum-systems.co.jp ]
:    <LinkedIn> http://www.linkedin.com/in/yamata
-------------------------------------------------------------
: Plum Systems Inc.
: 2-3-11-2F, Kurihira, Asao, Kawasaki, Kanagawa, 215-0031, JAPAN
: http://www.plum-systems.co.jp/
/*
 *  OpenVPN-GUI -- A Windows GUI for OpenVPN.
 *
 *  Copyright (C) 2004 Mathias Sundman <mathias <at> nilings.se>
 *                2009 Heiko Hund <heikoh <at> users.sf.net>
 *                2011 Taro Yamazaki <taro <at> plum-systems.co.jp>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
(Continue reading)

Heiko Hund | 1 Dec 2011 13:17
Gravatar

Re: Japanese translation

Hi Taro

On Thursday 01 December 2011 11:28:13 Taro Yamazaki wrote:
> I checked a new snapshot, and I found the words that needed to be adjusted.
> Please use an attached file.

Thanks. Committed the change to the repository. It will be contained in the 
next snapshot.

Heiko
--

-- 
Heiko Hund | Software Engineer | Phone +49-721-25516-237 | Fax -200
Astaro a Sophos Company | Amalienbadstr. 41 Bau 52 | 76227 Karlsruhe | Germany
Commercial Register: Mannheim HRA 702710 | Headquarter Location: Karlsruhe

Represented by the General Partner Astaro Verwaltungs GmbH
Amalienbadstraße 41 Bau 52 | 76227 Karlsruhe | Germany 
Commercial Register: Mannheim HRB 708248 | Executive Board: Gert Hansen,
Markus Hennig, Jan Hichert, Günter Junk, Dr. Frank Nellissen

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Samuli Seppänen | 2 Dec 2011 10:52
Favicon

New pre-alpha 2.3 installer for Windows with signed TAP-driver ready for testing

Hi all,

We're starting to get close to first OpenVPN 2.3 alpha release. Here's a
new Windows snapshot installer based on latest "master" with one minor
modification[1]:

<http://build.openvpn.net/downloads/snapshots/openvpn-2.x-master-20111202-wo-startup-test-install.exe>

It has been smoketested on Windows 7 64-bit and Windows XP 32-bit and
seems to work ok. It includes signed TAP-drivers, the latest OpenVPN
GUI[2] from Heiko and full IPv6 support, among other things[3]. If you
try this installer out, let me know how it works for you!

Best regards,

--

-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

[1]
<http://build.openvpn.net/downloads/snapshots/openvpn-2.x-master-20111202-wo-startup-test-install.exe.txt>
[2] <http://sourceforge.net/projects/openvpn-gui>
[3]
<http://build.openvpn.net/downloads/snapshots/openvpn-2.x-master-20111202-wo-startup-test-install.exe.log.txt>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
(Continue reading)

David Sommerseth | 2 Dec 2011 12:02
Picon
Favicon

[PATCH] Provide an access() wrapper for Windows

Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds extra file and
directory checks at startup.  However, this patch makes use of some
features not directly available in Windows.

This patch avoids #include <unistd.h> on Windows and provides a
wrapper for the needed access() function.

Signed-off-by: David Sommerseth <davids <at> redhat.com>
Cc: Heiko Hund <heiko.hund <at> sophos.com>
---
 options.c |    1 -
 syshead.h |    3 +++
 win32.h   |   21 +++++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/options.c b/options.c
index a29c115..090bbde 100644
--- a/options.c
+++ b/options.c
 <at>  <at>  -52,7 +52,6  <at>  <at> 
 #include "configure.h"
 #include "forward.h"
 #include <ctype.h>
-#include <unistd.h>

 #include "memdbg.h"

diff --git a/syshead.h b/syshead.h
index f3c0ac9..232c214 100644
--- a/syshead.h
(Continue reading)

David Sommerseth | 2 Dec 2011 12:02
Picon
Favicon

[PATCH] Windows does not have dirname() - reimplement a portable version

Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds some extra
checks on configured files and directories.  This required use of
the dirname() function.  Unfortunately, this function is not available
on Windows.

This function reimplements the POSIX variant of dirname(), using the
framework already available in openvpn_basename().  The POSIX variant
of dirname() will modify the input data.

Signed-off-by: David Sommerseth <davids <at> redhat.com>
Cc: Heiko Hund <heiko.hund <at> sophos.com>
---
 misc.c    |   36 ++++++++++++++++++++++++++++++++----
 misc.h    |    3 +++
 options.c |    3 +--
 3 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/misc.c b/misc.c
index 99e5bc5..eb04918 100644
--- a/misc.c
+++ b/misc.c
 <at>  <at>  -2370,10 +2370,13  <at>  <at>  argv_test (void)
 }
 #endif

-const char *
-openvpn_basename (const char *path)
+
+enum ovpn_dirbasename_t { DIRNAME, BASENAME };
+
(Continue reading)

David Sommerseth | 2 Dec 2011 13:17
Picon
Favicon

[PATCH v2] Provide an access() wrapper for Windows

Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds extra file and
directory checks at startup.  However, this patch makes use of some
features not directly available in Windows.

This patch avoids #include <unistd.h> on Windows and provides a
wrapper for the needed access() function.  The wrapper function
which is global for all platforms is called openvpn_access()

Signed-off-by: David Sommerseth <davids <at> redhat.com>
Cc: Heiko Hund <heiko.hund <at> sophos.com>
---
 misc.h    |   12 ++++++++++++
 options.c |    9 ++++-----
 syshead.h |    3 +++
 win32.h   |   20 ++++++++++++++++++++
 4 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/misc.h b/misc.h
index 9b35f18..223467e 100644
--- a/misc.h
+++ b/misc.h
 <at>  <at>  -387,6 +387,18  <at>  <at>  const char *openvpn_basename (const char *path);
 /* return the dirname of path - POSIX variant, which modifies the input */
 const char *openvpn_dirname (char *path);

+/* access() wrapper, for both Windows and POSIX environments */
+#ifdef WIN32
+static inline int
+openvpn_access( const char *path, int mode) {
+  return _access(path, mode);
(Continue reading)

Alon Bar-Lev | 2 Dec 2011 13:25
Picon
Gravatar

Re: [PATCH v2] Provide an access() wrapper for Windows

Why not:
#ifdef WIN32
#define access _access
#endif

On Fri, Dec 2, 2011 at 2:17 PM, David Sommerseth <davids <at> redhat.com> wrote:
Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds extra file and
directory checks at startup.  However, this patch makes use of some
features not directly available in Windows.

This patch avoids #include <unistd.h> on Windows and provides a
wrapper for the needed access() function.  The wrapper function
which is global for all platforms is called openvpn_access()

Signed-off-by: David Sommerseth <davids <at> redhat.com>
Cc: Heiko Hund <heiko.hund <at> sophos.com>
---
 misc.h    |   12 ++++++++++++
 options.c |    9 ++++-----
 syshead.h |    3 +++
 win32.h   |   20 ++++++++++++++++++++
 4 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/misc.h b/misc.h
index 9b35f18..223467e 100644
--- a/misc.h
+++ b/misc.h
<at> <at> -387,6 +387,18 <at> <at> const char *openvpn_basename (const char *path);
 /* return the dirname of path - POSIX variant, which modifies the input */
 const char *openvpn_dirname (char *path);

+/* access() wrapper, for both Windows and POSIX environments */
+#ifdef WIN32
+static inline int
+openvpn_access( const char *path, int mode) {
+  return _access(path, mode);
+}
+#else
+static inline int
+openvpn_access( const char *path, int mode) {
+  return access(path, mode);
+}
+#endif
 /*
 * A printf-like function (that only recognizes a subset of standard printf
 * format operators) that prints arguments to an argv list instead
diff --git a/options.c b/options.c
index a29c115..891bb7f 100644
--- a/options.c
+++ b/options.c
<at> <at> -52,7 +52,6 <at> <at>
 #include "configure.h"
 #include "forward.h"
 #include <ctype.h>
-#include <unistd.h>

 #include "memdbg.h"

<at> <at> -2617,18 +2616,18 <at> <at> check_file_access(const int type, const char *file, const int mode, const char *
      char *fullpath = strdup(file);  /* POSIX dirname() implementaion may modify its arguments */
      const char *dirpath = openvpn_dirname(fullpath);

-      if (access (dirpath, mode|X_OK) != 0)
+      if (openvpn_access (dirpath, mode|X_OK) != 0)
          errcode = errno;
      free(fullpath);
    }

  /* Is the file itself accessible? */
-  if (!errcode && (type & CHKACC_FILE) && (access (file, mode) != 0) )
+  if (!errcode && (type & CHKACC_FILE) && (openvpn_access (file, mode) != 0) )
      errcode = errno;

  /* If the file exists and is accessible, is it writable? */
-  if (!errcode && (type & CHKACC_FILEXSTWR) && (access (file, F_OK) == 0) )
-    if (access (file, W_OK) != 0)
+  if (!errcode && (type & CHKACC_FILEXSTWR) && (openvpn_access (file, F_OK) == 0) )
+    if (openvpn_access (file, W_OK) != 0)
      errcode = errno;

  /* Scream if an error is found */
diff --git a/syshead.h b/syshead.h
index f3c0ac9..232c214 100644
--- a/syshead.h
+++ b/syshead.h
<at> <at> -52,9 +52,12 <at> <at>
 #ifdef WIN32
 #include <windows.h>
 #include <winsock2.h>
+#include <io.h>
 #define sleep(x) Sleep((x)*1000)
 #define random rand
 #define srandom srand
+#else
+#include <unistd.h>
 #endif

 #if defined(__APPLE__)
diff --git a/win32.h b/win32.h
index 23c04be..2b9cb8b 100644
--- a/win32.h
+++ b/win32.h
<at> <at> -70,6 +70,26 <at> <at> struct security_attributes

 #define HANDLE_DEFINED(h) ((h) != NULL && (h) != INVALID_HANDLE_VALUE)

+/* Provide wrapper for the access() function
+ * based on information found here:
+ * http://msdn.microsoft.com/en-us/library/1w06ktdy%28v=vs.80%29.aspx
+ */
+#ifndef R_OK
+#define R_OK 4
+#endif
+
+#ifndef W_OK
+#define W_OK 2
+#endif
+
+#ifndef X_OK
+#define X_OK 1
+#endif
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+
 /*
 * Save old window title.
 */
--
1.7.4.4


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Alon Bar-Lev | 2 Dec 2011 13:28
Picon
Gravatar

Re: [PATCH] Windows does not have dirname() - reimplement a portable version

I think the whole code should be more autoconf depended.
Autoconf can detect if POSIX version is available and if not, code can
provide alternative.
No need for the openvpn_ functions and wrappers.

On Fri, Dec 2, 2011 at 1:02 PM, David Sommerseth <davids <at> redhat.com> wrote:
>
> Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds some extra
> checks on configured files and directories.  This required use of
> the dirname() function.  Unfortunately, this function is not available
> on Windows.
>
> This function reimplements the POSIX variant of dirname(), using the
> framework already available in openvpn_basename().  The POSIX variant
> of dirname() will modify the input data.
>
> Signed-off-by: David Sommerseth <davids <at> redhat.com>
> Cc: Heiko Hund <heiko.hund <at> sophos.com>
> ---
>  misc.c    |   36 ++++++++++++++++++++++++++++++++----
>  misc.h    |    3 +++
>  options.c |    3 +--
>  3 files changed, 36 insertions(+), 6 deletions(-)
>
> diff --git a/misc.c b/misc.c
> index 99e5bc5..eb04918 100644
> --- a/misc.c
> +++ b/misc.c
>  <at>  <at>  -2370,10 +2370,13  <at>  <at>  argv_test (void)
>  }
>  #endif
>
> -const char *
> -openvpn_basename (const char *path)
> +
> +enum ovpn_dirbasename_t { DIRNAME, BASENAME };
> +
> +static inline char *
> +openvpn_dirbasename(char *path, enum ovpn_dirbasename_t type)
>  {
> -  const char *ret;
> +  char *ret;
>   const int dirsep = OS_SPECIFIC_DIRSEP;
>
>   if (path)
>  <at>  <at>  -2384,11 +2387,36  <at>  <at>  openvpn_basename (const char *path)
>       else
>        ret = path;
>       if (*ret)
> -       return ret;
> +        switch( type ) {
> +        case BASENAME:
> +          return ret;
> +
> +        case DIRNAME:
> +          /* This implements the POSIX variant of dirname(),
> +           * which do modify the input
> +           */
> +          *(ret-1) = 0;
> +          return path;
> +        }
>     }
>   return NULL;
>  }
>
> +const char *
> +openvpn_basename (const char *path)
> +{
> +  /* the path is recasted as non-const, as we are sure it will not be modified
> +   * in the basename type
> +   */
> +  return (const char *) openvpn_dirbasename((char *) path, BASENAME);
> +}
> +
> +const char *
> +openvpn_dirname (char *path)
> +{
> +        return openvpn_dirbasename(path, DIRNAME);
> +}
> +
>  /*
>  * Remove security-sensitive strings from control message
>  * so that they will not be output to log file.
> diff --git a/misc.h b/misc.h
> index b2e6f91..9b35f18 100644
> --- a/misc.h
> +++ b/misc.h
>  <at>  <at>  -384,6 +384,9  <at>  <at>  size_t adjust_power_of_2 (size_t u);
>  /* return the basename of path */
>  const char *openvpn_basename (const char *path);
>
> +/* return the dirname of path - POSIX variant, which modifies the input */
> +const char *openvpn_dirname (char *path);
> +
>  /*
>  * A printf-like function (that only recognizes a subset of standard printf
>  * format operators) that prints arguments to an argv list instead
> diff --git a/options.c b/options.c
> index 28296a5..a29c115 100644
> --- a/options.c
> +++ b/options.c
>  <at>  <at>  -53,7 +53,6  <at>  <at> 
>  #include "forward.h"
>  #include <ctype.h>
>  #include <unistd.h>
> -#include <libgen.h>
>
>  #include "memdbg.h"
>
>  <at>  <at>  -2616,7 +2615,7  <at>  <at>  check_file_access(const int type, const char *file, const int mode, const char *
>   if (type & CHKACC_DIRPATH)
>     {
>       char *fullpath = strdup(file);  /* POSIX dirname() implementaion may modify its arguments */
> -      char *dirpath = dirname(fullpath);
> +      const char *dirpath = openvpn_dirname(fullpath);
>
>       if (access (dirpath, mode|X_OK) != 0)
>           errcode = errno;
> --
> 1.7.4.4
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
David Sommerseth | 2 Dec 2011 13:38

Re: [PATCH] Windows does not have dirname() - reimplement a portable version


On 02/12/11 13:28, Alon Bar-Lev wrote:
> I think the whole code should be more autoconf depended. Autoconf can
> detect if POSIX version is available and if not, code can provide
> alternative. No need for the openvpn_ functions and wrappers.

Fair enough statement, but we have a python oriented build environment on
Windows too, which will not be so easy to tackle in this regards.  This
environment is required by OpenVPN Technologies for their internal build
farms (most likely for the OpenVPN Access Server product).

As we already had openvpn_basename(), I found it reasonable to reuse that
function for a dirname() variant as well.

To be honest, I'm not too happy about needing to maintain two build
environments, but that's the requirements we have right now.  It might be
that we at some point will change this - if a reasonable approach is
found.  But that will happen earliest after the 2.3 release is shipped.

kind regards,

David Sommerseth

> On Fri, Dec 2, 2011 at 1:02 PM, David Sommerseth <davids <at> redhat.com>
> wrote:
>> 
>> Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds some extra 
>> checks on configured files and directories.  This required use of 
>> the dirname() function.  Unfortunately, this function is not
>> available on Windows.
>> 
>> This function reimplements the POSIX variant of dirname(), using
>> the framework already available in openvpn_basename().  The POSIX
>> variant of dirname() will modify the input data.
>> 
>> Signed-off-by: David Sommerseth <davids <at> redhat.com> Cc: Heiko Hund
>> <heiko.hund <at> sophos.com> --- misc.c    |   36
>> ++++++++++++++++++++++++++++++++---- misc.h    |    3 +++ options.c
>> |    3 +-- 3 files changed, 36 insertions(+), 6 deletions(-)
>> 
>> diff --git a/misc.c b/misc.c index 99e5bc5..eb04918 100644 ---
>> a/misc.c +++ b/misc.c  <at>  <at>  -2370,10 +2370,13  <at>  <at>  argv_test (void) } 
>> #endif
>> 
>> -const char * -openvpn_basename (const char *path) + +enum
>> ovpn_dirbasename_t { DIRNAME, BASENAME }; + +static inline char * 
>> +openvpn_dirbasename(char *path, enum ovpn_dirbasename_t type) { -
>> const char *ret; +  char *ret; const int dirsep =
>> OS_SPECIFIC_DIRSEP;
>> 
>> if (path)  <at>  <at>  -2384,11 +2387,36  <at>  <at>  openvpn_basename (const char
>> *path) else ret = path; if (*ret) -       return ret; +
>> switch( type ) { +        case BASENAME: +          return ret; + +
>> case DIRNAME: +          /* This implements the POSIX variant of
>> dirname(), +           * which do modify the input +           */ +
>> *(ret-1) = 0; +          return path; +        } } return NULL; }
>> 
>> +const char * +openvpn_basename (const char *path) +{ +  /* the path
>> is recasted as non-const, as we are sure it will not be modified +
>> * in the basename type +   */ +  return (const char *)
>> openvpn_dirbasename((char *) path, BASENAME); +} + +const char * 
>> +openvpn_dirname (char *path) +{ +        return
>> openvpn_dirbasename(path, DIRNAME); +} + /* * Remove
>> security-sensitive strings from control message * so that they will
>> not be output to log file. diff --git a/misc.h b/misc.h index
>> b2e6f91..9b35f18 100644 --- a/misc.h +++ b/misc.h  <at>  <at>  -384,6 +384,9
>>  <at>  <at>  size_t adjust_power_of_2 (size_t u); /* return the basename of
>> path */ const char *openvpn_basename (const char *path);
>> 
>> +/* return the dirname of path - POSIX variant, which modifies the
>> input */ +const char *openvpn_dirname (char *path); + /* * A
>> printf-like function (that only recognizes a subset of standard
>> printf * format operators) that prints arguments to an argv list
>> instead diff --git a/options.c b/options.c index 28296a5..a29c115
>> 100644 --- a/options.c +++ b/options.c  <at>  <at>  -53,7 +53,6  <at>  <at>  #include
>> "forward.h" #include <ctype.h> #include <unistd.h> -#include
>> <libgen.h>
>> 
>> #include "memdbg.h"
>> 
>>  <at>  <at>  -2616,7 +2615,7  <at>  <at>  check_file_access(const int type, const char
>> *file, const int mode, const char * if (type & CHKACC_DIRPATH) { 
>> char *fullpath = strdup(file);  /* POSIX dirname() implementaion may
>> modify its arguments */ -      char *dirpath = dirname(fullpath); +
>> const char *dirpath = openvpn_dirname(fullpath);
>> 
>> if (access (dirpath, mode|X_OK) != 0) errcode = errno; -- 1.7.4.4
>> 
>> 
>> ------------------------------------------------------------------------------
>>
>> 
All the data continuously generated in your IT infrastructure
>> contains a definitive record of customers, application performance, 
>> security threats, fraudulent activity, and more. Splunk takes this 
>> data and makes sense of it. IT sense. And common sense. 
>> http://p.sf.net/sfu/splunk-novd2d 
>> _______________________________________________ Openvpn-devel
>> mailing list Openvpn-devel <at> lists.sourceforge.net 
>> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
> 
> ------------------------------------------------------------------------------
>
> 
All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense. 
> http://p.sf.net/sfu/splunk-novd2d 
> _______________________________________________ Openvpn-devel mailing
> list Openvpn-devel <at> lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
> 

David Sommerseth | 2 Dec 2011 13:38

Re: [PATCH v2] Provide an access() wrapper for Windows


On 02/12/11 13:25, Alon Bar-Lev wrote:
> Why not: #ifdef WIN32 #define access _access #endif

No particular reason, other than the approach with static inline
functions seems more cleaner in my eyes.  The first version of this patch
declared an access() function in win32.h instead.  But that didn't
compile so well in Visual Studio.

As it is a wrapper function for platform neutrality, prefixing it with
openvpn_ makes that much clearer when reading the code.

kind regards,

David Sommerseth

> On Fri, Dec 2, 2011 at 2:17 PM, David Sommerseth <davids <at> redhat.com 
> <mailto:davids <at> redhat.com>> wrote:
> 
> Commit 0f2bc0dd92f43c91e33bba8a66b06b98f281efc1 adds extra file and 
> directory checks at startup.  However, this patch makes use of some 
> features not directly available in Windows.
> 
> This patch avoids #include <unistd.h> on Windows and provides a 
> wrapper for the needed access() function.  The wrapper function which
> is global for all platforms is called openvpn_access()
> 
> Signed-off-by: David Sommerseth <davids <at> redhat.com 
> <mailto:davids <at> redhat.com>> Cc: Heiko Hund <heiko.hund <at> sophos.com
> <mailto:heiko.hund <at> sophos.com>> --- misc.h    |   12 ++++++++++++ 
> options.c |    9 ++++----- syshead.h |    3 +++ win32.h   |   20
> ++++++++++++++++++++ 4 files changed, 39 insertions(+), 5
> deletions(-)
> 
> diff --git a/misc.h b/misc.h index 9b35f18..223467e 100644 ---
> a/misc.h +++ b/misc.h  <at>  <at>  -387,6 +387,18  <at>  <at>  const char
> *openvpn_basename (const char *path); /* return the dirname of path -
> POSIX variant, which modifies the input */ const char *openvpn_dirname
> (char *path);
> 
> +/* access() wrapper, for both Windows and POSIX environments */ 
> +#ifdef WIN32 +static inline int +openvpn_access( const char *path,
> int mode) { +  return _access(path, mode); +} +#else +static inline
> int +openvpn_access( const char *path, int mode) { +  return
> access(path, mode); +} +#endif /* * A printf-like function (that only
> recognizes a subset of standard printf * format operators) that prints
> arguments to an argv list instead diff --git a/options.c b/options.c 
> index a29c115..891bb7f 100644 --- a/options.c +++ b/options.c  <at>  <at>  -52,7
> +52,6  <at>  <at>  #include "configure.h" #include "forward.h" #include
> <ctype.h> -#include <unistd.h>
> 
> #include "memdbg.h"
> 
>  <at>  <at>  -2617,18 +2616,18  <at>  <at>  check_file_access(const int type, const char 
> *file, const int mode, const char * char *fullpath = strdup(file);  /*
> POSIX dirname() implementaion may modify its arguments */ const char
> *dirpath = openvpn_dirname(fullpath);
> 
> -      if (access (dirpath, mode|X_OK) != 0) +      if (openvpn_access
> (dirpath, mode|X_OK) != 0) errcode = errno; free(fullpath); }
> 
> /* Is the file itself accessible? */ -  if (!errcode && (type &
> CHKACC_FILE) && (access (file, mode) != 0) ) +  if (!errcode && (type
> & CHKACC_FILE) && (openvpn_access (file, mode) != 0) ) errcode =
> errno;
> 
> /* If the file exists and is accessible, is it writable? */ -  if
> (!errcode && (type & CHKACC_FILEXSTWR) && (access (file, F_OK) == 0)
> ) -    if (access (file, W_OK) != 0) +  if (!errcode && (type &
> CHKACC_FILEXSTWR) && (openvpn_access (file, F_OK) == 0) ) +    if
> (openvpn_access (file, W_OK) != 0) errcode = errno;
> 
> /* Scream if an error is found */ diff --git a/syshead.h b/syshead.h 
> index f3c0ac9..232c214 100644 --- a/syshead.h +++ b/syshead.h  <at>  <at>  -52,9
> +52,12  <at>  <at>  #ifdef WIN32 #include <windows.h> #include <winsock2.h> 
> +#include <io.h> #define sleep(x) Sleep((x)*1000) #define random rand 
> #define srandom srand +#else +#include <unistd.h> #endif
> 
> #if defined(__APPLE__) diff --git a/win32.h b/win32.h index
> 23c04be..2b9cb8b 100644 --- a/win32.h +++ b/win32.h  <at>  <at>  -70,6 +70,26  <at>  <at> 
> struct security_attributes
> 
> #define HANDLE_DEFINED(h) ((h) != NULL && (h) !=
> INVALID_HANDLE_VALUE)
> 
> +/* Provide wrapper for the access() function + * based on information
> found here: + *
> http://msdn.microsoft.com/en-us/library/1w06ktdy%28v=vs.80%29.aspx +
> */ +#ifndef R_OK +#define R_OK 4 +#endif + +#ifndef W_OK +#define W_OK
> 2 +#endif + +#ifndef X_OK +#define X_OK 1 +#endif + +#ifndef F_OK 
> +#define F_OK 0 +#endif + /* * Save old window title. */ -- 1.7.4.4
> 
> 
> ------------------------------------------------------------------------------
>
> 
All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense. 
> http://p.sf.net/sfu/splunk-novd2d 
> _______________________________________________ Openvpn-devel mailing
> list Openvpn-devel <at> lists.sourceforge.net 
> <mailto:Openvpn-devel <at> lists.sourceforge.net> 
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
> 
> 
> 
> 
> ------------------------------------------------------------------------------
>
> 
All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense. 
> http://p.sf.net/sfu/splunk-novd2d
> 
> 
> 
> _______________________________________________ Openvpn-devel mailing
> list Openvpn-devel <at> lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Gmane