summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-08 00:35:05 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:53:02 +0100
commit2913240aee51ce81195148a4d814e967f66839c4 (patch)
tree271176b5688f86df6c3fb60a3596c28dfd7ee187 /src/providers
parent043bda72889e9ef0c48b80b21c99e9e18c5f49d7 (diff)
downloadsssd-2913240aee51ce81195148a4d814e967f66839c4.tar.gz
sssd-2913240aee51ce81195148a4d814e967f66839c4.tar.bz2
sssd-2913240aee51ce81195148a4d814e967f66839c4.zip
Add domain argument to sysdb autofs functions
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap_async_autofs.c23
-rw-r--r--src/providers/ldap/sdap_autofs.c6
2 files changed, 18 insertions, 11 deletions
diff --git a/src/providers/ldap/sdap_async_autofs.c b/src/providers/ldap/sdap_async_autofs.c
index fdffd1d5..6306991e 100644
--- a/src/providers/ldap/sdap_async_autofs.c
+++ b/src/providers/ldap/sdap_async_autofs.c
@@ -66,6 +66,7 @@ get_autofs_entry_key(struct sysdb_attrs *entry, struct sdap_options *opts)
static errno_t
mod_autofs_entry(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *map,
struct sdap_options *opts,
struct sysdb_attrs *entry,
@@ -88,10 +89,10 @@ mod_autofs_entry(struct sysdb_ctx *sysdb,
switch (mod_op) {
case AUTOFS_MAP_OP_ADD:
- ret = sysdb_save_autofsentry(sysdb, map, key, value, NULL);
+ ret = sysdb_save_autofsentry(sysdb, domain, map, key, value, NULL);
break;
case AUTOFS_MAP_OP_DEL:
- ret = sysdb_del_autofsentry(sysdb, map, key, value);
+ ret = sysdb_del_autofsentry(sysdb, domain, map, key, value);
break;
}
@@ -100,6 +101,7 @@ mod_autofs_entry(struct sysdb_ctx *sysdb,
static errno_t
mod_autofs_entries(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sdap_options *opts,
const char *map,
char **mod_entries,
@@ -139,7 +141,7 @@ mod_autofs_entries(struct sysdb_ctx *sysdb,
continue;
}
- ret = mod_autofs_entry(sysdb, map, opts, entries[j], mod_op);
+ ret = mod_autofs_entry(sysdb, domain, map, opts, entries[j], mod_op);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
("Cannot modify autofs entry [%d]: %s. Ignoring.\n",
@@ -173,25 +175,27 @@ done:
static errno_t
save_autofs_entries(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sdap_options *opts,
const char *map,
char **add_entries,
struct sysdb_attrs **entries,
size_t num_entries)
{
- return mod_autofs_entries(sysdb, opts, map, add_entries,
+ return mod_autofs_entries(sysdb, domain, opts, map, add_entries,
entries, num_entries, AUTOFS_MAP_OP_ADD);
}
static errno_t
del_autofs_entries(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct sdap_options *opts,
const char *map,
char **add_entries,
struct sysdb_attrs **entries,
size_t num_entries)
{
- return mod_autofs_entries(sysdb, opts, map, add_entries,
+ return mod_autofs_entries(sysdb, domain, opts, map, add_entries,
entries, num_entries, AUTOFS_MAP_OP_DEL);
}
@@ -210,7 +214,7 @@ save_autofs_map(struct sysdb_ctx *sysdb,
now = time(NULL);
- ret = sysdb_save_autofsmap(sysdb, mapname, mapname,
+ ret = sysdb_save_autofsmap(sysdb, dom, mapname, mapname,
NULL, dom->autofsmap_timeout, now);
if (ret != EOK) {
return ret;
@@ -826,7 +830,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
}
}
- ret = sysdb_autofs_entries_by_map(tmp_ctx, state->sysdb, state->mapname,
+ ret = sysdb_autofs_entries_by_map(tmp_ctx, state->sysdb,
+ state->dom, state->mapname,
&count, &entries);
if (ret != EOK && ret != ENOENT) {
DEBUG(SSSDBG_OP_FAILURE,
@@ -890,7 +895,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
/* Create entries that don't exist yet */
if (add_entries && add_entries[0]) {
- ret = save_autofs_entries(state->sysdb, state->opts,
+ ret = save_autofs_entries(state->sysdb, state->dom, state->opts,
state->mapname, add_entries,
state->entries, state->entries_count);
if (ret != EOK) {
@@ -910,7 +915,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
goto done;
}
- ret = del_autofs_entries(state->sysdb, state->opts,
+ ret = del_autofs_entries(state->sysdb, state->dom, state->opts,
state->mapname, del_entries,
entries_attrs, count);
if (ret != EOK) {
diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c
index 7e6f3ecf..97b9f3ed 100644
--- a/src/providers/ldap/sdap_autofs.c
+++ b/src/providers/ldap/sdap_autofs.c
@@ -98,7 +98,8 @@ void sdap_autofs_handler(struct be_req *be_req)
autofs_req->mapname ? autofs_req->mapname : "<ALL>\n"));
if (autofs_req->invalidate) {
- ret = sysdb_invalidate_autofs_maps(id_ctx->be->sysdb);
+ ret = sysdb_invalidate_autofs_maps(id_ctx->be->sysdb,
+ id_ctx->be->domain);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE, ("Could not invalidate autofs maps, "
"backend might return stale entries\n"));
@@ -256,7 +257,8 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
}
if (ret == ENOENT) {
- ret = sysdb_delete_autofsmap(state->ctx->be->sysdb, state->map_name);
+ ret = sysdb_delete_autofsmap(state->ctx->be->sysdb,
+ state->ctx->be->domain, state->map_name);
if (ret != EOK && ret != ENOENT) {
DEBUG(SSSDBG_OP_FAILURE,
("Cannot delete autofs map %s [%d]: %s\n",