]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - contrib/ntp/sntp/m4/ntp_harden.m4
Fix multiple vulnerabilities in ntp. [SA-18:02.ntp]
[FreeBSD/releng/10.3.git] / contrib / ntp / sntp / m4 / ntp_harden.m4
1 dnl ######################################################################
2 dnl @synopsis NTP_HARDEN([SCRIPTSDIRPATH])
3 dnl Build (compile/link) hardening information:
4 dnl - NTP_HARD_CFLAGS
5 dnl - NTP_HARD_CPPFLAGS
6 dnl - NTP_HARD_LDFLAGS
7
8 AC_DEFUN([NTP_HARDEN], [
9
10 AC_MSG_CHECKING([for compile/link hardening flags])
11
12 AC_ARG_WITH(
13     [hardenfile],
14     [AS_HELP_STRING(
15         [--with-hardenfile=XXX],
16         [os-specific or "/dev/null"]
17     )],
18     [],
19     [with_hardenfile=no]
20 )
21
22 (                                                                       \
23     SENTINEL_DIR="$PWD" &&                                              \
24     cd $srcdir/$1 &&                                                    \
25     case "$with_hardenfile" in                                          \
26      yes|no|'')                                                         \
27         scripts/genHardFlags -d "$SENTINEL_DIR"                         \
28         ;;                                                              \
29      *)                                                                 \
30         scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_hardenfile"   \
31         ;;                                                              \
32     esac                                                                \
33 ) > genHardFlags.i 2> genHardFlags.err
34 . ./genHardFlags.i
35
36 case "$GENHARDFLAG" in
37  OK)
38     AC_MSG_RESULT([in file $GENHARDFLAGFILE])
39     rm genHardFlags.err genHardFlags.i
40     ;;
41  *)
42     AC_MSG_RESULT([failed.])
43     AC_MSG_ERROR([Problem with genHardFlags!])
44     ;;
45 esac
46
47 AC_SUBST([NTP_HARD_CFLAGS])
48 AC_SUBST([NTP_HARD_CPPFLAGS])
49 AC_SUBST([NTP_HARD_LDFLAGS])
50
51 ])dnl
52 dnl ======================================================================