mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 01:49:11 +00:00
Add missing stdio.h include for the _FORTIFY_SOURCE=2 check.
Implementations of _FORTIFY_SOURCE require the header file to be included. Also remove the useless test of an empty program with _FORTIFY_SOURCE defined. Pointed out by Florian Weimer.
This commit is contained in:
parent
b83140e0f1
commit
075ee0f9dc
26
configure
vendored
26
configure
vendored
@ -34207,33 +34207,11 @@ else case e in #(
|
||||
e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
char buf[4]; (void)sprintf(buf, "%s", "foo");
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
sudo_cv_use_fortify_source=yes
|
||||
else case e in #(
|
||||
e) sudo_cv_use_fortify_source=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <stdio.h>
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
char buf[4]; sprintf(buf, "%s", "foo"); return buf[0];
|
||||
|
||||
;
|
||||
return 0;
|
||||
|
@ -10,18 +10,13 @@ AC_DEFUN([SUDO_CHECK_HARDENING], [
|
||||
[sudo_cv_use_fortify_source],
|
||||
[AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM(
|
||||
[[]], [[char buf[4]; (void)sprintf(buf, "%s", "foo");]]
|
||||
[[#include <stdio.h>]],
|
||||
[[char buf[4]; sprintf(buf, "%s", "foo"); return buf[0];]]
|
||||
)],
|
||||
[sudo_cv_use_fortify_source=yes],
|
||||
[sudo_cv_use_fortify_source=no]
|
||||
)
|
||||
]
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]], [[]])],
|
||||
[sudo_cv_use_fortify_source=yes],
|
||||
[sudo_cv_use_fortify_source=no]
|
||||
)
|
||||
]
|
||||
)
|
||||
if test "$sudo_cv_use_fortify_source" != yes; then
|
||||
CPPFLAGS="$O_CPPFLAGS"
|
||||
|
Loading…
x
Reference in New Issue
Block a user