summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-05 00:20:44 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-04-18 10:23:56 -0400
commiteb29ae58117ca88868491fe2240e27393c7a9068 (patch)
treeca653d80603b04c95e85a015943e654457b61259 /src/db
parentdc2750954d694eeef46ec9bf31c7f675b2b1fb27 (diff)
downloadsssd-eb29ae58117ca88868491fe2240e27393c7a9068.tar.gz
sssd-eb29ae58117ca88868491fe2240e27393c7a9068.tar.bz2
sssd-eb29ae58117ca88868491fe2240e27393c7a9068.zip
Add sysdb_set_service_attr and sysdb_set_autofsmap_attr
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_autofs.c28
-rw-r--r--src/db/sysdb_autofs.h6
-rw-r--r--src/db/sysdb_services.c28
-rw-r--r--src/db/sysdb_services.h6
4 files changed, 68 insertions, 0 deletions
diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c
index e9d918e4..eff4e296 100644
--- a/src/db/sysdb_autofs.c
+++ b/src/db/sysdb_autofs.c
@@ -396,3 +396,31 @@ done:
talloc_free(tmp_ctx);
return ret;
}
+
+errno_t
+sysdb_set_autofsmap_attr(struct sysdb_ctx *sysdb,
+ const char *name,
+ struct sysdb_attrs *attrs,
+ int mod_op)
+{
+ errno_t ret;
+ struct ldb_dn *dn;
+ TALLOC_CTX *tmp_ctx;
+
+ tmp_ctx = talloc_new(NULL);
+ if (!tmp_ctx) {
+ return ENOMEM;
+ }
+
+ dn = sysdb_autofsmap_dn(tmp_ctx, sysdb, name);
+ if (!dn) {
+ ret = ENOMEM;
+ goto done;
+ }
+
+ ret = sysdb_set_entry_attr(sysdb, dn, attrs, mod_op);
+
+done:
+ talloc_free(tmp_ctx);
+ return ret;
+}
diff --git a/src/db/sysdb_autofs.h b/src/db/sysdb_autofs.h
index e8e5de46..b18d505b 100644
--- a/src/db/sysdb_autofs.h
+++ b/src/db/sysdb_autofs.h
@@ -85,4 +85,10 @@ sysdb_autofs_map_update_members(struct sysdb_ctx *sysdb,
const char *const *add_entries,
const char *const *del_entries);
+errno_t
+sysdb_set_autofsmap_attr(struct sysdb_ctx *sysdb,
+ const char *name,
+ struct sysdb_attrs *attrs,
+ int mod_op);
+
#endif /* _SYSDB_AUTOFS_H_ */
diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c
index 69326309..d443fcd8 100644
--- a/src/db/sysdb_services.c
+++ b/src/db/sysdb_services.c
@@ -759,3 +759,31 @@ done:
talloc_free(tmp_ctx);
return ret;
}
+
+errno_t
+sysdb_set_service_attr(struct sysdb_ctx *sysdb,
+ const char *name,
+ struct sysdb_attrs *attrs,
+ int mod_op)
+{
+ errno_t ret;
+ struct ldb_dn *dn;
+ TALLOC_CTX *tmp_ctx;
+
+ tmp_ctx = talloc_new(NULL);
+ if (!tmp_ctx) {
+ return ENOMEM;
+ }
+
+ dn = sysdb_svc_dn(sysdb, tmp_ctx, sysdb->domain->name, name);
+ if (!dn) {
+ ret = ENOMEM;
+ goto done;
+ }
+
+ ret = sysdb_set_entry_attr(sysdb, dn, attrs, mod_op);
+
+done:
+ talloc_free(tmp_ctx);
+ return ret;
+}
diff --git a/src/db/sysdb_services.h b/src/db/sysdb_services.h
index 97817d88..29d531ed 100644
--- a/src/db/sysdb_services.h
+++ b/src/db/sysdb_services.h
@@ -85,4 +85,10 @@ sysdb_svc_delete(struct sysdb_ctx *sysdb,
int port,
const char *proto);
+errno_t
+sysdb_set_service_attr(struct sysdb_ctx *sysdb,
+ const char *name,
+ struct sysdb_attrs *attrs,
+ int mod_op);
+
#endif /* SYSDB_SERVICES_H_ */