]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1166: Configuration confusing on empty ACLS
authorhno <>
Sun, 8 May 2005 12:36:45 +0000 (12:36 +0000)
committerhno <>
Sun, 8 May 2005 12:36:45 +0000 (12:36 +0000)
Finished and bugfixed implementation

27 files changed:
src/ACLARP.cc
src/ACLCertificateData.cc
src/ACLCertificateData.h
src/ACLData.h
src/ACLDestinationDomain.cc
src/ACLDomainData.cc
src/ACLDomainData.h
src/ACLExtUser.cc
src/ACLIP.cc
src/ACLIdent.cc
src/ACLIntRange.cc
src/ACLIntRange.h
src/ACLMethodData.cc
src/ACLMethodData.h
src/ACLProtocolData.cc
src/ACLProtocolData.h
src/ACLProxyAuth.cc
src/ACLRegexData.cc
src/ACLRegexData.h
src/ACLStrategised.h
src/ACLStrategy.h
src/ACLStringData.cc
src/ACLStringData.h
src/ACLTimeData.cc
src/ACLTimeData.h
src/ACLUserData.cc
src/ACLUserData.h

index 8d0b96d4671ab1bbfa467edf6cad2371627fec65..8261c6b884a2687292700bee25b00cc86ea70421 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLARP.cc,v 1.13 2005/05/06 01:57:55 hno Exp $
+ * $Id: ACLARP.cc,v 1.14 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -120,7 +120,7 @@ ACLARP::typeString() const
 bool
 ACLARP::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 /* ==== BEGIN ARP ACL SUPPORT ============================================= */
index 1c04cb5c22efd4005cc0f333ddc79f9af6933a5f..c8469da94d86f1c95a3e9921db4e59b9d7f2bd51 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLCertificateData.cc,v 1.7 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLCertificateData.cc,v 1.8 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -120,6 +120,11 @@ ACLCertificateData::parse()
     values.parse();
 }
 
+bool
+ACLCertificateData::empty() const
+{
+    return values.empty();
+}
 
 ACLData<SSL *> *
 ACLCertificateData::clone() const
index bf98c0f5343a5e82115aeff7d5a49ff3f6cb233b..d352944a4b0500f89936e75d8f87802023a42eb5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLCertificateData.h,v 1.6 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLCertificateData.h,v 1.7 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -54,6 +54,7 @@ public:
     bool match(SSL *);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<SSL *> *clone() const;
 
     char *attribute;
index 96c58b0ecd39afbe0b5235ba2c2ee250990f8d5c..a90452befa6d6f3d9d1d36b91acf8969e1358ad8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLData.h,v 1.5 2003/08/04 22:14:38 robertc Exp $
+ * $Id: ACLData.h,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -49,8 +49,9 @@ public:
     virtual wordlist *dump() =0;
     virtual void parse() =0;
     virtual ACLData *clone() const =0;
-    virtual void prepareForUse() {}}
+    virtual void prepareForUse() {}
 
-;
+    virtual bool empty() const =0;
+};
 
 #endif /* SQUID_ACLDATA_H */
index 5feddcb474d0cf39199b040271dca7af2d4277dc..97a9d072b11889910a5c09365c50c585e468b086 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLDestinationDomain.cc,v 1.8 2005/05/06 01:57:55 hno Exp $
+ * $Id: ACLDestinationDomain.cc,v 1.9 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -106,7 +106,7 @@ ACLDestinationDomain::dump() const
 bool
 ACLDestinationDomain::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 DestinationDomainLookup DestinationDomainLookup::instance_;
index 09c49e18e8e80f2eed7fc7067b48b1e7b7c1667d..55a0f2ea7c24c18ef2884d1435a2f26654b913a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLDomainData.cc,v 1.9 2004/12/20 16:30:32 robertc Exp $
+ * $Id: ACLDomainData.cc,v 1.10 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -153,6 +153,12 @@ ACLDomainData::parse()
     }
 }
 
+bool
+ACLDomainData::empty() const
+{
+    return domains == NULL;
+}
+
 
 ACLData<char const *> *
 ACLDomainData::clone() const
index 23b531ef04678c64f53e45d97be31e4f17208fe5..294f18c5bf529a91bdc01fbb31136de80d617ae3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLDomainData.h,v 1.5 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLDomainData.h,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -49,6 +49,7 @@ public:
     bool match(char const *);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<char const *> *clone() const;
 
     SplayNode<char *> *domains;
