]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Add a null implementation of pledge.
authorDarren Tucker <dtucker@zip.com.au>
Sun, 29 Nov 2015 20:23:53 +0000 (07:23 +1100)
committerDarren Tucker <dtucker@zip.com.au>
Sun, 29 Nov 2015 20:23:53 +0000 (07:23 +1100)
Fixes builds on almost everything.

configure.ac
openbsd-compat/bsd-misc.c
openbsd-compat/bsd-misc.h

index 1527a13dc465cb99308afb9a2d3ce2f1d3bf2881..85e9843757e6055351d28ba6fe3a18d82d2ad637 100644 (file)
@@ -854,7 +854,6 @@ mips-sony-bsd|mips-sony-newsos4)
        AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1],
            [syslog_r function is safe to use in in a signal handler])
        TEST_MALLOC_OPTIONS="AFGJPRX"
-       AC_CHECK_FUNCS([pledge])
        ;;
 *-*-solaris*)
        if test "x$withval" != "xno" ; then
@@ -1669,6 +1668,7 @@ AC_CHECK_FUNCS([ \
        nsleep \
        ogetaddrinfo \
        openlog_r \
+       pledge \
        poll \
        prctl \
        pstat \
index f7be415ec2265dbb84a071996c083ae41eb49151..2a788e47f7dd546c4862478cf3652bcb50e849dd 100644 (file)
@@ -276,3 +276,11 @@ getpgid(pid_t pid)
        return -1;
 }
 #endif
+
+#ifndef HAVE_PLEDGE
+int
+pledge(const char *promises, const char *paths[])
+{
+       return 0;
+}
+#endif
index ff347a24b0eb598349a4b8ed9f92f38b4c1610a9..0d81d17352eae6812da12a21529ef3ae0effeae2 100644 (file)
@@ -122,4 +122,8 @@ pid_t getpgid(pid_t);
 # define krb5_free_error_message(a,b) do { } while(0)
 #endif
 
+#ifndef HAVE_PLEDGE
+int pledge(const char *promises, const char *paths[]);
+#endif
+
 #endif /* _BSD_MISC_H */