summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-08-03 15:28:32 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-08-06 18:14:00 +0200
commitd3d297c62e0340151da1d4ce1e082dcfcb45b431 (patch)
treeeaad8c7377b8fa9bf80b9b7b874d30ca8b3529a4
parentb1a8ecc98c0f588f86b98d9c0c5751225ce9aaa9 (diff)
downloadsssd-d3d297c62e0340151da1d4ce1e082dcfcb45b431.tar.gz
sssd-d3d297c62e0340151da1d4ce1e082dcfcb45b431.tar.bz2
sssd-d3d297c62e0340151da1d4ce1e082dcfcb45b431.zip
SYSDB: Use ldb_msg_add_string for simple string additions
-rw-r--r--src/db/sysdb.c8
-rw-r--r--src/db/sysdb_ops.c12
-rw-r--r--src/db/sysdb_services.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 3ef8444c..2790d28f 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -827,7 +827,7 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name)
ret = ENOMEM;
goto done;
}
- ret = ldb_msg_add_fmt(msg, "cn", "%s", domain_name);
+ ret = ldb_msg_add_string(msg, "cn", domain_name);
if (ret != LDB_SUCCESS) {
ret = EIO;
goto done;
@@ -857,7 +857,7 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name)
ret = ENOMEM;
goto done;
}
- ret = ldb_msg_add_fmt(msg, "cn", "Users");
+ ret = ldb_msg_add_string(msg, "cn", "Users");
if (ret != LDB_SUCCESS) {
ret = EIO;
goto done;
@@ -887,7 +887,7 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name)
ret = ENOMEM;
goto done;
}
- ret = ldb_msg_add_fmt(msg, "cn", "Groups");
+ ret = ldb_msg_add_string(msg, "cn", "Groups");
if (ret != LDB_SUCCESS) {
ret = EIO;
goto done;
@@ -1549,7 +1549,7 @@ errno_t sysdb_set_bool(struct sysdb_ctx *sysdb,
}
}
- lret = ldb_msg_add_fmt(msg, attr_name, "%s", value ? "TRUE" : "FALSE");
+ lret = ldb_msg_add_string(msg, attr_name, value ? "TRUE" : "FALSE");
if (lret != LDB_SUCCESS) {
ret = sysdb_error_to_errno(lret);
goto done;
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 123230fe..ed7b37e3 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1051,7 +1051,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
ERROR_OUT(ret, ENOMEM, done);
}
- ret = ldb_msg_add_fmt(msg, SYSDB_MEMBER, "%s", userdn);
+ ret = ldb_msg_add_string(msg, SYSDB_MEMBER, userdn);
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, EINVAL, done);
}
@@ -1060,14 +1060,14 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, ENOMEM, done);
}
- ret = ldb_msg_add_fmt(msg, SYSDB_GHOST, "%s", name);
+ ret = ldb_msg_add_string(msg, SYSDB_GHOST, name);
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, EINVAL, done);
}
/* Delete aliases from the ghost attribute as well */
for (j = 0; j < alias_el->num_values; j++) {
- ret = ldb_msg_add_fmt(msg, SYSDB_GHOST, "%s",
- (char *)alias_el->values[j].data);
+ ret = ldb_msg_add_string(msg, SYSDB_GHOST,
+ (char *) alias_el->values[j].data);
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, EINVAL, done);
}
@@ -1345,7 +1345,7 @@ int sysdb_mod_group_member(struct sysdb_ctx *sysdb,
ERROR_OUT(ret, EINVAL, fail);
}
- ret = ldb_msg_add_fmt(msg, SYSDB_MEMBER, "%s", dn);
+ ret = ldb_msg_add_string(msg, SYSDB_MEMBER, dn);
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, EINVAL, fail);
}
@@ -2351,7 +2351,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb,
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, ENOMEM, fail);
}
- ret = ldb_msg_add_fmt(msg, SYSDB_GHOST, "%s", name);
+ ret = ldb_msg_add_string(msg, SYSDB_GHOST, name);
if (ret != LDB_SUCCESS) {
ERROR_OUT(ret, EINVAL, fail);
}
diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c
index d443fcd8..9a5e57a0 100644
--- a/src/db/sysdb_services.c
+++ b/src/db/sysdb_services.c
@@ -574,7 +574,7 @@ sysdb_svc_update(struct sysdb_ctx *sysdb,
}
for (i = 0; aliases[i]; i++) {
- lret = ldb_msg_add_fmt(msg, SYSDB_NAME_ALIAS, "%s", aliases[i]);
+ lret = ldb_msg_add_string(msg, SYSDB_NAME_ALIAS, aliases[i]);
if (lret != LDB_SUCCESS) {
ret = EINVAL;
goto done;
@@ -590,7 +590,7 @@ sysdb_svc_update(struct sysdb_ctx *sysdb,
}
for (i = 0; protocols[i]; i++) {
- lret = ldb_msg_add_fmt(msg, SYSDB_SVC_PROTO, "%s", protocols[i]);
+ lret = ldb_msg_add_string(msg, SYSDB_SVC_PROTO, protocols[i]);
if (lret != LDB_SUCCESS) {
ret = EINVAL;
goto done;