From be1a20d965497c96b6cf1ca14832a30fa7c140b7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 Jan 2009 18:14:14 -0500 Subject: Add checks to make sure we are getting a user from the correct domain. --- server/nss/nsssrv.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'server/nss/nsssrv.c') diff --git a/server/nss/nsssrv.c b/server/nss/nsssrv.c index 0c7bf0604..93a897a23 100644 --- a/server/nss/nsssrv.c +++ b/server/nss/nsssrv.c @@ -359,9 +359,12 @@ failed: return EIO; } +/* domain names are case insensitive for now + * NOTE: this function is not utf-8 safe, + * only ASCII names for now */ static int _domain_comparator(void *key1, void *key2) { - return strcmp((char *)key1, (char *)key2); + return strcasecmp((char *)key1, (char *)key2); } static int nss_init_domains(struct nss_ctx *nctx) @@ -397,6 +400,14 @@ static int nss_init_domains(struct nss_ctx *nctx) goto done; } + ret = confdb_get_string(nctx->cdb, nctx, + "config/domains", "default", + NULL, &nctx->default_domain); + if (ret != EOK) { + retval = ret; + goto done; + } + retval = EOK; done: -- cgit