Blob Blame History Raw
From 9317afc8bb7eec656444fc2eecfcd1ea3bfdda82 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 15 Mar 2017 12:43:03 -0400
Subject: [PATCH] Fix errors with -Werror=format-security

Recent versions of the Fedora build system treat format-security
warnings as errors, resulting in failure to build. This patch
ensures that appropriate format strings are present.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
 modules/files.c | 2 +-
 modules/ldap.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/files.c b/modules/files.c
index 4ef0a57be9f2aad99d82abfae5204009a93e5572..6a7787e28112ba07e0fc44f2887ce1d1540af29e 100644
--- a/modules/files.c
+++ b/modules/files.c
@@ -532,11 +532,11 @@ parse_field(const struct format_specifier *format, GValue *value,
 	err = NULL;
 	ret = lu_value_init_set_attr_from_string(value, format->attribute,
 						 string, &err);
 	if (ret == FALSE) {
 		g_assert(err != NULL);
-		g_warning(lu_strerror(err));
+		g_warning("%s", lu_strerror(err));
 		lu_error_free(&err);
 	}
 	return ret;
 }
 
diff --git a/modules/ldap.c b/modules/ldap.c
index ad10f7394c5735f3180cbab5bc7314301fd83ffc..02e9eb6a0cf10595d730e3dc719f2e848a3491d4 100644
--- a/modules/ldap.c
+++ b/modules/ldap.c
@@ -670,11 +670,11 @@ lu_ldap_lookup(struct lu_module *module,
 					error = NULL;
 					ok = lu_value_init_set_attr_from_string
 						(&value, attr, val, &error);
 					if (ok == FALSE) {
 						g_assert(error != NULL);
-						g_warning(lu_strerror(error));
+						g_warning("%s", lu_strerror(error));
 						lu_error_free(&error);
 					} else {
 						lu_ent_add_current(ent, attr,
 								   &value);
 						g_value_unset(&value);
-- 
2.12.0