Browse code

Added additional warning messages about --script-security 2 or higher being required to execute user-defined scripts or executables.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3436 e7ae566f-a301-0410-adde-c780ea21d3b5

james authored on 2008/10/15 17:20:21
Showing 4 changed files
... ...
@@ -81,4 +81,9 @@ typedef unsigned long ptr_type;
81 81
 #define INLINE_FILE_TAG "[[INLINE]]"
82 82
 #endif
83 83
 
84
+/*
85
+ * Script security warning
86
+ */
87
+#define SCRIPT_SECURITY_WARNING "openvpn_execve: external program may not be called unless '--script-security 2' or higher is enabled.  See --help text for detailed info."
88
+
84 89
 #endif
... ...
@@ -1999,8 +1999,10 @@ do_option_warnings (struct context *c)
1999 1999
 
2000 2000
   if (script_security >= SSEC_SCRIPTS)
2001 2001
     msg (M_WARN, "NOTE: the current --script-security setting may allow this configuration to call user-defined scripts");
2002
-  if (script_security >= SSEC_PW_ENV)
2002
+  else if (script_security >= SSEC_PW_ENV)
2003 2003
     msg (M_WARN, "WARNING: the current --script-security setting may allow passwords to be passed to scripts via environmental variables");
2004
+  else
2005
+    msg (M_WARN, "NOTE: " PACKAGE_NAME " 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables");
2004 2006
 }
2005 2007
 
2006 2008
 static void
... ...
@@ -528,7 +528,7 @@ openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned i
528 528
 	}
529 529
       else
530 530
 	{
531
-	  msg (M_WARN, "openvpn_execve: external program may not be called due to setting of --script-security level");
531
+	  msg (M_WARN, SCRIPT_SECURITY_WARNING);
532 532
 	}
533 533
 #else
534 534
       msg (M_WARN, "openvpn_execve: execve function not available");
... ...
@@ -949,7 +949,7 @@ openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned i
949 949
 	}
950 950
       else
951 951
 	{
952
-	  msg (M_WARN, "openvpn_execve: external program may not be called due to setting of --script-security level");
952
+	  msg (M_WARN, SCRIPT_SECURITY_WARNING);
953 953
 	}
954 954
     }
955 955
   else