Browse code

Add the name of the context where option is not allowed to the error message.

Changes

Options error: option 'dhcp-option' cannot be used in this context

to

P:Options error: option 'dhcp-option' cannot be used in this context
([PUSH-OPTIONS])

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1338642223-20324-6-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6646
Signed-off-by: David Sommerseth <davids@redhat.com>

Arne Schwabe authored on 2012/06/02 22:03:40
Showing 1 changed files
... ...
@@ -4017,10 +4017,11 @@ void options_string_import (struct options *options,
4017 4017
 
4018 4018
 #if P2MP
4019 4019
 
4020
-#define VERIFY_PERMISSION(mask) { if (!verify_permission(p[0], (mask), permission_mask, option_types_found, msglevel)) goto err; }
4020
+#define VERIFY_PERMISSION(mask) { if (!verify_permission(p[0], file, (mask), permission_mask, option_types_found, msglevel)) goto err; }
4021 4021
 
4022 4022
 static bool
4023 4023
 verify_permission (const char *name,
4024
+		   const char* file,
4024 4025
 		   const unsigned int type,
4025 4026
 		   const unsigned int allowed,
4026 4027
 		   unsigned int *found,
... ...
@@ -4028,7 +4029,7 @@ verify_permission (const char *name,
4028 4028
 {
4029 4029
   if (!(type & allowed))
4030 4030
     {
4031
-      msg (msglevel, "option '%s' cannot be used in this context", name);
4031
+      msg (msglevel, "option '%s' cannot be used in this context (%s)", name, file);
4032 4032
       return false;
4033 4033
     }
4034 4034
   else