]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
stub for pledge(2) for systems that lack it
authorDamien Miller <djm@mindrot.org>
Sun, 29 Nov 2015 22:45:29 +0000 (09:45 +1100)
committerDamien Miller <djm@mindrot.org>
Sun, 29 Nov 2015 22:45:54 +0000 (09:45 +1100)
openbsd-compat/bsd-pledge.c [new file with mode: 0644]
openbsd-compat/openbsd-compat.h

diff --git a/openbsd-compat/bsd-pledge.c b/openbsd-compat/bsd-pledge.c
new file mode 100644 (file)
index 0000000..afce3c0
--- /dev/null
@@ -0,0 +1,14 @@
+/* Placed in the public domain.  */
+
+#include "includes.h"
+
+#ifndef HAVE_PLEDGE
+
+/* Stub; real implementations wanted. */
+int
+pledge(const char *promises, const char *paths[])
+{
+       return 0;
+}
+
+#endif /* HAVE_PLEDGE */
index 8cc8a11b7617c379380b2fe087163999f9cc9472..be7b6877e88e6c5deec813d684f79d6e1f767d92 100644 (file)
@@ -264,6 +264,10 @@ int        bcrypt_pbkdf(const char *, size_t, const u_int8_t *, size_t,
 void explicit_bzero(void *p, size_t n);
 #endif
 
+#ifndef HAVE_PLEDGE
+int pledge(const char *promises, const char *paths[]);
+#endif /* HAVE_PLEDGE */
+
 void *xmmap(size_t size);
 char *xcrypt(const char *password, const char *salt);
 char *shadow_pw(struct passwd *pw);