summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-07 17:09:16 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit3f94d6718d44185137e13b6d326dfd63e8dc61c6 (patch)
tree575f6c8f1e169b326fabceda2622e370794d2bb0 /src/db
parente6f266656ead48452673389835125db7a1a34baf (diff)
downloadsssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.tar.gz
sssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.tar.bz2
sssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.zip
Add domain argument to sysdb_set_user_attr()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h1
-rw-r--r--src/db/sysdb_ops.c16
2 files changed, 11 insertions, 6 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 739842df..2b514ddc 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -575,6 +575,7 @@ int sysdb_set_entry_attr(struct sysdb_ctx *sysdb,
/* Replace user attrs */
int sysdb_set_user_attr(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
struct sysdb_attrs *attrs,
int mod_op);
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 013d073b..fba10277 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -549,6 +549,7 @@ done:
/* =Replace-Attributes-On-User============================================ */
int sysdb_set_user_attr(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
struct sysdb_attrs *attrs,
int mod_op)
@@ -562,7 +563,7 @@ int sysdb_set_user_attr(struct sysdb_ctx *sysdb,
return ENOMEM;
}
- dn = sysdb_user_dn(sysdb, tmp_ctx, sysdb->domain, name);
+ dn = sysdb_user_dn(sysdb, tmp_ctx, domain, name);
if (!dn) {
ret = ENOMEM;
goto done;
@@ -1162,7 +1163,8 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
if (ret) goto done;
}
- ret = sysdb_set_user_attr(sysdb, name, id_attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_user_attr(sysdb, domain, name,
+ id_attrs, SYSDB_MOD_REP);
goto done;
}
@@ -1186,7 +1188,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
(now + cache_timeout) : 0));
if (ret) goto done;
- ret = sysdb_set_user_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_user_attr(sysdb, domain, name, attrs, SYSDB_MOD_REP);
if (ret) goto done;
/* remove all ghost users */
@@ -1729,7 +1731,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
(now + cache_timeout) : 0));
if (ret) goto fail;
- ret = sysdb_set_user_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_user_attr(sysdb, sysdb->domain, name, attrs, SYSDB_MOD_REP);
if (ret != EOK) goto fail;
if (remove_attrs) {
@@ -1971,7 +1973,8 @@ int sysdb_cache_password(struct sysdb_ctx *sysdb,
if (ret) goto fail;
- ret = sysdb_set_user_attr(sysdb, username, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_user_attr(sysdb, sysdb->domain,
+ username, attrs, SYSDB_MOD_REP);
if (ret) {
goto fail;
}
@@ -2936,7 +2939,8 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb,
}
}
- ret = sysdb_set_user_attr(sysdb, name, update_attrs, LDB_FLAG_MOD_REPLACE);
+ ret = sysdb_set_user_attr(sysdb, sysdb->domain,
+ name, update_attrs, LDB_FLAG_MOD_REPLACE);
if (ret) {
DEBUG(1, ("Failed to update Login attempt information!\n"));
}