diff options
author | joyce mcintosh <Joyce.McIntosh@Sun.COM> | 2010-07-26 15:02:13 -0700 |
---|---|---|
committer | joyce mcintosh <Joyce.McIntosh@Sun.COM> | 2010-07-26 15:02:13 -0700 |
commit | 1fdeec650620e8498c06f832ea4bd2292f7e9632 (patch) | |
tree | 93e66a90f7f7260ca1086e7701a6c8dc1e46c5fb /usr/src/lib/nsswitch/ad/common/getpwnam.c | |
parent | 1a024a4828552f36f41749085bad547c64a0f0a6 (diff) | |
download | illumos-joyent-1fdeec650620e8498c06f832ea4bd2292f7e9632.tar.gz |
6779186 need domain controller hot failover
6970986 Level II oplocks - smb_oplock_grant_t shouldn't be dynamically allocated
6971031 Unable add ACL on the share which has only the default owner tab by ZFS
6971899 OpenSSL not MT-safe and takes down smbd
6936762 libidmap should transparently handle interruption in connection to idmapd
6954902 mapping to unknown type does not use directory-based mapping information
--HG--
rename : usr/src/lib/libidmap/common/idmap_priv.h => usr/src/cmd/idmap/idmap/namemaps.h
Diffstat (limited to 'usr/src/lib/nsswitch/ad/common/getpwnam.c')
-rw-r--r-- | usr/src/lib/nsswitch/ad/common/getpwnam.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/usr/src/lib/nsswitch/ad/common/getpwnam.c b/usr/src/lib/nsswitch/ad/common/getpwnam.c index ece50a54b0..ff2140b59b 100644 --- a/usr/src/lib/nsswitch/ad/common/getpwnam.c +++ b/usr/src/lib/nsswitch/ad/common/getpwnam.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <pwd.h> @@ -192,9 +191,7 @@ _nss_ad_passwd2str(ad_backend_ptr be, nss_XbyY_args_t *argp) nss_result = NSS_STR_PARSE_PARSE; /* Create handles for idmap service */ - if (be->ih == NULL && idmap_init(&be->ih) != 0) - goto result_pwd2str; - if (idmap_get_create(be->ih, &ig) != 0) + if (idmap_get_create(&ig) != 0) goto result_pwd2str; /* Get name */ @@ -278,8 +275,6 @@ _nss_ad_passwd2str(ad_backend_ptr be, nss_XbyY_args_t *argp) result_pwd2str: idmap_get_destroy(ig); - (void) idmap_fini(be->ih); - be->ih = NULL; (void) adutils_freeresult(&be->result); free(domain); if (homedir != NULL_STR && homedir_v != NULL && @@ -310,7 +305,6 @@ getbyname(ad_backend_ptr be, void *a) uid_t uid; gid_t gid; int is_user, is_wuser, try_idmap; - idmap_handle_t *ih; be->db_type = NSS_AD_DB_PASSWD_BYNAME; @@ -329,17 +323,13 @@ getbyname(ad_backend_ptr be, void *a) * call fails then this will save us doing AD discovery and * AD lookup here. */ - if (idmap_init(&be->ih) != IDMAP_SUCCESS) - return ((nss_status_t)NSS_NOTFOUND); flag = (strcasecmp(dname, WK_DOMAIN) == 0) ? IDMAP_REQ_FLG_WK_OR_LOCAL_SIDS_ONLY : 0; is_wuser = -1; is_user = 1; - if (idmap_get_w2u_mapping(be->ih, NULL, NULL, name, + if (idmap_get_w2u_mapping(NULL, NULL, name, dname, flag, &is_user, &is_wuser, &be->uid, NULL, NULL, NULL) != IDMAP_SUCCESS) { - (void) idmap_fini(be->ih); - be->ih = NULL; RESET_ERRNO(); return ((nss_status_t)NSS_NOTFOUND); } @@ -357,11 +347,8 @@ getbyname(ad_backend_ptr be, void *a) dname, &try_idmap); free(searchfilter); - if (!try_idmap) { - (void) idmap_fini(be->ih); - be->ih = NULL; + if (!try_idmap) return (stat); - } } @@ -372,10 +359,8 @@ getbyname(ad_backend_ptr be, void *a) */ is_wuser = -1; is_user = 0; /* Map name to primary gid */ - idmaprc = idmap_get_w2u_mapping(be->ih, NULL, NULL, name, dname, + idmaprc = idmap_get_w2u_mapping(NULL, NULL, name, dname, flag, &is_user, &is_wuser, &gid, NULL, NULL, NULL); - (void) idmap_fini(be->ih); - be->ih = NULL; if (idmaprc != IDMAP_SUCCESS) { RESET_ERRNO(); return ((nss_status_t)NSS_NOTFOUND); @@ -424,9 +409,7 @@ getbyuid(ad_backend_ptr be, void *a) goto out; /* Map the given UID to a SID using the idmap service */ - if (idmap_init(&be->ih) != 0) - goto out; - if (idmap_get_u2w_mapping(be->ih, &argp->key.uid, NULL, 0, + if (idmap_get_u2w_mapping(&argp->key.uid, NULL, 0, 1, NULL, &sidprefix, &rid, &winname, &windomain, NULL, NULL) != 0) { RESET_ERRNO(); @@ -461,13 +444,10 @@ getbyuid(ad_backend_ptr be, void *a) /* Map winname to primary gid using idmap service */ is_user = 0; is_wuser = -1; - idmaprc = idmap_get_w2u_mapping(be->ih, NULL, NULL, + idmaprc = idmap_get_w2u_mapping(NULL, NULL, winname, windomain, 0, &is_user, &is_wuser, &gid, NULL, NULL, NULL); - (void) idmap_fini(be->ih); - be->ih = NULL; - if (idmaprc != IDMAP_SUCCESS) { RESET_ERRNO(); goto out; @@ -486,8 +466,6 @@ out: idmap_free(sidprefix); idmap_free(winname); idmap_free(windomain); - (void) idmap_fini(be->ih); - be->ih = NULL; return (stat); } |