summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
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 e9d918e49..eff4e2969 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 e8e5de466..b18d505b4 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 693263099..d443fcd80 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 97817d88b..29d531ed8 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_ */