diff options
author | michen <none@none> | 2008-06-19 16:57:55 -0700 |
---|---|---|
committer | michen <none@none> | 2008-06-19 16:57:55 -0700 |
commit | ca190d8debe6672d99069a376a987adee0765d6c (patch) | |
tree | e38595974877df994e7953d9cf5190ae8c29b311 /usr/src/lib/libsldap | |
parent | f94f0840d8d73b4f9cd054b7edf6085b527aaf0e (diff) | |
download | illumos-gate-ca190d8debe6672d99069a376a987adee0765d6c.tar.gz |
6716317 Standalone ldaplist fails on a native LDAP client system
Diffstat (limited to 'usr/src/lib/libsldap')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_config.c | 17 | ||||
-rw-r--r-- | usr/src/lib/libsldap/common/ns_connect.c | 2 | ||||
-rwxr-xr-x | usr/src/lib/libsldap/common/ns_connmgmt.c | 16 | ||||
-rw-r--r-- | usr/src/lib/libsldap/common/ns_standalone.c | 3 |
4 files changed, 23 insertions, 15 deletions
diff --git a/usr/src/lib/libsldap/common/ns_config.c b/usr/src/lib/libsldap/common/ns_config.c index e985bcd38b..b4d8d88fde 100644 --- a/usr/src/lib/libsldap/common/ns_config.c +++ b/usr/src/lib/libsldap/common/ns_config.c @@ -837,14 +837,19 @@ __s_api_destroy_config(ns_config_t *cfg) */ static ns_config_t * -get_curr_config_unlocked(ns_config_t *cfg) +get_curr_config_unlocked(ns_config_t *cfg, boolean_t global) { ns_config_t *ret; ret = cfg; if (cfg != NULL) { (void) mutex_lock(&cfg->config_mutex); - if (cfg->delete) + /* + * allow access to per connection management (non-global) + * config so operations on connection being closed can still + * be completed + */ + if (cfg->delete && global == B_TRUE) ret = NULL; else cfg->nUse++; @@ -867,7 +872,7 @@ set_curr_config_global(ns_config_t *ptr) (void) mutex_lock(&ns_parse_lock); cur_cfg = current_config; - cfg = get_curr_config_unlocked(cur_cfg); + cfg = get_curr_config_unlocked(cur_cfg, B_TRUE); if (cfg != ptr) { __s_api_destroy_config(cfg); current_config = ptr; @@ -899,7 +904,7 @@ set_curr_config(ns_config_t *ptr) if (rc == 0 && cmg != NULL && cmg->config != NULL) { (void) mutex_lock(&cmg->cfg_lock); cur_cfg = cmg->config; - cfg = get_curr_config_unlocked(cur_cfg); + cfg = get_curr_config_unlocked(cur_cfg, B_FALSE); if (cfg != ptr) { __s_api_destroy_config(cfg); cmg->config = ptr; @@ -989,7 +994,7 @@ __s_api_get_default_config_global(void) (void) mutex_lock(&ns_parse_lock); cur_cfg = current_config; - cfg = get_curr_config_unlocked(cur_cfg); + cfg = get_curr_config_unlocked(cur_cfg, B_TRUE); (void) mutex_unlock(&ns_parse_lock); return (cfg); @@ -1013,7 +1018,7 @@ __s_api_get_default_config(void) if (rc == 0 && cmg != NULL && cmg->config != NULL) { (void) mutex_lock(&cmg->cfg_lock); cur_cfg = cmg->config; - cfg = get_curr_config_unlocked(cur_cfg); + cfg = get_curr_config_unlocked(cur_cfg, B_FALSE); (void) mutex_unlock(&cmg->cfg_lock); return (cfg); } diff --git a/usr/src/lib/libsldap/common/ns_connect.c b/usr/src/lib/libsldap/common/ns_connect.c index 8965682bd6..e935a186b5 100644 --- a/usr/src/lib/libsldap/common/ns_connect.c +++ b/usr/src/lib/libsldap/common/ns_connect.c @@ -2154,7 +2154,7 @@ createNonTLSSession(const char *serverAddr, * OUTPUT: * ldp - a pointer to an LDAP structure which will be used * for all the subsequent operations against the server. - * If an error accures, the function returns an NS error code + * If an error occurs, the function returns an NS error code * and provides an additional info pointed by *errorp. */ static diff --git a/usr/src/lib/libsldap/common/ns_connmgmt.c b/usr/src/lib/libsldap/common/ns_connmgmt.c index c4f4f67e8b..d0e1ca0332 100755 --- a/usr/src/lib/libsldap/common/ns_connmgmt.c +++ b/usr/src/lib/libsldap/common/ns_connmgmt.c @@ -465,7 +465,7 @@ __s_api_peruser_proc(void) isPeruserNscd = check_nscd_proc(my_ppid, B_TRUE); } - /* Remeber for whom isPeruserNscd is. */ + /* Remember for whom isPeruserNscd is. */ checkedPpid = my_ppid; (void) mutex_unlock(&nscdLock); @@ -514,7 +514,7 @@ __s_api_nscd_proc(void) */ isMainNscd = check_nscd_proc(my_pid, B_FALSE); - /* Remeber for whom isMainNscd is. */ + /* Remember for whom isMainNscd is. */ checkedPid = my_pid; (void) mutex_unlock(&nscdLock); @@ -576,7 +576,7 @@ init_conn_mgmt() } static void -mark_shutdown_or_reoladed(int op) +mark_shutdown_or_reloaded(int op) { ns_conn_mgmt_t *cmg = ns_connmgmt; @@ -670,7 +670,7 @@ access_conn_mgmt(int op) ns_connmgmt_shutting_down = B_TRUE; if (ns_connmgmt != NULL) { cmg = ns_connmgmt; - mark_shutdown_or_reoladed(op); + mark_shutdown_or_reloaded(op); ns_connmgmt = NULL; } (void) mutex_unlock(&ns_connmgmt_lock); @@ -680,7 +680,7 @@ access_conn_mgmt(int op) if (op == NS_CONN_MGMT_OP_RELOAD_CONFIG || op == NS_CONN_MGMT_OP_NEW_CONFIG) { cmg_prev = ns_connmgmt; - mark_shutdown_or_reoladed(op); + mark_shutdown_or_reloaded(op); /* * the previous cmg (cmg_prev) will be freed later * when its ref count reaches zero @@ -1572,7 +1572,7 @@ __s_api_conn_mt_add(Connection *con, ns_conn_user_t *cu, ns_ldap_error_t **ep) } /* - * return an MT connection to the pool when a conn user is done usint it + * return an MT connection to the pool when a conn user is done using it * * Input: * cu : pointer to the conn_user structure @@ -2237,8 +2237,8 @@ __s_api_shutdown_conn_mgmt() /* - * reinitialize the libsldap connection management after - * receiving a new native LDAP configuration from ldap_cachemgr + * Reinitialize the libsldap connection management after + * a new native LDAP configuration is received. */ void __s_api_reinit_conn_mgmt_new_config(ns_config_t *new_cfg) diff --git a/usr/src/lib/libsldap/common/ns_standalone.c b/usr/src/lib/libsldap/common/ns_standalone.c index eb49756c33..74f6ded348 100644 --- a/usr/src/lib/libsldap/common/ns_standalone.c +++ b/usr/src/lib/libsldap/common/ns_standalone.c @@ -54,6 +54,7 @@ #include "ns_cache_door.h" #include "ns_internal.h" +#include "ns_connmgmt.h" typedef enum { INFO_SERVER_JUST_INITED = -1, @@ -2095,6 +2096,8 @@ __ns_ldap_initStandalone(const ns_standalone_conf_t *sa_conf, } __s_api_init_config(cfg); + /* Connection management should use the new config now. */ + __s_api_reinit_conn_mgmt_new_config(cfg); __ns_ldap_setServer(TRUE); (void) mutex_lock(&dir_servers.listReplaceLock); |