diff options
Diffstat (limited to 'lib/libaccess')
-rw-r--r-- | lib/libaccess/aclcache.cpp | 1 | ||||
-rw-r--r-- | lib/libaccess/aclflush.cpp | 1 | ||||
-rw-r--r-- | lib/libaccess/aclpriv.h | 1 | ||||
-rw-r--r-- | lib/libaccess/authdb.cpp | 112 | ||||
-rw-r--r-- | lib/libaccess/oneeval.cpp | 1 | ||||
-rw-r--r-- | lib/libaccess/permhash.h | 11 | ||||
-rw-r--r-- | lib/libaccess/register.cpp | 1 |
7 files changed, 6 insertions, 122 deletions
diff --git a/lib/libaccess/aclcache.cpp b/lib/libaccess/aclcache.cpp index 10588879..f814df7c 100644 --- a/lib/libaccess/aclcache.cpp +++ b/lib/libaccess/aclcache.cpp @@ -52,6 +52,7 @@ #include <libaccess/usrcache.h> #include <libaccess/las.h> #include "aclutil.h" +#define NO_ACL_HASH_FUNCS #include "permhash.h" #include "aclcache.h" diff --git a/lib/libaccess/aclflush.cpp b/lib/libaccess/aclflush.cpp index 8e5ce7c8..a2f44618 100644 --- a/lib/libaccess/aclflush.cpp +++ b/lib/libaccess/aclflush.cpp @@ -52,7 +52,6 @@ #include <libaccess/aclglobal.h> #include <libaccess/las.h> #include "aclcache.h" -#include <libaccess/dbtlibaccess.h> extern void ACL_DatabaseDestroy(void); diff --git a/lib/libaccess/aclpriv.h b/lib/libaccess/aclpriv.h index a95b3637..8744ef02 100644 --- a/lib/libaccess/aclpriv.h +++ b/lib/libaccess/aclpriv.h @@ -61,6 +61,7 @@ #define ACL_MIN_IDX 0 #define ACL_EXPR_STACK 1024 #define ACL_TABLE_THRESHOLD 10 +#define ACL_NO_UNPUT 1 /* unput is not used and causes compiler warnings */ typedef enum { ACL_EXPR_OP_AND, diff --git a/lib/libaccess/authdb.cpp b/lib/libaccess/authdb.cpp index da435c39..4196c3ab 100644 --- a/lib/libaccess/authdb.cpp +++ b/lib/libaccess/authdb.cpp @@ -47,7 +47,6 @@ #include <plhash.h> #include <netsite.h> -#include "permhash.h" #include <ldaputil/errors.h> #include <ldaputil/certmap.h> #include <ldaputil/dbconf.h> @@ -250,117 +249,6 @@ NSAPI_PUBLIC int ACL_DatabaseFind(NSErr_t *errp, const char *name, return LAS_EVAL_FAIL; } - -NSAPI_PUBLIC int ACL_ReadDbMapFile (NSErr_t *errp, const char *map_file, - int default_only) -{ - DBConfInfo_t *info; - DBConfDBInfo_t *db_info; - DBPropVal_t *propval; - PList_t plist; - int rv; - int seen_default = 0; - - if (default_only) - rv = dbconf_read_default_dbinfo(map_file, &db_info); - else - rv = dbconf_read_config_file(map_file, &info); - - if (rv != LDAPU_SUCCESS) { - nserrGenerate(errp, ACLERRFAIL, ACLERR4600, ACL_Program, 3, XP_GetAdminStr(DBT_ReadDbMapFileErrorReadingFile), map_file, ldapu_err2string(rv)); - return -1; - } - - rv = 0; - - if (!default_only) - db_info = info->firstdb; - - while(db_info) { - char *url = db_info->url; - char *dbname = db_info->dbname; - ACLDbType_t dbtype; - - /* process db_info */ - if (url) { - rv = acl_url_to_dbtype(url, &dbtype); - - if (rv < 0) { - nserrGenerate(errp, ACLERRFAIL, ACLERR4610, ACL_Program, 2, - XP_GetAdminStr(DBT_ReadDbMapFileCouldntDetermineDbtype), url); - break; - } - } - else { - nserrGenerate(errp, ACLERRFAIL, ACLERR4620, ACL_Program, 2, - XP_GetAdminStr(DBT_ReadDbMapFileMissingUrl), dbname); - rv = -1; - break; - } - - /* convert any property-value pairs in db_info into plist */ - plist = PListNew(NULL); - propval = db_info->firstprop; - - while(propval) { - if (propval->prop) { - PListInitProp(plist, 0, propval->prop, propval->val, 0); - } - else { - nserrGenerate(errp, ACLERRINVAL, ACLERR4630, ACL_Program, 2, - XP_GetAdminStr(DBT_ReadDbMapFileInvalidPropertyPair), dbname); - rv = -1; - break; - } - propval = propval->next; - } - - if (rv < 0) break; - - /* register the database */ - rv = ACL_DatabaseRegister(errp, dbtype, dbname, url, plist); - PListDestroy(plist); - - if (rv < 0) { - /* Failed to register database */ - nserrGenerate(errp, ACLERRFAIL, ACLERR4640, ACL_Program, 2, - XP_GetAdminStr(DBT_ReadDbMapFileRegisterDatabaseFailed), dbname); - break; - } - - /* If the dbname is "default", set the default_dbtype */ - if (!strcmp(dbname, DBCONF_DEFAULT_DBNAME)) { - if (!ACL_DbTypeIsEqual(errp, dbtype, ACL_DbTypeLdap)) { - nserrGenerate(errp, ACLERRINVAL, ACLERR4350, ACL_Program, 1, - XP_GetAdminStr(DBT_ReadDbMapFileDefaultDatabaseNotLdap)); - rv = -1; - break; - } - if (seen_default) { - nserrGenerate(errp, ACLERRINVAL, ACLERR4360, ACL_Program, 1, XP_GetAdminStr(DBT_ReadDbMapFileMultipleDefaultDatabases)); - rv = -1; - break; - } - seen_default = 1; - ACL_DatabaseSetDefault(errp, dbname); - } - - db_info = db_info->next; - } - - if (!seen_default) { - nserrGenerate(errp, ACLERRINVAL, ACLERR4370, ACL_Program, 1, XP_GetAdminStr(DBT_ReadDbMapFileMissingDefaultDatabase)); - rv = -1; - } - - if (default_only) - dbconf_free_dbinfo(db_info); - else - dbconf_free_confinfo(info); - - return rv; -} - void ACL_DatabaseDestroy(void) { diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp index 8056e0ec..ed29ee47 100644 --- a/lib/libaccess/oneeval.cpp +++ b/lib/libaccess/oneeval.cpp @@ -70,6 +70,7 @@ #include "aclutil.h" #include "aclcache.h" #include "oneeval.h" +#define NO_ACL_HASH_FUNCS #include "permhash.h" static ACLDispatchVector_t __nsacl_vector = { diff --git a/lib/libaccess/permhash.h b/lib/libaccess/permhash.h index f76ab4c6..9446fb55 100644 --- a/lib/libaccess/permhash.h +++ b/lib/libaccess/permhash.h @@ -80,13 +80,7 @@ static PLHashAllocOps ACLPermAllocOps = { ACL_PermFreeEntry }; -static int -PR_StringFree(PLHashEntry *he, int i, void *arg) -{ - PERM_FREE(he->key); - return 0; -} - +#ifndef NO_ACL_HASH_FUNCS static PLHashNumber PR_HashCaseString(const void *key) { @@ -111,6 +105,7 @@ PR_CompareCaseStrings(const void *v1, const void *v2) return (strcasecmp(s1, s2) == 0); #endif } - +#endif /* NO_ACL_HASH_FUNCS */ + #endif /* _PERMHASH_H */ diff --git a/lib/libaccess/register.cpp b/lib/libaccess/register.cpp index 09d918fc..3f2acc5e 100644 --- a/lib/libaccess/register.cpp +++ b/lib/libaccess/register.cpp @@ -56,7 +56,6 @@ #include <libaccess/aclproto.h> #include <libaccess/aclglobal.h> #include "aclcache.h" -#include <libaccess/dbtlibaccess.h> #include <libaccess/aclerror.h> /* This is to force aclspace.o into ns-httpd30.dll */ |