diff options
author | Sumit Bose <sbose@redhat.com> | 2009-08-20 14:02:26 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-08-21 12:55:44 -0400 |
commit | aa80e585f843b754b6c0b4945472ebd6cfab0cf3 (patch) | |
tree | 56975d8c80fd6d353625655aa6333586c8294ebf /server/db | |
parent | c1410419224a504954791dbfd36fd19ad78cfb65 (diff) | |
download | sssd-aa80e585f843b754b6c0b4945472ebd6cfab0cf3.tar.gz sssd-aa80e585f843b754b6c0b4945472ebd6cfab0cf3.tar.bz2 sssd-aa80e585f843b754b6c0b4945472ebd6cfab0cf3.zip |
store additional LDAP attributes
If available the original DN and the user principle will be stored
in sysdb.
Diffstat (limited to 'server/db')
-rw-r--r-- | server/db/sysdb.h | 13 | ||||
-rw-r--r-- | server/db/sysdb_ops.c | 23 |
2 files changed, 35 insertions, 1 deletions
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 @@ -2496,6 +2496,23 @@ struct tevent_req *sysdb_store_user_send(TALLOC_CTX *mem_ctx, 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; int ret; @@ -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)================== */ |