summaryrefslogtreecommitdiffstats
path: root/src/confdb/confdb.h
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2014-07-15 12:00:36 -0400
committerJakub Hrozek <jhrozek@redhat.com>2014-07-29 14:51:52 +0200
commit5328aaeea84268b6d4e26cd33a2b3e8ea89bc349 (patch)
tree791be8f41958c2b5d1f20613be72b338abb5016a /src/confdb/confdb.h
parent1b72f6377e997bbadabad9e5e43998dddfe38156 (diff)
downloadsssd-5328aaeea84268b6d4e26cd33a2b3e8ea89bc349.tar.gz
sssd-5328aaeea84268b6d4e26cd33a2b3e8ea89bc349.tar.xz
sssd-5328aaeea84268b6d4e26cd33a2b3e8ea89bc349.zip
Add function confdb_set_string.
Part of fix for: https://fedorahosted.org/sssd/ticket/2367 Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/confdb/confdb.h')
-rw-r--r--src/confdb/confdb.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 4ac69ebef..014903c4b 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -461,6 +461,28 @@ int confdb_set_bool(struct confdb_ctx *cdb,
bool val);
/**
+ * @brief Convenience function to set a single-valued attribute as a string
+ *
+ * @param[in] cdb The connection object to the confdb
+ * @param[in] section The ConfDB section to update. This is constructed from
+ * the format of the sssd.conf file. All sections start
+ * with 'config/'. Subsections are separated by slashes.
+ * e.g. [domain/LDAP] in sssd.conf would translate to
+ * config/domain/LDAP
+ * @param[in] attribute The name of the attribute to update
+ * @param[in] val New value of the attribute.
+ *
+ * @return 0 - Successfully retrieved the entry (or used the default)
+ * @return ENOMEM - There was insufficient memory to complete the operation
+ * @return EINVAL - The section could not be parsed
+ * @return EIO - An I/O error occurred while communicating with the ConfDB
+ */
+int confdb_set_string(struct confdb_ctx *cdb,
+ const char *section,
+ const char *attribute,
+ char *val);
+
+/**
* @brief Convenience function to retrieve a single-valued attribute as a
* null-terminated array of strings
*