From: Todd C. Miller Date: Mon, 18 May 2015 19:39:21 +0000 (-0600) Subject: Add sudo_reallocarrary to util.exp.in if reallocarray is not found. X-Git-Tag: SUDO_1_8_14^2~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1491fe1372f60630906ebea10aac348b9d87717;p=sudo Add sudo_reallocarrary to util.exp.in if reallocarray is not found. --- diff --git a/configure b/configure index 2d98bac5d..582e0f52d 100755 --- a/configure +++ b/configure @@ -2654,7 +2654,6 @@ as_fn_append ac_header_list " sys/stropts.h" as_fn_append ac_header_list " sys/sysmacros.h" as_fn_append ac_func_list " killpg" as_fn_append ac_func_list " nl_langinfo" -as_fn_append ac_func_list " reallocarray" as_fn_append ac_func_list " strftime" as_fn_append ac_func_list " tzset" as_fn_append ac_func_list " seteuid" @@ -17963,8 +17962,6 @@ done - - for ac_func in getgrouplist do : ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist" @@ -18135,6 +18132,26 @@ fi done +fi +done + +for ac_func in reallocarray +do : + ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray" +if test "x$ac_cv_func_reallocarray" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_REALLOCARRAY 1 +_ACEOF + +else + + + for _sym in sudo_reallocarray; do + COMPAT_EXP="${COMPAT_EXP}${_sym} +" + done + + fi done diff --git a/configure.ac b/configure.ac index 7ee0ee444..250d8307d 100644 --- a/configure.ac +++ b/configure.ac @@ -2400,7 +2400,7 @@ dnl dnl Function checks dnl AC_FUNC_GETGROUPS -AC_CHECK_FUNCS_ONCE([killpg nl_langinfo reallocarray strftime tzset]) +AC_CHECK_FUNCS_ONCE([killpg nl_langinfo strftime tzset]) AC_CHECK_FUNCS([getgrouplist], [], [ case "$host_os" in aix*) @@ -2445,6 +2445,9 @@ AC_CHECK_FUNCS([getline], [], [ SUDO_APPEND_COMPAT_EXP(sudo_getline) AC_CHECK_FUNCS([fgetln]) ]) +AC_CHECK_FUNCS([reallocarray], [], [ + SUDO_APPEND_COMPAT_EXP(sudo_reallocarray) +]) dnl dnl If libc supports _FORTIFY_SOURCE check functions, use it. dnl