From aa80e585f843b754b6c0b4945472ebd6cfab0cf3 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 20 Aug 2009 14:02:26 +0200 Subject: store additional LDAP attributes If available the original DN and the user principle will be stored in sysdb. --- server/db/sysdb.h | 13 +++++++++++++ server/db/sysdb_ops.c | 23 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'server/db') diff --git a/server/db/sysdb.h b/server/db/sysdb.h index ac19dcc6..64a07fe7 100644 --- a/server/db/sysdb.h +++ b/server/db/sysdb.h @@ -450,6 +450,19 @@ struct tevent_req *sysdb_store_user_send(TALLOC_CTX *mem_ctx, const char *shell); int sysdb_store_user_recv(struct tevent_req *req); +struct tevent_req *sysdb_store_user_with_attrs_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct sysdb_handle *handle, + 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, + struct sysdb_attrs *attrs); +int sysdb_store_user_with_attrs_recv(struct tevent_req *req); + struct tevent_req *sysdb_store_group_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct sysdb_handle *handle, diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c index e62711a2..2853ba1e 100644 --- a/server/db/sysdb_ops.c +++ b/server/db/sysdb_ops.c @@ -2495,6 +2495,23 @@ struct tevent_req *sysdb_store_user_send(TALLOC_CTX *mem_ctx, const char *gecos, const char *homedir, const char *shell) +{ + return sysdb_store_user_with_attrs_send(mem_ctx, ev, handle, domain, + name, pwd, uid, gid, gecos, + homedir, shell, NULL); +} + +struct tevent_req *sysdb_store_user_with_attrs_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct sysdb_handle *handle, + 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, + struct sysdb_attrs *attrs) { struct tevent_req *req, *subreq; struct sysdb_store_user_state *state; @@ -2512,7 +2529,7 @@ struct tevent_req *sysdb_store_user_send(TALLOC_CTX *mem_ctx, state->gecos = gecos; state->homedir = homedir; state->shell = shell; - state->attrs = NULL; + state->attrs = attrs; if (pwd && (domain->legacy_passwords || !*pwd)) { ret = sysdb_attrs_add_string(state->attrs, SYSDB_PWD, pwd); @@ -2677,6 +2694,10 @@ int sysdb_store_user_recv(struct tevent_req *req) return sysdb_op_default_recv(req); } +int sysdb_store_user_with_attrs_recv(struct tevent_req *req) +{ + return sysdb_op_default_recv(req); +} /* =Store-Group-(Native/Legacy)-(replaces-existing-data)================== */ -- cgit