aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-17 22:41:15 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-17 22:41:15 +0000
commit73b7e6988491781703859675b0c86051e79a7d9d (patch)
tree01dc369501ab7a335aff4c568d16bccbdf4378b4 /misc.c
parentCall prng_init after fork in background process (diff)
downloadopenvpn-73b7e6988491781703859675b0c86051e79a7d9d.tar.xz
gen_path now rejects filenames that match Windows
device names such as CON, NUL, LPT1, etc. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3072 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 985879c..8f80ee1 100644
--- a/misc.c
+++ b/misc.c
@@ -35,6 +35,7 @@
#include "manage.h"
#include "crypto.h"
#include "route.h"
+#include "win32.h"
#include "memdbg.h"
@@ -1114,7 +1115,11 @@ gen_path (const char *directory, const char *filename, struct gc_arena *gc)
if (safe_filename
&& strcmp (safe_filename, ".")
- && strcmp (safe_filename, ".."))
+ && strcmp (safe_filename, "..")
+#ifdef WIN32
+ && win_safe_filename (safe_filename)
+#endif
+ )
{
struct buffer out = alloc_buf_gc (256, gc);
char dirsep[2];