diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-11 00:18:23 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-13 09:07:04 -0400 |
commit | f16705ecade500f77b525d1a3df0109196c98ee0 (patch) | |
tree | 972b1dba612fa52dd5f9f98b098aa5ad31d2b6f6 /server | |
parent | a89fce4904ecb1169026238a6952d4d6a1995c7f (diff) | |
download | sssd-f16705ecade500f77b525d1a3df0109196c98ee0.tar.gz sssd-f16705ecade500f77b525d1a3df0109196c98ee0.tar.xz sssd-f16705ecade500f77b525d1a3df0109196c98ee0.zip |
Always pass full domain info
Change sysdb to always passwd sss_domain_info, not just the domain name.
This way domain specific options can always be honored at the db level.
Diffstat (limited to 'server')
-rw-r--r-- | server/confdb/confdb.c | 180 | ||||
-rw-r--r-- | server/confdb/confdb.h | 8 | ||||
-rw-r--r-- | server/db/sysdb.h | 16 | ||||
-rw-r--r-- | server/db/sysdb_ops.c | 41 | ||||
-rw-r--r-- | server/infopipe/infopipe_users.c | 4 | ||||
-rw-r--r-- | server/providers/data_provider_be.c | 17 | ||||
-rw-r--r-- | server/providers/dp_backend.h | 2 | ||||
-rw-r--r-- | server/providers/proxy.c | 18 | ||||
-rw-r--r-- | server/responder/pam/pam_LOCAL_domain.c | 2 | ||||
-rw-r--r-- | server/tools/sss_usermod.c | 2 |
10 files changed, 174 insertions, 116 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c index 4256418a6..d3a2a0870 100644 --- a/server/confdb/confdb.c +++ b/server/confdb/confdb.c @@ -838,6 +838,111 @@ int confdb_init(TALLOC_CTX *mem_ctx, return EOK; } +int confdb_get_domain(struct confdb_ctx *cdb, + TALLOC_CTX *mem_ctx, + const char *name, + struct sss_domain_info **_domain) +{ + struct sss_domain_info *domain; + struct ldb_result *res; + TALLOC_CTX *tmp_ctx; + struct ldb_dn *dn; + const char *tmp; + int ret; + + tmp_ctx = talloc_new(mem_ctx); + if (!tmp_ctx) return ENOMEM; + + dn = ldb_dn_new_fmt(tmp_ctx, cdb->ldb, + "cn=%s,%s", name, CONFDB_DOMAIN_BASEDN); + if (!dn) { + ret = ENOMEM; + goto done; + } + + ret = ldb_search(cdb->ldb, tmp_ctx, &res, dn, + LDB_SCOPE_BASE, NULL, NULL); + if (ret != LDB_SUCCESS) { + ret = EIO; + goto done; + } + + if (res->count != 1) { + DEBUG(0, ("Unknown domain [%s]\n", name)); + ret = ENOENT; + goto done; + } + + domain = talloc_zero(mem_ctx, struct sss_domain_info); + + tmp = ldb_msg_find_attr_as_string(res->msgs[0], "cn", NULL); + if (!tmp) { + DEBUG(0, ("Invalid configuration entry, fatal error!\n")); + ret = EINVAL; + goto done; + } + domain->name = talloc_strdup(domain, tmp); + if (!domain->name) { + ret = ENOMEM; + goto done; + } + + tmp = ldb_msg_find_attr_as_string(res->msgs[0], "provider", NULL); + if (tmp) { + domain->provider = talloc_strdup(domain, tmp); + if (!domain->provider) { + ret = ENOMEM; + goto done; + } + } + + domain->timeout = ldb_msg_find_attr_as_int(res->msgs[0], + "timeout", 0); + + /* Determine if this domain can be enumerated */ + domain->enumerate = ldb_msg_find_attr_as_int(res->msgs[0], + "enumerate", 0); + if (domain->enumerate == 0) { + DEBUG(1, ("No enumeration for [%s]!\n", domain->name)); + } + + /* Determine if this is a legacy domain */ + if (ldb_msg_find_attr_as_bool(res->msgs[0], "legacy", 0)) { + domain->legacy = true; + } + + /* Determine if this is domain uses MPG */ + if (ldb_msg_find_attr_as_bool(res->msgs[0], CONFDB_MPG, 0)) { + domain->mpg = true; + } + + /* Determine if user/group names will be Fully Qualified + * in NSS interfaces */ + if (ldb_msg_find_attr_as_bool(res->msgs[0], CONFDB_FQ, 0)) { + domain->fqnames = true; + } + + domain->id_min = ldb_msg_find_attr_as_uint(res->msgs[0], + "minId", SSSD_MIN_ID); + domain->id_max = ldb_msg_find_attr_as_uint(res->msgs[0], + "maxId", 0); + + /* Do we allow to cache credentials */ + if (ldb_msg_find_attr_as_bool(res->msgs[0], "cache-credentials", 0)) { + domain->cache_credentials = true; + } + + if (ldb_msg_find_attr_as_bool(res->msgs[0], "store-legacy-passwords", 0)) { + domain->legacy_passwords = true; + } + + *_domain = domain; + +done: + talloc_free(tmp_ctx); + return ret; +} + int confdb_get_domains(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx, struct sss_domain_info **domains) @@ -895,79 +1000,8 @@ int confdb_get_domains(struct confdb_ctx *cdb, p++; } - dn = ldb_dn_new_fmt(tmp_ctx, cdb->ldb, - "cn=%s,%s", cur, CONFDB_DOMAIN_BASEDN); - if (!dn) { - ret = ENOMEM; - goto done; - } - - ret = ldb_search(cdb->ldb, tmp_ctx, &res, dn, - LDB_SCOPE_BASE, NULL, NULL); - if (ret != LDB_SUCCESS) { - ret = EIO; - goto done; - } - - if (res->count != 1) { - DEBUG(0, ("Unknown domain [%s]\n", cur)); - ret = EINVAL; - goto done; - } - - domain = talloc_zero(mem_ctx, struct sss_domain_info); - - tmp = ldb_msg_find_attr_as_string(res->msgs[0], "cn", NULL); - if (!tmp) { - DEBUG(0, ("Invalid configuration entry, fatal error!\n")); - ret = EINVAL; - goto done; - } - domain->name = talloc_strdup(domain, tmp); - if (!domain->name) { - ret = ENOMEM; - goto done; - } - - tmp = ldb_msg_find_attr_as_string(res->msgs[0], "provider", NULL); - if (tmp) { - domain->provider = talloc_strdup(domain, tmp); - if (!domain->provider) { - ret = ENOMEM; - goto done; - } - } - - domain->timeout = ldb_msg_find_attr_as_int(res->msgs[0], - "timeout", 0); - - /* Determine if this domain can be enumerated */ - domain->enumerate = ldb_msg_find_attr_as_int(res->msgs[0], - "enumerate", 0); - if (domain->enumerate == 0) { - DEBUG(1, ("No enumeration for [%s]!\n", domain->name)); - } - - /* Determine if this is a legacy domain */ - if (ldb_msg_find_attr_as_bool(res->msgs[0], "legacy", 0)) { - domain->legacy = true; - } - - /* Determine if this is domain uses MPG */ - if (ldb_msg_find_attr_as_bool(res->msgs[0], CONFDB_MPG, 0)) { - domain->mpg = true; - } - - /* Determine if user/group names will be Fully Qualified - * in NSS interfaces */ - if (ldb_msg_find_attr_as_bool(res->msgs[0], CONFDB_FQ, 0)) { - domain->fqnames = true; - } - - domain->id_min = ldb_msg_find_attr_as_uint(res->msgs[0], - "minId", SSSD_MIN_ID); - domain->id_max = ldb_msg_find_attr_as_uint(res->msgs[0], - "maxId", 0); + ret = confdb_get_domain(cdb, mem_ctx, cur, &domain); + if (ret) goto done; if (first == NULL) { first = domain; diff --git a/server/confdb/confdb.h b/server/confdb/confdb.h index ae66807ae..fda584c83 100644 --- a/server/confdb/confdb.h +++ b/server/confdb/confdb.h @@ -47,6 +47,9 @@ struct sss_domain_info { uint32_t id_min; uint32_t id_max; + bool cache_credentials; + bool legacy_passwords; + struct sss_domain_info *next; }; @@ -80,6 +83,11 @@ int confdb_init(TALLOC_CTX *mem_ctx, struct confdb_ctx **cdb_ctx, char *confdb_location); +int confdb_get_domain(struct confdb_ctx *cdb, + TALLOC_CTX *mem_ctx, + const char *name, + struct sss_domain_info **domain); + int confdb_get_domains(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx, struct sss_domain_info **domains); diff --git a/server/db/sysdb.h b/server/db/sysdb.h index ec87ec07a..df49bc7bf 100644 --- a/server/db/sysdb.h +++ b/server/db/sysdb.h @@ -258,16 +258,18 @@ int sysdb_delete_entry(struct sysdb_req *sysreq, sysdb_callback_t fn, void *pvt); int sysdb_delete_user_by_uid(struct sysdb_req *sysreq, - const char *domain, uid_t uid, + struct sss_domain_info *domain, + uid_t uid, sysdb_callback_t fn, void *pvt); int sysdb_delete_group_by_gid(struct sysdb_req *sysreq, - const char *domain, gid_t gid, + struct sss_domain_info *domain, + gid_t gid, sysdb_callback_t fn, void *pvt); int sysdb_set_user_attr(struct sysdb_req *sysreq, struct sysdb_ctx *ctx, - const char *domain, + struct sss_domain_info *domain, const char *name, struct sysdb_attrs *attributes, sysdb_callback_t fn, void *ptr); @@ -292,26 +294,26 @@ int sysdb_set_group_gid(struct sysdb_req *sysreq, /* legacy functions for proxy providers */ int sysdb_legacy_store_user(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *name, const char *pwd, uid_t uid, gid_t gid, const char *gecos, const char *homedir, const char *shell, sysdb_callback_t fn, void *pvt); int sysdb_legacy_store_group(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *name, gid_t gid, const char **members, sysdb_callback_t fn, void *pvt); int sysdb_legacy_add_group_member(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *group, const char *member, sysdb_callback_t fn, void *pvt); int sysdb_legacy_remove_group_member(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *group, const char *member, sysdb_callback_t fn, void *pvt); diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c index 955e9ec70..a75c3466d 100644 --- a/server/db/sysdb_ops.c +++ b/server/db/sysdb_ops.c @@ -342,7 +342,8 @@ static int delete_callback(struct ldb_request *req, struct ldb_reply *rep) } int sysdb_delete_user_by_uid(struct sysdb_req *sysreq, - const char *domain, uid_t uid, + struct sss_domain_info *domain, + uid_t uid, sysdb_callback_t fn, void *pvt) { static const char *attrs[] = { SYSDB_NAME, SYSDB_UIDNUM, NULL }; @@ -374,7 +375,8 @@ int sysdb_delete_user_by_uid(struct sysdb_req *sysreq, del_ctx->res = talloc_zero(del_ctx, struct ldb_result); if (!del_ctx->res) return ENOMEM; - base_dn = ldb_dn_new_fmt(del_ctx, ctx->ldb, SYSDB_TMPL_USER_BASE, domain); + base_dn = ldb_dn_new_fmt(del_ctx, ctx->ldb, + SYSDB_TMPL_USER_BASE, domain->name); if (!base_dn) return ENOMEM; filter = talloc_asprintf(del_ctx, SYSDB_PWUID_FILTER, (unsigned long)uid); @@ -397,7 +399,8 @@ int sysdb_delete_user_by_uid(struct sysdb_req *sysreq, } int sysdb_delete_group_by_gid(struct sysdb_req *sysreq, - const char *domain, gid_t gid, + struct sss_domain_info *domain, + gid_t gid, sysdb_callback_t fn, void *pvt) { static const char *attrs[] = { SYSDB_NAME, SYSDB_GIDNUM, NULL }; @@ -429,7 +432,8 @@ int sysdb_delete_group_by_gid(struct sysdb_req *sysreq, del_ctx->res = talloc_zero(del_ctx, struct ldb_result); if (!del_ctx->res) return ENOMEM; - base_dn = ldb_dn_new_fmt(del_ctx, ctx->ldb, SYSDB_TMPL_GROUP_BASE, domain); + base_dn = ldb_dn_new_fmt(del_ctx, ctx->ldb, + SYSDB_TMPL_GROUP_BASE, domain->name); if (!base_dn) return ENOMEM; filter = talloc_asprintf(del_ctx, SYSDB_GRGID_FILTER, (unsigned long)gid); @@ -453,7 +457,7 @@ int sysdb_delete_group_by_gid(struct sysdb_req *sysreq, int sysdb_set_user_attr(struct sysdb_req *sysreq, struct sysdb_ctx *ctx, - const char *domain, + struct sss_domain_info *domain, const char *name, struct sysdb_attrs *attrs, sysdb_callback_t fn, void *pvt) @@ -479,7 +483,7 @@ int sysdb_set_user_attr(struct sysdb_req *sysreq, msg = ldb_msg_new(cbctx); if (!msg) return ENOMEM; - msg->dn = sysdb_user_dn(ctx, msg, domain, name); + msg->dn = sysdb_user_dn(ctx, msg, domain->name, name); if (!msg->dn) return ENOMEM; msg->elements = talloc_array(msg, struct ldb_message_element, attrs->num); @@ -1247,10 +1251,10 @@ int sysdb_set_group_gid(struct sysdb_req *sysreq, struct legacy_user_ctx { struct sysdb_req *sysreq; struct sysdb_cb_ctx *cbctx; + struct sss_domain_info *domain; struct ldb_dn *dn; - const char *domain; const char *name; const char *pwd; uid_t uid; @@ -1266,7 +1270,7 @@ static int legacy_user_callback(struct ldb_request *req, struct ldb_reply *rep); int sysdb_legacy_store_user(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *name, const char *pwd, uid_t uid, gid_t gid, const char *gecos, const char *homedir, const char *shell, @@ -1291,7 +1295,7 @@ int sysdb_legacy_store_user(struct sysdb_req *sysreq, user_ctx->cbctx = talloc_zero(user_ctx, struct sysdb_cb_ctx); if (!user_ctx->cbctx) return ENOMEM; - user_ctx->dn = sysdb_user_dn(ctx, user_ctx, domain, name); + user_ctx->dn = sysdb_user_dn(ctx, user_ctx, domain->name, name); if (!user_ctx->dn) return ENOMEM; user_ctx->sysreq = sysreq; @@ -1403,11 +1407,12 @@ static int legacy_user_callback(struct ldb_request *req, } } - if (user_ctx->pwd && *user_ctx->pwd) { + if (user_ctx->domain->legacy_passwords && + user_ctx->pwd && *user_ctx->pwd) { ret = add_string(msg, flags, SYSDB_PWD, user_ctx->pwd); } else { ret = ldb_msg_add_empty(msg, SYSDB_PWD, - LDB_FLAG_MOD_DELETE, NULL); + LDB_FLAG_MOD_DELETE, NULL); } if (ret != LDB_SUCCESS) { return sysdb_ret_error(cbctx, ENOMEM, LDB_ERR_OPERATIONS_ERROR); @@ -1503,10 +1508,10 @@ static int legacy_user_callback(struct ldb_request *req, struct legacy_group_ctx { struct sysdb_req *sysreq; struct sysdb_cb_ctx *cbctx; + struct sss_domain_info *domain; struct ldb_dn *dn; - const char *domain; const char *name; gid_t gid; const char **members; @@ -1518,7 +1523,7 @@ static int legacy_group_callback(struct ldb_request *req, struct ldb_reply *rep); int sysdb_legacy_store_group(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *name, gid_t gid, const char **members, sysdb_callback_t fn, void *pvt) @@ -1542,7 +1547,7 @@ int sysdb_legacy_store_group(struct sysdb_req *sysreq, group_ctx->cbctx = talloc_zero(group_ctx, struct sysdb_cb_ctx); if (!group_ctx->cbctx) return ENOMEM; - group_ctx->dn = sysdb_group_dn(ctx, group_ctx, domain, name); + group_ctx->dn = sysdb_group_dn(ctx, group_ctx, domain->name, name); if (!group_ctx->dn) return ENOMEM; group_ctx->sysreq = sysreq; @@ -1708,7 +1713,7 @@ static int legacy_group_callback(struct ldb_request *req, } int sysdb_legacy_add_group_member(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *group, const char *member, sysdb_callback_t fn, void *pvt) @@ -1736,7 +1741,7 @@ int sysdb_legacy_add_group_member(struct sysdb_req *sysreq, msg = ldb_msg_new(cbctx); if(msg == NULL) return ENOMEM; - msg->dn = sysdb_group_dn(ctx, cbctx, domain, group); + msg->dn = sysdb_group_dn(ctx, cbctx, domain->name, group); if (!msg->dn) return ENOMEM; ret = add_string(msg, LDB_FLAG_MOD_ADD, SYSDB_LEGACY_MEMBER, member); @@ -1757,7 +1762,7 @@ int sysdb_legacy_add_group_member(struct sysdb_req *sysreq, } int sysdb_legacy_remove_group_member(struct sysdb_req *sysreq, - const char *domain, + struct sss_domain_info *domain, const char *group, const char *member, sysdb_callback_t fn, void *pvt) @@ -1785,7 +1790,7 @@ int sysdb_legacy_remove_group_member(struct sysdb_req *sysreq, msg = ldb_msg_new(cbctx); if(msg == NULL) return ENOMEM; - msg->dn = sysdb_group_dn(ctx, cbctx, domain, group); + msg->dn = sysdb_group_dn(ctx, cbctx, domain->name, group); if (!msg->dn) return ENOMEM; ret = add_string(msg, LDB_FLAG_MOD_DELETE, SYSDB_LEGACY_MEMBER, member); diff --git a/server/infopipe/infopipe_users.c b/server/infopipe/infopipe_users.c index 14037774d..326e32223 100644 --- a/server/infopipe/infopipe_users.c +++ b/server/infopipe/infopipe_users.c @@ -1350,7 +1350,7 @@ static void infp_do_user_set_attr(struct sysdb_req *req, void *pvt) DEBUG(9, ("Setting attributes for user [%s]\n", infp_setattr_req->usernames[infp_setattr_req->index])); ret = sysdb_set_user_attr(infp_setattr_req->sysdb_req, infp_setattr_req->infp_req->infp->sysdb, - infp_setattr_req->infp_req->domain->name, + infp_setattr_req->infp_req->domain, infp_setattr_req->usernames[infp_setattr_req->index], infp_setattr_req->changes[infp_setattr_req->index], infp_do_user_set_attr_callback, infp_setattr_req); @@ -1715,7 +1715,7 @@ static void infp_do_user_set_uid(struct sysdb_req *req, void *pvt) DEBUG(9, ("Setting UID for user [%s]\n", infp_setuid_req->username)); ret = sysdb_set_user_attr(infp_setuid_req->sysdb_req, infp_setuid_req->infp_req->infp->sysdb, - infp_setuid_req->infp_req->domain->name, + infp_setuid_req->infp_req->domain, infp_setuid_req->username, infp_setuid_req->uid_attr, infp_do_user_set_uid_callback, infp_setuid_req); diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index 61844bbe0..796ab5323 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -141,7 +141,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) if (!ctx) return EINVAL; DEBUG(4,("Sending ID reply: (%d,%d,%s,%s)\n", - clitype, version, ctx->name, ctx->domain)); + clitype, version, ctx->name, ctx->domain->name)); reply = dbus_message_new_method_return(message); if (!reply) return ENOMEM; @@ -150,7 +150,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) DBUS_TYPE_UINT16, &clitype, DBUS_TYPE_UINT16, &version, DBUS_TYPE_STRING, &ctx->name, - DBUS_TYPE_STRING, &ctx->domain, + DBUS_TYPE_STRING, &ctx->domain->name, DBUS_TYPE_INVALID); if (!ret) { dbus_message_unref(reply); @@ -599,10 +599,10 @@ done: talloc_free(be_req); } - DEBUG(4, ("Sending result [%d][%s]\n", pam_status, ctx->domain)); + DEBUG(4, ("Sending result [%d][%s]\n", pam_status, ctx->domain->name)); ret = dbus_message_append_args(reply, DBUS_TYPE_UINT32, &pam_status, - DBUS_TYPE_STRING, &ctx->domain, + DBUS_TYPE_STRING, &ctx->domain->name, DBUS_TYPE_INVALID); if (!ret) return EIO; @@ -948,14 +948,19 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->ev = ev; ctx->cdb = cdb; ctx->name = talloc_strdup(ctx, be_name); - ctx->domain = talloc_strdup(ctx, be_domain); ctx->identity = talloc_asprintf(ctx, "%%BE_%s", be_domain); ctx->conf_path = talloc_asprintf(ctx, "config/domains/%s", be_domain); - if (!ctx->name || !ctx->domain || !ctx->identity || !ctx->conf_path) { + if (!ctx->name || !ctx->identity || !ctx->conf_path) { DEBUG(0, ("Out of memory!?\n")); return ENOMEM; } + ret = confdb_get_domain(cdb, ctx, be_domain, &ctx->domain); + if (ret != EOK) { + DEBUG(0, ("fatal error retrieving domain configuration\n")); + return ret; + } + ret = sysdb_init(ctx, ev, cdb, NULL, &ctx->sysdb); if (ret != EOK) { DEBUG(0, ("fatal error opening cache database\n")); diff --git a/server/providers/dp_backend.h b/server/providers/dp_backend.h index 2d1cd83e9..da71e753c 100644 --- a/server/providers/dp_backend.h +++ b/server/providers/dp_backend.h @@ -43,8 +43,8 @@ struct be_ctx { struct sysdb_ctx *sysdb; struct service_sbus_ctx *ss_ctx; struct service_sbus_ctx *dp_ctx; + struct sss_domain_info *domain; const char *name; - const char *domain; const char *identity; const char *conf_path; diff --git a/server/providers/proxy.c b/server/providers/proxy.c index 1b4a83002..907f044e3 100644 --- a/server/providers/proxy.c +++ b/server/providers/proxy.c @@ -308,7 +308,7 @@ static void get_pw_name(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); @@ -376,8 +376,10 @@ static void get_pw_uid(struct be_req *req, uid_t uid) /* FIXME: verify user does not have gid=0 as these are invalid values */ if (data->pwd->pw_gid == 0) { data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, data->pwd->pw_name); - ret = sysdb_transaction(data, req->be_ctx->sysdb, del_db_entry, data); + req->be_ctx->domain->name, + data->pwd->pw_name); + ret = sysdb_transaction(data, req->be_ctx->sysdb, + del_db_entry, data); break; } @@ -580,7 +582,7 @@ static void get_gr_name(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_group_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); @@ -647,8 +649,10 @@ static void get_gr_gid(struct be_req *req, gid_t gid) /* FIXME: verify group does not have gid=0 as this is invalid */ if (data->grp->gr_gid == 0) { data->dn = sysdb_group_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, data->grp->gr_name); - ret = sysdb_transaction(data, req->be_ctx->sysdb, del_db_entry, data); + req->be_ctx->domain->name, + data->grp->gr_name); + ret = sysdb_transaction(data, req->be_ctx->sysdb, + del_db_entry, data); break; } @@ -952,7 +956,7 @@ static void get_initgr_user(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); diff --git a/server/responder/pam/pam_LOCAL_domain.c b/server/responder/pam/pam_LOCAL_domain.c index 28a95db8d..7ee84eb6a 100644 --- a/server/responder/pam/pam_LOCAL_domain.c +++ b/server/responder/pam/pam_LOCAL_domain.c @@ -93,7 +93,7 @@ static void set_user_attr_req(struct sysdb_req *req, void *pvt) lreq->sysdb_req = req; - ret = sysdb_set_user_attr(req, lreq->dbctx, lreq->domain_info->name, + ret = sysdb_set_user_attr(req, lreq->dbctx, lreq->domain_info, lreq->pd->user, lreq->mod_attrs, set_user_attr_callback, lreq); if (ret != EOK) diff --git a/server/tools/sss_usermod.c b/server/tools/sss_usermod.c index dae584e2e..fd2456104 100644 --- a/server/tools/sss_usermod.c +++ b/server/tools/sss_usermod.c @@ -87,7 +87,7 @@ static void mod_user(struct sysdb_req *req, void *pvt) } else { ret = sysdb_set_user_attr(req, sysdb_req_get_ctx(req), - user_ctx->domain->name, + user_ctx->domain, user_ctx->username, user_ctx->attrs, add_to_groups, |