diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-03-02 18:44:44 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-03-03 15:05:03 -0500 |
commit | 71eacad35be73dc30d56d3cffa9785a533d25fc8 (patch) | |
tree | 7c76ef592834466f8500cb2f77a175c2dfc946bc /server/db/sysdb.h | |
parent | 0ddf276c9f45b3c6eb48c8074eef0113c5ebf6a9 (diff) | |
download | sssd-71eacad35be73dc30d56d3cffa9785a533d25fc8.tar.gz sssd-71eacad35be73dc30d56d3cffa9785a533d25fc8.tar.xz sssd-71eacad35be73dc30d56d3cffa9785a533d25fc8.zip |
Provide sysdb_set_user_attr() functions.
Provide also helper functions to build struct sysdb_attrs.
Also fix sysdb_get_user_attr() to have a consistent interface
as all other functions.
Diffstat (limited to 'server/db/sysdb.h')
-rw-r--r-- | server/db/sysdb.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/server/db/sysdb.h b/server/db/sysdb.h index 498ad09bf..add922e6b 100644 --- a/server/db/sysdb.h +++ b/server/db/sysdb.h @@ -111,6 +111,11 @@ struct confdb_ctx; struct sysdb_ctx; struct sysdb_req; +struct sysdb_attrs { + int num; + struct ldb_message_element *a; +}; + typedef void (*sysdb_callback_t)(void *, int, struct ldb_result *); typedef void (*sysdb_req_fn_t)(struct sysdb_req *, void *pvt); @@ -166,11 +171,13 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx, const char *name, bool legacy, sysdb_callback_t fn, void *ptr); + int sysdb_get_user_attr(TALLOC_CTX *mem_ctx, struct sysdb_ctx *ctx, - struct sss_domain_info *domain, + const char *domain, const char *name, const char **attributes, + bool legacy, sysdb_callback_t fn, void *ptr); struct ldb_context *sysdb_ctx_get_ldb(struct sysdb_ctx *ctx); @@ -215,6 +222,19 @@ int sysdb_delete_group_by_gid(struct sysdb_req *sysreq, const char *domain, gid_t gid, sysdb_callback_t fn, void *pvt); +struct sysdb_attrs *sysdb_new_attrs(TALLOC_CTX *memctx); +int sysdb_attrs_add_val(struct sysdb_attrs *attrs, + const char *name, const struct ldb_val *val); +int sysdb_attrs_add_string(struct sysdb_attrs *attrs, + const char *name, const char *str); + +int sysdb_set_user_attr(struct sysdb_req *sysreq, + struct sysdb_ctx *ctx, + const char *domain, + const char *name, + struct sysdb_attrs *attributes, + sysdb_callback_t fn, void *ptr); + /* legacy functions for proxy providers */ int sysdb_legacy_store_user(struct sysdb_req *sysreq, |