diff --git a/cntlm-c99.patch b/cntlm-c99.patch new file mode 100644 index 0000000..953c653 --- /dev/null +++ b/cntlm-c99.patch @@ -0,0 +1,45 @@ +Include and for printf- and string-related +functions. Define _DEFAULT_SOURCE during feature probing and the +build. + +This avoids implicit function declarations and build failures with +future compilers. + +Submitted upstream: + +diff --git a/Makefile b/Makefile +index 90479978beab1b73..e7690bcae9efc039 100644 +--- a/Makefile ++++ b/Makefile +@@ -15,7 +15,7 @@ MANDIR=$(DESTDIR)/usr/share/man + NAME=cntlm + CC=gcc + VER=`cat VERSION` +-override CFLAGS += -std=c99 -pedantic -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -D_BSD_SOURCE -DVERSION=\"`cat VERSION`\" ++override CFLAGS += -std=c99 -pedantic -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -D_BSD_SOURCE -D_DEFAULT_SOURCE -DVERSION=\"`cat VERSION`\" + override LDFLAGS += -lpthread + + ifeq ($(findstring CYGWIN,$(OS)),) +diff --git a/config/gethostname.c b/config/gethostname.c +index 3e76762a823758be..90bad535a12536d4 100644 +--- a/config/gethostname.c ++++ b/config/gethostname.c +@@ -1,3 +1,5 @@ ++#include ++#include + #include + + int main(int argc, char **argv) { +diff --git a/configure b/configure +index 107f2d495f502f12..b77bd1812a76c081 100755 +--- a/configure ++++ b/configure +@@ -62,7 +62,7 @@ rm -f $CONFIG + for i in $TESTS; do + printf "Checking $i... " + printf "#define config_$i " >> $CONFIG +- OUT=`$CC -D_POSIX_C_SOURCE=199506L -D_ISOC99_SOURCE -D_REENTRANT -o config/$i config/$i.c 2>&1` ++ OUT=`$CC -D_POSIX_C_SOURCE=199506L -D_ISOC99_SOURCE -D_DEFAULT_SOURCE -D_REENTRANT -o config/$i config/$i.c 2>&1` + rc=$? + + if [ $rc -ne 0 ]; then # -o -n "$OUT" ]; then diff --git a/cntlm.spec b/cntlm.spec index a8eaa23..04b8bf0 100644 --- a/cntlm.spec +++ b/cntlm.spec @@ -3,7 +3,7 @@ Summary: Fast NTLM authentication proxy with tunneling Name: cntlm Version: 0.92.3 -Release: 24%{?dist} +Release: 25%{?dist} License: GPL-2.0-or-later URL: http://cntlm.sourceforge.net/ @@ -12,6 +12,7 @@ Source1: cntlm.tmpfiles Source2: cntlm.service # Don't override global CFLAGS/LDFLAGS and don't strip installed binaries Patch0: cntlm_makefile.patch +Patch1: cntlm-c99.patch BuildRequires: gcc BuildRequires: make @@ -80,6 +81,9 @@ exit 0 %changelog +* Mon Feb 06 2023 Florian Weimer - 0.92.3-25 +- Fix C99 compatibility issues + * Thu Jan 19 2023 Fedora Release Engineering - 0.92.3-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild