diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index b11e6afbecac4f14898bb7d721bef4a4c27566bd..9510a557159cdf49384db95a206c4eb68d2f1ea5 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -77,12 +77,28 @@ copy_file $fake_relay_log $_fake_relay_log;
 
 if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
 {
-  eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+  -- let $_index_entry= ./$_fake_filename-fake.000001
 }
 
 if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
 {
-  eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
+  -- let $_index_entry= .\\\\$_fake_filename-fake.000001
+}
+
+if (`SELECT LENGTH(@@secure_file_priv) > 0`)
+{
+  -- let $_file_priv_dir= `SELECT @@secure_file_priv`;
+  -- let $_suffix= `SELECT UUID()`
+  -- let $_tmp_file= $_file_priv_dir/fake-index.$_suffix
+
+  -- eval select '$_index_entry\n' into dumpfile '$_tmp_file'
+  -- copy_file $_tmp_file $_fake_relay_index
+  -- remove_file $_tmp_file
+}
+
+if (`SELECT LENGTH(@@secure_file_priv) = 0`)
+{
+  -- eval select '$_index_entry\n' into dumpfile '$_fake_relay_index'
 }
 
 # Setup replication from existing relay log.
diff --git a/win/configure.js b/win/configure.js
index 07dccb66f8357d95f87d05ac89243fd4e7c93348..00a66b32b64cc865bfdd135475049090774069e4 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -140,11 +140,11 @@ function GetValue(str, key)
 
 function GetVersion(str)
 {
-    var key = "AM_INIT_AUTOMAKE(mysql, ";
-    var pos = str.indexOf(key); //5.0.6-beta)
+    var key = "AC_INIT([MySQL Server], [";
+    var pos = str.indexOf(key);
     if (pos == -1) return null;
     pos += key.length;
-    var end = str.indexOf(")", pos);
+    var end = str.indexOf("]", pos);
     if (end == -1) return null;
     return str.substring(pos, end);
 }