From 7ab1a7722704417f4158ee72434697eedc43618f Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 19 Nov 2011 15:01:22 +0000 Subject: [PATCH] * debian/patches/901_testsuite_gcov: Do not revert the locale when testing with gcov to avoid coverage false negatives. This does not impact the debian binary package, only the test package. --- debian/changelog | 3 +++ debian/patches/901_testsuite_gcov | 34 ++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index f2013958..27e607a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -82,6 +82,9 @@ shadow (1:4.1.5-1) unstable; urgency=low * debian/patches/506_relaxed_usernames: Really check if the user/group name starts with a dash. Also forbid names starting with '+' or '~'. Document the naming policy in useradd.8 / groupadd.8. + * debian/patches/901_testsuite_gcov: Do not revert the locale when testing + with gcov to avoid coverage false negatives. This does not impact the + debian binary package, only the test package. [ Christian Perrier ] * Use "linux-any" instead of a negated list of architectures in diff --git a/debian/patches/901_testsuite_gcov b/debian/patches/901_testsuite_gcov index 5d34d562..717cccaa 100644 --- a/debian/patches/901_testsuite_gcov +++ b/debian/patches/901_testsuite_gcov @@ -22,9 +22,9 @@ noinst_LIBRARIES = libmisc.a --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -6,6 +6,8 @@ - usbindir = ${prefix}/sbin +@@ -7,6 +7,8 @@ suidperms = 4755 + sgidperms = 2755 +CFLAGS += -fprofile-arcs -ftest-coverage + @@ -33,7 +33,7 @@ -I$(top_srcdir)/libmisc --- a/debian/rules +++ b/debian/rules -@@ -39,6 +39,12 @@ +@@ -40,6 +40,12 @@ endif export CFLAGS @@ -46,3 +46,31 @@ # Add extras to the install process: binary-install/login:: dh_installpam -p login +--- a/lib/defines.h ++++ b/lib/defines.h +@@ -174,23 +174,9 @@ + trust the formatted time received from the unix domain (or worse, + UDP) socket. -MM */ + /* Avoid translated PAM error messages: Set LC_ALL to "C". ++ * This is disabled for coverage testing + * --Nekral */ +-#define SYSLOG(x) \ +- do { \ +- char *old_locale = setlocale (LC_ALL, NULL); \ +- char *saved_locale = NULL; \ +- if (NULL != old_locale) { \ +- saved_locale = strdup (old_locale); \ +- } \ +- if (NULL != saved_locale) { \ +- (void) setlocale (LC_ALL, "C"); \ +- } \ +- syslog x ; \ +- if (NULL != saved_locale) { \ +- (void) setlocale (LC_ALL, saved_locale); \ +- free (saved_locale); \ +- } \ +- } while (false) ++#define SYSLOG(x) syslog x + #else /* !ENABLE_NLS */ + #define SYSLOG(x) syslog x + #endif /* !ENABLE_NLS */