From: Damien Miller Date: Mon, 18 Aug 2025 07:00:26 +0000 (+1000) Subject: Fix pledge(2) special casing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Fopenssh-portable.git Fix pledge(2) special casing Unbreaks non-OpenBSD platforms --- diff --git a/configure.ac b/configure.ac index bc1900af7..71766ba10 100644 --- a/configure.ac +++ b/configure.ac @@ -629,6 +629,9 @@ SOLARIS_PRIVS="no" # Default shared library extension SHLIBEXT=".so" +# See OpenBSD section in $host case below. +need_pledge_inet="" + # Check for some target-specific stuff case "$host" in *-*-aix*) @@ -1129,7 +1132,6 @@ mips-sony-bsd|mips-sony-newsos4) [syslog_r function is safe to use in in a signal handler]) TEST_MALLOC_OPTIONS="SJRU" AC_MSG_CHECKING([whether pledge(2) allows IP_TOS]) - need_pledge_inet="" AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include @@ -1151,12 +1153,6 @@ if (setsockopt(s, IPPROTO_IP, IP_TOS, &one, sizeof(one)) == -1) need_pledge_inet=1 ], [ AC_MSG_WARN([cross compiling: cannot test]) ]) - if test -z "$need_pledge_inet" ; then - AC_DEFINE_UNQUOTED([PLEDGE_EXTRA_INET], []) - else - AC_DEFINE_UNQUOTED([PLEDGE_EXTRA_INET], ["inet "], - [need inet in pledge for setsockopt IP_TOS]) - fi ;; *-*-solaris*) if test "x$withval" != "xno" ; then @@ -1430,6 +1426,14 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ exit(0); ]])], [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] ) +dnl Finish up special pledge(2) handling from above. +if test -z "$need_pledge_inet" ; then + AC_DEFINE_UNQUOTED([PLEDGE_EXTRA_INET], []) +else + AC_DEFINE_UNQUOTED([PLEDGE_EXTRA_INET], ["inet "], + [need inet in pledge for setsockopt IP_TOS]) +fi + dnl Checks for header files. # Checks for libraries. AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])])