diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-07 19:25:48 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-08 10:55:03 -0400 |
commit | 6b5d45693f01eec55128eb3508266cda73071d93 (patch) | |
tree | c51ca00f2fb243e5eaf06128e8092583fba1bd8c /server/infopipe/infopipe_users.c | |
parent | e8a7526b06acf4af322fdab593c8bafbd9f4a103 (diff) | |
download | sssd-6b5d45693f01eec55128eb3508266cda73071d93.tar.gz sssd-6b5d45693f01eec55128eb3508266cda73071d93.tar.bz2 sssd-6b5d45693f01eec55128eb3508266cda73071d93.zip |
Change the way we retrieve domains
To be able to correctly filter out duplicate names when multiple non-fully
qualified domains are in use we need to be able to specify the domains order.
This is now accomplished by the configuration paramets 'domains' in the
config/domains entry. 'domains' is a comma separated list of domain names.
This paramter allows also to have disbaled domains in the configuration without
requiring to completely delete them.
The domains list is now kept in a linked list of sss_domain_info objects.
The first domain is also the "default" domain.
Diffstat (limited to 'server/infopipe/infopipe_users.c')
-rw-r--r-- | server/infopipe/infopipe_users.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/server/infopipe/infopipe_users.c b/server/infopipe/infopipe_users.c index 656d1525..14037774 100644 --- a/server/infopipe/infopipe_users.c +++ b/server/infopipe/infopipe_users.c @@ -144,10 +144,9 @@ int infp_users_get_cached(DBusMessage *message, struct sbus_conn_ctx *sconn) infp_getcached_req->min_last_login = arg_minlastlogin; infp_getcached_req->infp_req->domain = - btreemap_get_value(infp_getcached_req->infp_req->infp->domain_map, - (const void *)arg_domain); + infp_get_domain_obj(infp_getcached_req->infp_req->infp, arg_domain); /* Check for a valid domain */ - if(infp_getcached_req->infp_req->domain == NULL) { + if (infp_getcached_req->infp_req->domain == NULL) { einval_msg = talloc_strdup(infp_getcached_req, "Invalid domain."); goto einval; } @@ -320,10 +319,10 @@ int infp_users_create(DBusMessage *message, struct sbus_conn_ctx *sconn) goto denied; } - infp_createuser_req->infp_req->domain = btreemap_get_value(infp_createuser_req->infp_req->infp->domain_map, - (const void *)arg_domain); + infp_createuser_req->infp_req->domain = + infp_get_domain_obj(infp_createuser_req->infp_req->infp, arg_domain); /* Check for a valid domain */ - if(infp_createuser_req->infp_req->domain == NULL) { + if (infp_createuser_req->infp_req->domain == NULL) { einval_msg = talloc_strdup(infp_createuser_req, "Invalid domain."); goto einval; } @@ -523,10 +522,9 @@ int infp_users_delete(DBusMessage *message, struct sbus_conn_ctx *sconn) } infp_deleteuser_req->infp_req->domain = - btreemap_get_value(infp_deleteuser_req->infp_req->infp->domain_map, - (const void *)arg_domain); + infp_get_domain_obj(infp_deleteuser_req->infp_req->infp, arg_domain); /* Check for a valid domain */ - if(infp_deleteuser_req->infp_req->domain == NULL) { + if (infp_deleteuser_req->infp_req->domain == NULL) { einval_msg = talloc_strdup(infp_deleteuser_req, "Invalid domain."); goto einval; } @@ -1213,8 +1211,11 @@ int infp_users_get_attr(DBusMessage *message, struct sbus_conn_ctx *sconn) goto end; } - infp_getattr_req->infp_req->domain = btreemap_get_value(infp_getattr_req->infp_req->infp->domain_map, (const void *)domain); - infp_getattr_req->check_provider = strcasecmp(domain, "LOCAL"); + infp_getattr_req->infp_req->domain = + infp_get_domain_obj(infp_getattr_req->infp_req->infp, domain); + if (infp_getattr_req->infp_req->domain->provider) { + infp_getattr_req->check_provider = true; + } /* Copy the username list */ infp_getattr_req->usernames = talloc_array(infp_getattr_req, char *, username_count); @@ -1469,9 +1470,9 @@ int infp_users_set_attr(DBusMessage *message, struct sbus_conn_ctx *sconn) } dbus_message_iter_get_basic(&iter, &domain_name); - infp_setattr_req->infp_req->domain = btreemap_get_value(infp_setattr_req->infp_req->infp->domain_map, - (const void *)domain_name); - if(infp_setattr_req->infp_req->domain == NULL) { + infp_setattr_req->infp_req->domain = + infp_get_domain_obj(infp_setattr_req->infp_req->infp, domain_name); + if (infp_setattr_req->infp_req->domain == NULL) { einval_msg = talloc_strdup(infp_setattr_req, "Invalid domain."); goto einval; } @@ -1770,10 +1771,10 @@ int infp_users_set_uid(DBusMessage *message, struct sbus_conn_ctx *sconn) infp_setuid_req->username = talloc_strdup(infp_setuid_req, arg_username); - infp_setuid_req->infp_req->domain = btreemap_get_value(infp_setuid_req->infp_req->infp->domain_map, - (const void *)arg_domain); + infp_setuid_req->infp_req->domain = + infp_get_domain_obj(infp_setuid_req->infp_req->infp, arg_domain); /* Check for a valid domain */ - if(infp_setuid_req->infp_req->domain == NULL) { + if (infp_setuid_req->infp_req->domain == NULL) { einval_msg = talloc_strdup(infp_setuid_req, "Invalid domain."); goto einval; } |