]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
renamed cachemgr_passwd to CacheMgrPasswd and moved to own header.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Sep 2012 09:44:06 +0000 (11:44 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Sep 2012 09:44:06 +0000 (11:44 +0200)
src/CacheManager.h
src/CacheMgrPasswd.cc [new file with mode: 0644]
src/CacheMgrPasswd.h [new file with mode: 0644]
src/Makefile.am
src/SquidConfig.h
src/cache_cf.cc
src/cache_manager.cc
src/structs.h

index 7a1dc2d75f6e929a3893ef19dcc53ed1a4cac070..a5ea87d1307b74ffb18ef5202d73d85b097f7290 100644 (file)
@@ -48,6 +48,7 @@
  */
 
 class HttpRequest;
+class CacheMgrPasswd;
 /**
  \ingroup CacheManagerAPI
  * a CacheManager - the menu system for interacting with squid.
@@ -83,7 +84,7 @@ protected:
     Mgr::CommandPointer ParseUrl(const char *url);
     void ParseHeaders(const HttpRequest * request, Mgr::ActionParams &params);
     int CheckPassword(const Mgr::Command &cmd);
-    char *PasswdGet(cachemgr_passwd *, const char *);
+    char *PasswdGet(CacheMgrPasswd *, const char *);
 
     void registerProfile(const Mgr::ActionProfilePointer &profile);
 
diff --git a/src/CacheMgrPasswd.cc b/src/CacheMgrPasswd.cc
new file mode 100644 (file)
index 0000000..7c6dc78
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#include "squid.h"
+#include "CacheMgrPasswd.h"
+
+
diff --git a/src/CacheMgrPasswd.h b/src/CacheMgrPasswd.h
new file mode 100644 (file)
index 0000000..f48edce
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef SQUID_CACHEMGRPASSWD_H_
+#define SQUID_CACHEMGRPASSWD_H_
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+class wordlist;
+
+//TODO: this class is misnamed and C-ish. Split into CacheMgrPasswd and
+// CacheMgrPasswdList (std::list-derived)
+class CacheMgrPasswd {
+public:
+    char *passwd;
+    wordlist *actions;
+    CacheMgrPasswd *next;
+};
+
+
+#endif /* SQUID_CACHEMGRPASSWD_H_ */
index bd3937f6e0dd908f3b6241de6c3fa5f76e978178..1510f7e379e7f9158558c4aff216e773986ac871 100644 (file)
@@ -272,6 +272,8 @@ squid_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+       CacheMgrPasswd.cc \
        cache_cf.cc \
        CacheDigest.h \
        CacheDigest.cc \
@@ -1383,6 +1385,8 @@ tests_testCacheManager_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        CacheDigest.h \
        CacheDigest.cc \
@@ -1774,6 +1778,8 @@ tests_testEvent_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        cache_manager.cc \
        carp.h \
@@ -2012,6 +2018,8 @@ tests_testEventLoop_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        carp.h \
        carp.cc \
@@ -2245,6 +2253,8 @@ tests_test_http_range_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        cache_manager.cc \
        CacheDigest.h \
@@ -2534,6 +2544,8 @@ tests_testHttpRequest_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        debug.cc \
        CacheDigest.h \
@@ -3593,6 +3605,8 @@ tests_testURL_SOURCES = \
        YesNoNone.h \
        YesNoNone.cc \
        RefreshPattern.h \
+       CacheMgrPasswd.h \
+    CacheMgrPasswd.cc \
        cache_cf.cc \
        cache_manager.cc \
        CacheDigest.h \
index 337f8ac28430803c157f3bbdfa622ad6ffb159ca..747f9d3fb77e5e18e9758d22838cbd472703c675 100644 (file)
 #endif
 
 class acl_access;
-class AclDenyInfoList;
 class acl_size_t;
+class AclDenyInfoList;
+class CacheMgrPasswd;
 class HeaderManglers;
 class RefreshPattern;
-class SwapDir;
 class RemovalPolicySettings;
+class SwapDir;
 
 namespace AnyP {
 class PortCfg;
@@ -265,7 +266,7 @@ public:
     } fqdncache;
     int minDirectHops;
     int minDirectRtt;
-    cachemgr_passwd *passwd_list;
+    CacheMgrPasswd *passwd_list;
 
     struct {
         int objectsPerBucket;
index 4fe46c3b5654f43114bd088ecaa6485fb072560c..d8cb234dde462474b048e506875cf381769e45f3 100644 (file)
@@ -40,6 +40,7 @@
 #include "anyp/PortCfg.h"
 #include "AuthReg.h"
 #include "base/RunnersRegistry.h"
+#include "CacheMgrPasswd.h"
 #include "CachePeer.h"
 #include "cache_cf.h"
 #include "ConfigParser.h"
@@ -2369,7 +2370,7 @@ free_peer(CachePeer ** P)
 }
 
 static void
-dump_cachemgrpasswd(StoreEntry * entry, const char *name, cachemgr_passwd * list)
+dump_cachemgrpasswd(StoreEntry * entry, const char *name, CacheMgrPasswd * list)
 {
     wordlist *w;
 
@@ -2389,15 +2390,15 @@ dump_cachemgrpasswd(StoreEntry * entry, const char *name, cachemgr_passwd * list
 }
 
 static void
-parse_cachemgrpasswd(cachemgr_passwd ** head)
+parse_cachemgrpasswd(CacheMgrPasswd ** head)
 {
     char *passwd = NULL;
     wordlist *actions = NULL;
-    cachemgr_passwd *p;
-    cachemgr_passwd **P;
+    CacheMgrPasswd *p;
+    CacheMgrPasswd **P;
     parse_string(&passwd);
     parse_wordlist(&actions);
-    p = static_cast<cachemgr_passwd *>(xcalloc(1, sizeof(cachemgr_passwd)));
+    p = new CacheMgrPasswd;
     p->passwd = passwd;
     p->actions = actions;
 
@@ -2406,7 +2407,7 @@ parse_cachemgrpasswd(cachemgr_passwd ** head)
          * See if any of the actions from this line already have a
          * password from previous lines.  The password checking
          * routines in cache_manager.c take the the password from
-         * the first cachemgr_passwd struct that contains the
+         * the first CacheMgrPasswd struct that contains the
          * requested action.  Thus, we should warn users who might
          * think they can have two passwords for the same action.
          */
@@ -2427,9 +2428,9 @@ parse_cachemgrpasswd(cachemgr_passwd ** head)
 }
 
 static void
-free_cachemgrpasswd(cachemgr_passwd ** head)
+free_cachemgrpasswd(CacheMgrPasswd ** head)
 {
-    cachemgr_passwd *p;
+    CacheMgrPasswd *p;
 
     while ((p = *head) != NULL) {
         *head = p->next;
index 5322d2ae85c30e66e8223e0f99b4d26bce2d2224..0b14abba7b0a62010420d3d8834d38c20ab57616 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "base/TextException.h"
+#include "CacheMgrPasswd.h"
 #include "CacheManager.h"
 #include "comm/Connection.h"
 #include "Debug.h"
@@ -459,12 +460,12 @@ CacheManager::ActionProtection(const Mgr::ActionProfile::Pointer &profile)
 }
 
 /*
- \ingroup CacheManagerInternal
\ingroup CacheManagerInternal
  * gets from the global Config the password the user would need to supply
  * for the action she queried
  */
 char *
-CacheManager::PasswdGet(cachemgr_passwd * a, const char *action)
+CacheManager::PasswdGet(CacheMgrPasswd * a, const char *action)
 {
     wordlist *w;
 
index 5f75f1648cbae018f9bc097a4dda6ec572b21265..af8a4b7b4e07897bb4589702b1f76a931ca31f4f 100644 (file)
@@ -104,7 +104,7 @@ class RemovalPolicySettings;
 class external_acl;
 class Store;
 class CustomLog;
-class cachemgr_passwd;
+class CacheMgrPasswd;
 namespace AnyP
 {
 struct PortCfg;
@@ -304,15 +304,6 @@ private:
     unsigned int destinationIPLookedUp_:1;
 };
 
-
-class cachemgr_passwd {
-public:
-    char *passwd;
-    wordlist *actions;
-    cachemgr_passwd *next;
-};
-
-
 #if USE_SSL
 struct _sslproxy_cert_sign {
     int alg;