index 065f0f68aabaea3826fd20eb0db4a9035473560f..99a00b7ea1b75cc790e3968e8c65e51445ce5fd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLExtUser.cc,v 1.6 2005/05/06 01:57:55 hno Exp $
+ * $Id: ACLExtUser.cc,v 1.7 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -94,7 +94,7 @@ ACLExtUser::dump() const
 bool
 ACLExtUser::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 ACL *
index 23df67b1cda6749bbf3d11e99de84ea2c44d62e0..3ca6fc758530fb5754836c16dd5c57c28237df2f 100644 (file)
@@ -355,7 +355,7 @@ ACLIP::dump() const
 bool
 ACLIP::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 int
index edf2cc3f688f5aee78489b9a7f96b64eea4da0c1..2aa48b2ebae8f1bb66e6ec9c3a54d81db2a6c58c 100644 (file)
@@ -100,7 +100,7 @@ ACLIdent::dump() const
 bool
 ACLIdent::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 ACL *
index ea57590fb3043db2b7ab5fc5b247a4fcce080590..0d3f4994498e46ecef0808b5d98d9ed2da1e14ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLIntRange.cc,v 1.3 2003/10/20 12:33:01 robertc Exp $
+ * $Id: ACLIntRange.cc,v 1.4 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Robert Collins
@@ -70,6 +70,12 @@ ACLIntRange::parse()
     }
 }
 
+bool
+ACLIntRange::empty() const
+{
+    return ranges != NULL;
+}
+
 bool
 ACLIntRange::match(int i)
 {
index 391aa374d44e00f4609fdace9006de9e867d5a2d..9065006bede200ba8a66f292d358695993137bbc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLIntRange.h,v 1.2 2003/08/04 22:14:38 robertc Exp $
+ * $Id: ACLIntRange.h,v 1.3 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -49,6 +49,7 @@ public:
     virtual bool match(int);
     virtual wordlist *dump();
     virtual void parse();
+    virtual bool empty() const;
     virtual ACLData<int> *clone() const;
 
 private:
index d3551991489b6c67354720b7f1da4d33832d5ab4..193386c66f58242bfa9acffc7494b1a059e1ecb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLMethodData.cc,v 1.5 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLMethodData.cc,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -93,6 +93,12 @@ ACLMethodData::parse()
     }
 }
 
+bool
+ACLMethodData::empty() const
+{
+    return values != NULL;
+}
+
 ACLData<method_t> *
 ACLMethodData::clone() const
 {
index 24ad5d540e63023309b8ece97bca7e580fbb70d1..d394d981bc4ffe04f4e2a0881e5d2d7872cbec70 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLMethodData.h,v 1.3 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLMethodData.h,v 1.4 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -52,6 +52,7 @@ public:
     bool match(method_t);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<method_t> *clone() const;
 
     List<method_t> *values;
index 60486f77726e838e692c84c6ddfe1a0c6b171db7..f6b5eab0fc85c1d50c652e1d2cda57cd65e9ef1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLProtocolData.cc,v 1.5 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLProtocolData.cc,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -93,6 +93,12 @@ ACLProtocolData::parse()
     }
 }
 
+bool
+ACLProtocolData::empty() const
+{
+    return values == NULL;
+}
+
 ACLData<protocol_t> *
 ACLProtocolData::clone() const
 {
index 04148664682a2ae19e1ac76761fad3f62c4cda80..1a162e4900deb8e744c1d215c9eec430abb1121e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLProtocolData.h,v 1.3 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLProtocolData.h,v 1.4 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -52,6 +52,7 @@ public:
     bool match(protocol_t);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<protocol_t> *clone() const;
 
     List<protocol_t> *values;
index 707a41735dea137c4d81499cebd8d7e88ca27e67..2e35615afdc2078aa40da864966e3cddc961cb8c 100644 (file)
@@ -97,7 +97,7 @@ ACLProxyAuth::dump() const
 bool
 ACLProxyAuth::empty () const
 {
-    return data != NULL;
+    return data == NULL;
 }
 
 bool
index 15ac98103c38a58cc1fc347e9eef5b73fb5798c7..24031ed80d34e83049d499f2b3ed437bd31aa4ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLRegexData.cc,v 1.7 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLRegexData.cc,v 1.8 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -160,6 +160,11 @@ ACLRegexData::parse()
     aclParseRegexList(&data);
 }
 
+bool
+ACLRegexData::empty() const
+{
+    return data == NULL;
+}
 
 ACLData<char const *> *
 ACLRegexData::clone() const
