From 72ea53b800f9a441e04b742b8f47a244ad802bdd Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 15 Mar 2017 13:36:09 -0400 Subject: [PATCH] Fix FTBFS on Fedora 26+ Add patch to fix issues with -Werror=format-security Ensure that the python 3 tests use a locale guaranteed to be present --- ...x-errors-with-Werror-format-security.patch | 52 +++++++++++++++++++ libuser.spec | 20 +++++-- 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 0001-Fix-errors-with-Werror-format-security.patch diff --git a/0001-Fix-errors-with-Werror-format-security.patch b/0001-Fix-errors-with-Werror-format-security.patch new file mode 100644 index 0000000..eeb9efb --- /dev/null +++ b/0001-Fix-errors-with-Werror-format-security.patch @@ -0,0 +1,52 @@ +From 9317afc8bb7eec656444fc2eecfcd1ea3bfdda82 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +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 +--- + 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 + diff --git a/libuser.spec b/libuser.spec index 6c91c29..ba55ec3 100644 --- a/libuser.spec +++ b/libuser.spec @@ -1,6 +1,6 @@ Name: libuser Version: 0.62 -Release: 6%{?dist} +Release: 7%{?dist} Group: System Environment/Base License: LGPLv2+ URL: https://fedorahosted.org/libuser/ @@ -15,6 +15,10 @@ Summary: A user and group account administration library %global __provides_exclude_from ^(%{_libdir}/%{name}|%{python2_sitearch}|%{python3_sitearch})/.*$ +# Patch to address format-security. +# Submitted upstream at https://pagure.io/libuser/pull-request/17 +Patch0001: 0001-Fix-errors-with-Werror-format-security.patch + %description The libuser library implements a standardized interface for manipulating and administering user and group accounts. The library uses pluggable @@ -55,6 +59,11 @@ administering user and group accounts. %prep %setup -qc + +pushd libuser-%{version} +%patch0001 -p1 +popd + mv libuser-%{version} python2 cp -a python2 python3 @@ -88,7 +97,7 @@ make -C python2 install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' make -C python2 check || { cat python2/test-suite.log; false; } # The Python 3 module only supports UTF-8 -LC_ALL=en_US.UTF-8 make -C python3 check \ +LC_ALL=C.UTF-8 make -C python3 check \ || { cat python3/test-suite.log; false; } # Verify that all python modules load, just in case. @@ -98,7 +107,7 @@ cd $RPM_BUILD_ROOT/%{python2_sitearch} python2 -c "import libuser" cd $RPM_BUILD_ROOT/%{python3_sitearch} # The Python 3 module only supports UTF-8 -LC_ALL=en_US.UTF-8 python3 -c "import libuser" +LC_ALL=C.UTF-8 python3 -c "import libuser" %post -p /sbin/ldconfig @@ -139,6 +148,11 @@ LC_ALL=en_US.UTF-8 python3 -c "import libuser" %{_datadir}/gtk-doc/html/* %changelog +* Wed Mar 15 2017 Stephen Gallagher - 0.62-7 +- Fix FTBFS on Fedora 26+ +- Add patch to fix issues with -Werror=format-security +- Ensure that the python 3 tests use a locale guaranteed to be present + * Fri Feb 10 2017 Fedora Release Engineering - 0.62-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild