]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Support %% in external ACL format
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Nov 2011 06:11:55 +0000 (23:11 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Nov 2011 06:11:55 +0000 (23:11 -0700)
src/cf.data.pre
src/external_acl.cc

index 7e1c0566cb27d160e92ff9775771b0640bd6cea9..1d78b1f7c19c4e39c2bc09e8a812a784e4fec65d 100644 (file)
@@ -592,6 +592,9 @@ DOC_START
                        list separator. ; can be any non-alphanumeric
                        character.
 
+         %%            The percent sign. Useful for helpers which need
+                       an unchanging input format.
+
        In addition to the above, any string specified in the referencing
        acl will also be included in the helper request line, after the
        specified formats (see the "acl external" directive)
index 5a577f36bc05f76941072938ed71748464d1915b..4ef9c9994f0eab9b50ea86a5ccf1bdaed53a1eb7 100644 (file)
@@ -190,6 +190,7 @@ struct _external_acl_format {
 #endif
         EXT_ACL_EXT_LOG,
         EXT_ACL_TAG,
+        EXT_ACL_PERCENT,
         EXT_ACL_END
     } type;
     external_acl_format *next;
@@ -471,6 +472,8 @@ parse_externalAclHelper(external_acl ** list)
             format->type = _external_acl_format::EXT_ACL_EXT_LOG;
         else if (strcmp(token, "%TAG") == 0)
             format->type = _external_acl_format::EXT_ACL_TAG;
+        else if (strcmp(token, "%%") == 0)
+            format->type = _external_acl_format::EXT_ACL_PERCENT;
         else {
             debugs(0,0, "ERROR: Unknown Format token " << token);
             self_destruct();
@@ -1089,6 +1092,9 @@ makeExternalAclKey(ACLFilledChecklist * ch, external_acl_data * acl_data)
         case _external_acl_format::EXT_ACL_TAG:
             str = request->tag.termedBuf();
             break;
+        case _external_acl_format::EXT_ACL_PERCENT:
+            str = "%";
+            break;
         case _external_acl_format::EXT_ACL_UNKNOWN:
 
         case _external_acl_format::EXT_ACL_END: