URL: https://github.com/freeipa/freeipa/pull/501
Author: tiran
 Title: #501: C compilation fixes and hardening
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/501/head:pr501
git checkout pr501
From 244c9a552b8f71bbd3e2ec22e09c2e1d05b1b3a5 Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Fri, 24 Feb 2017 08:20:15 +0100
Subject: [PATCH] C compilation fixes and hardening
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix "implicit declaration of function ‘strlen’" in ipa_pwd_ntlm.c,
credits to Lukas.

Add -Werror=implicit-function-declaration to CFLAGS to point developers
to missing includes. It causes compilation to fail when a developer
forgets to add a required include. The problem is no longer hidden in a
massive wall of text from make.

Silence a harmless error from 389-DS slapi.h until the bug is fixed in
downstream, https://pagure.io/389-ds-base/issue/48979

Signed-off-by: Christian Heimes <chei...@redhat.com>
 configure.ac        | 3 +++
 util/ipa_pwd_ntlm.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9ee281a..af41f5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,9 @@ LT_INIT
+dnl fail hard when includes statements are missing
+CFLAGS+=" -Werror=implicit-function-declaration"
diff --git a/util/ipa_pwd_ntlm.c b/util/ipa_pwd_ntlm.c
index f709981..263816d 100644
--- a/util/ipa_pwd_ntlm.c
+++ b/util/ipa_pwd_ntlm.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
+#include <string.h>
 #include <iconv.h>
 #include <openssl/md4.h>
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to