index a9716c7109a1c1981b26348537a790143a360408..63bfef28225d4933971526fea7ef09a60d550742 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLRegexData.h,v 1.5 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLRegexData.h,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -47,6 +47,7 @@ public:
     virtual bool match(char const *user);
     virtual wordlist *dump();
     virtual void parse();
+    virtual bool empty() const;
     virtual ACLData<char const *> *clone() const;
 
 private:
index f9c5ca9fb89c19f49cc57388337afed1ce668a60..8bdbc69c12541d889a392f0423b64ccbf28659fd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLStrategised.h,v 1.9 2005/05/06 01:57:55 hno Exp $
+ * $Id: ACLStrategised.h,v 1.10 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -66,6 +66,7 @@ public:
     virtual int match (M const &);
     virtual wordlist *dump() const;
     virtual bool empty () const;
+    virtual bool valid () const;
     virtual ACL *clone()const;
 
 private:
@@ -137,6 +138,13 @@ ACLStrategised<MatchType>::parse()
     data->parse();
 }
 
+template <class MatchType>
+bool
+ACLStrategised<MatchType>::empty() const
+{
+    return data->empty();
+}
+
 template <class MatchType>
 int
 ACLStrategised<MatchType>::match(ACLChecklist *checklist)
@@ -160,9 +168,9 @@ ACLStrategised<MatchType>::dump() const
 
 template <class MatchType>
 bool
-ACLStrategised<MatchType>::empty () const
+ACLStrategised<MatchType>::valid () const
 {
-    return data == NULL;
+    return matcher->valid();
 }
 
 template <class MatchType>
index a37189d5ae1666ba3bd4c4ac9a20747d05762eb4..b849559bd366f86cd0ae09ed538b55b8d13b70e1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLStrategy.h,v 1.2 2004/12/24 08:57:59 robertc Exp $
+ * $Id: ACLStrategy.h,v 1.3 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -52,6 +52,8 @@ public:
 
     virtual bool requiresReply() const {return false;}
 
+    virtual bool valid() const {return true;}
+
     virtual ~ACLStrategy(){}}
 
 ;
index 9afa52344985d910b2e76dd163f09820c1fdc757..eeada440536f41f781307392dcfe38df94fcca12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLStringData.cc,v 1.5 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLStringData.cc,v 1.6 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -110,6 +110,12 @@ ACLStringData::parse()
         values = values->insert(xstrdup(t), splaystrcmp);
 }
 
+bool
+ACLStringData::empty() const
+{
+    return values == NULL;
+}
+
 ACLData<char const *> *
 ACLStringData::clone() const
 {
index 33426e6b36d9d2d5d37f4ad3a09fa576a74c4c68..c8a87f1493d1bc24f7a9c3c09a2f9184359096db 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLStringData.h,v 1.3 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLStringData.h,v 1.4 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -53,6 +53,7 @@ public:
     bool match(char const *);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<char const *> *clone() const;
 
     SplayNode<char *> *values;
index 53876927eab35add337b5fa075e35804a094217e..347846e690359b1592fa40061679f97752f72942 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLTimeData.cc,v 1.9 2005/05/06 01:57:55 hno Exp $
+ * $Id: ACLTimeData.cc,v 1.10 2005/05/08 06:36:45 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -252,6 +252,11 @@ ACLTimeData::parse()
     }
 }
 
+bool
+ACLTimeData::empty() const
+{
+    return false;
+}
 
 ACLData<time_t> *
 ACLTimeData::clone() const
index 53a1c6048efc9e3ddfee5ad075868a76c5414f18..f143be2a31e2c35bb71a635e1eac8c3b2cb99a00 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ACLTimeData.h,v 1.4 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ACLTimeData.h,v 1.5 2005/05/08 06:36:45 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -52,6 +52,7 @@ public:
     bool match(time_t);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<time_t> *clone() const;
 
 private:
index 822f5dcf829e4836c62bcbed9528fac891d36460..66c5acc3939743b360cc33de285919ea1021df5d 100644 (file)
@@ -163,6 +163,12 @@ ACLUserData::parse()
 }
 
 
+bool
+ACLUserData::empty() const
+{
+    return names == NULL;
+}
+
 ACLData<char const *> *
 ACLUserData::clone() const
 {
index c5354648be8142b77a6d80f365a231e183189817..2b874a54a6cb5f10dee3b36d3516d6f0c74dfab8 100644 (file)
@@ -49,6 +49,7 @@ public:
     bool match(char const *user);
     wordlist *dump();
     void parse();
+    bool empty() const;
     virtual ACLData<char const *> *clone() const;
 
     SplayNode<char *> *names;