summaryrefslogtreecommitdiff
path: root/usr/src/lib/nsswitch
diff options
context:
space:
mode:
authorjoyce mcintosh <Joyce.McIntosh@Sun.COM>2010-07-26 15:02:13 -0700
committerjoyce mcintosh <Joyce.McIntosh@Sun.COM>2010-07-26 15:02:13 -0700
commit1fdeec650620e8498c06f832ea4bd2292f7e9632 (patch)
tree93e66a90f7f7260ca1086e7701a6c8dc1e46c5fb /usr/src/lib/nsswitch
parent1a024a4828552f36f41749085bad547c64a0f0a6 (diff)
downloadillumos-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')
-rw-r--r--usr/src/lib/nsswitch/ad/common/ad_common.h4
-rw-r--r--usr/src/lib/nsswitch/ad/common/getgrent.c16
-rw-r--r--usr/src/lib/nsswitch/ad/common/getpwnam.c36
-rw-r--r--usr/src/lib/nsswitch/ad/common/getspent.c10
4 files changed, 13 insertions, 53 deletions
diff --git a/usr/src/lib/nsswitch/ad/common/ad_common.h b/usr/src/lib/nsswitch/ad/common/ad_common.h
index a328b00b9a..7592d3613b 100644
--- a/usr/src/lib/nsswitch/ad/common/ad_common.h
+++ b/usr/src/lib/nsswitch/ad/common/ad_common.h
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _AD_COMMON_H
@@ -82,7 +81,6 @@ struct ad_backend {
fnf adobj2str;
char *buffer;
int buflen;
- idmap_handle_t *ih;
uid_t uid;
adutils_result_t *result;
nss_ad_db_type_t db_type;
diff --git a/usr/src/lib/nsswitch/ad/common/getgrent.c b/usr/src/lib/nsswitch/ad/common/getgrent.c
index b5f70666ba..84481bb09f 100644
--- a/usr/src/lib/nsswitch/ad/common/getgrent.c
+++ b/usr/src/lib/nsswitch/ad/common/getgrent.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 <grp.h>
@@ -72,7 +71,6 @@ getbynam(ad_backend_ptr be, void *a)
idmap_stat idmaprc;
gid_t gid;
int is_user, is_wuser;
- idmap_handle_t *ih;
be->db_type = NSS_AD_DB_GROUP_BYNAME;
@@ -89,14 +87,10 @@ getbynam(ad_backend_ptr be, void *a)
/*
* Map the name to gid using idmap service.
*/
- idmaprc = idmap_init(&ih);
- if (idmaprc != IDMAP_SUCCESS)
- return ((nss_status_t)NSS_NOTFOUND);
is_wuser = -1;
is_user = 0; /* Map name to gid */
- idmaprc = idmap_get_w2u_mapping(ih, NULL, NULL, name, dname,
+ idmaprc = idmap_get_w2u_mapping(NULL, NULL, name, dname,
0, &is_user, &is_wuser, &gid, NULL, NULL, NULL);
- (void) idmap_fini(ih);
if (idmaprc != IDMAP_SUCCESS) {
RESET_ERRNO();
return ((nss_status_t)NSS_NOTFOUND);
@@ -134,9 +128,7 @@ getbygid(ad_backend_ptr be, void *a)
goto out;
/* Map the given GID to a SID using the idmap service */
- if (idmap_init(&be->ih) != 0)
- goto out;
- if (idmap_get_u2w_mapping(be->ih, &argp->key.gid, NULL, 0,
+ if (idmap_get_u2w_mapping(&argp->key.gid, NULL, 0,
0, NULL, NULL, NULL, &winname, &windomain,
NULL, NULL) != 0) {
RESET_ERRNO();
@@ -161,8 +153,6 @@ getbygid(ad_backend_ptr be, void *a)
out:
idmap_free(winname);
idmap_free(windomain);
- (void) idmap_fini(be->ih);
- be->ih = NULL;
return (stat);
}
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);
}
diff --git a/usr/src/lib/nsswitch/ad/common/getspent.c b/usr/src/lib/nsswitch/ad/common/getspent.c
index 257540c8db..a66d8b122b 100644
--- a/usr/src/lib/nsswitch/ad/common/getspent.c
+++ b/usr/src/lib/nsswitch/ad/common/getspent.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 <shadow.h>
@@ -80,7 +79,6 @@ getbynam(ad_backend_ptr be, void *a)
idmap_stat idmaprc;
uid_t uid;
int is_user, is_wuser;
- idmap_handle_t *ih;
be->db_type = NSS_AD_DB_SHADOW_BYNAME;
@@ -98,14 +96,10 @@ getbynam(ad_backend_ptr be, void *a)
* Use idmap service to verify that the given
* name is a valid Windows name.
*/
- idmaprc = idmap_init(&ih);
- if (idmaprc != IDMAP_SUCCESS)
- return ((nss_status_t)NSS_NOTFOUND);
is_wuser = -1;
is_user = 1;
- idmaprc = idmap_get_w2u_mapping(ih, NULL, NULL, name, dname,
+ idmaprc = idmap_get_w2u_mapping(NULL, NULL, name, dname,
0, &is_user, &is_wuser, &uid, NULL, NULL, NULL);
- (void) idmap_fini(ih);
if (idmaprc != IDMAP_SUCCESS) {
RESET_ERRNO();
return ((nss_status_t)NSS_NOTFOUND);