summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-07 20:03:33 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:53:01 +0100
commit6ac396bebb4cd3124711d26dce54263f6f9c7c45 (patch)
treec497a634c0e14ab3c55469f3669b1a0f9d5f3fc3 /src/db
parentb7427d63bd328be32991f9d437c4a3d46bcabe03 (diff)
downloadsssd-6ac396bebb4cd3124711d26dce54263f6f9c7c45.tar.gz
sssd-6ac396bebb4cd3124711d26dce54263f6f9c7c45.tar.xz
sssd-6ac396bebb4cd3124711d26dce54263f6f9c7c45.zip
Add domain argument to sysdb_store_user()
Also remove sysdb_store_domuser()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h12
-rw-r--r--src/db/sysdb_ops.c12
-rw-r--r--src/db/sysdb_subdomains.c18
3 files changed, 7 insertions, 35 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 392746c8d..4e11fbe56 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -385,17 +385,6 @@ errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
struct sysdb_subdom *domain_info);
-errno_t sysdb_store_domuser(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,
- char **remove_attrs,
- uint64_t cache_timeout,
- time_t now);
errno_t sysdb_delete_domuser(struct sss_domain_info *domain,
const char *name, uid_t uid);
@@ -662,6 +651,7 @@ int sysdb_mod_group_member(struct sysdb_ctx *sysdb,
int mod_op);
int sysdb_store_user(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
const char *pwd,
uid_t uid, gid_t gid,
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 0b6951a64..61a0e77d9 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1610,6 +1610,7 @@ done:
* this will just remove it */
int sysdb_store_user(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
const char *pwd,
uid_t uid, gid_t gid,
@@ -1641,7 +1642,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
}
}
- if (pwd && (sysdb->domain->legacy_passwords || !*pwd)) {
+ if (pwd && (domain->legacy_passwords || !*pwd)) {
ret = sysdb_attrs_add_string(attrs, SYSDB_PWD, pwd);
if (ret) goto fail;
}
@@ -1654,8 +1655,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
in_transaction = true;
- ret = sysdb_search_user_by_name(tmp_ctx, sysdb, sysdb->domain,
- name, NULL, &msg);
+ ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, name, NULL, &msg);
if (ret && ret != ENOENT) {
goto fail;
}
@@ -1667,7 +1667,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
if (ret == ENOENT) {
/* users doesn't exist, turn into adding a user */
- ret = sysdb_add_user(sysdb, sysdb->domain, name, uid, gid, gecos, homedir,
+ ret = sysdb_add_user(sysdb, domain, name, uid, gid, gecos, homedir,
shell, orig_dn, attrs, cache_timeout, now);
if (ret == EEXIST) {
/* This may be a user rename. If there is a user with the
@@ -1686,7 +1686,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
DEBUG(SSSDBG_MINOR_FAILURE,
("A user with the same UID [%llu] was removed from the "
"cache\n", (unsigned long long) uid));
- ret = sysdb_add_user(sysdb, sysdb->domain, name, uid, gid, gecos, homedir,
+ ret = sysdb_add_user(sysdb, domain, name, uid, gid, gecos, homedir,
shell, orig_dn, attrs, cache_timeout, now);
}
@@ -1738,7 +1738,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
(now + cache_timeout) : 0));
if (ret) goto fail;
- ret = sysdb_set_user_attr(sysdb, sysdb->domain, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_user_attr(sysdb, domain, name, attrs, SYSDB_MOD_REP);
if (ret != EOK) goto fail;
if (remove_attrs) {
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index ef6b0ad34..4a81b1dfb 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -577,24 +577,6 @@ errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx,
} \
} while(0)
-errno_t sysdb_store_domuser(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,
- char **remove_attrs,
- uint64_t cache_timeout,
- time_t now)
-{
- CHECK_DOMAIN_INFO(domain);
-
- return sysdb_store_user(domain->sysdb, name, pwd, uid, gid, gecos, homedir,
- shell, NULL, attrs, remove_attrs, cache_timeout, now);
-}
-
errno_t sysdb_delete_domuser(struct sss_domain_info *domain,
const char *name, uid_t uid)
{