]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add the name of the context where option is not allowed to the error message.
authorArne Schwabe <arne@rfc2549.org>
Sat, 2 Jun 2012 13:03:40 +0000 (15:03 +0200)
committerDavid Sommerseth <davids@redhat.com>
Thu, 7 Jun 2012 12:00:46 +0000 (14:00 +0200)
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>
src/openvpn/options.c

index 2f70839836cbef247a673323010c3fae0e1759ce..10636eaa62779ef1e72acb070cf4b2785df995d8 100644 (file)
@@ -4017,10 +4017,11 @@ void options_string_import (struct options *options,
 
 #if P2MP
 
-#define VERIFY_PERMISSION(mask) { if (!verify_permission(p[0], (mask), permission_mask, option_types_found, msglevel)) goto err; }
+#define VERIFY_PERMISSION(mask) { if (!verify_permission(p[0], file, (mask), permission_mask, option_types_found, msglevel)) goto err; }
 
 static bool
 verify_permission (const char *name,
+                  const char* file,
                   const unsigned int type,
                   const unsigned int allowed,
                   unsigned int *found,
@@ -4028,7 +4029,7 @@ verify_permission (const char *name,
 {
   if (!(type & allowed))
     {
-      msg (msglevel, "option '%s' cannot be used in this context", name);
+      msg (msglevel, "option '%s' cannot be used in this context (%s)", name, file);
       return false;
     }
   else