summaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-11-30 09:45:29 +1100
committerDamien Miller <djm@mindrot.org>2015-11-30 09:45:54 +1100
commit14c887c8393adde2d9fd437d498be30f8c98535c (patch)
tree7cb75dce1981a58542c11a65bb6986f9ca916212 /openbsd-compat
parent452c0b6af5d14c37553e30059bf74456012493f3 (diff)
stub for pledge(2) for systems that lack it
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-pledge.c14
-rw-r--r--openbsd-compat/openbsd-compat.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-pledge.c b/openbsd-compat/bsd-pledge.c
new file mode 100644
index 00000000..afce3c00
--- /dev/null
+++ b/openbsd-compat/bsd-pledge.c
@@ -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 */
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 8cc8a11b..be7b6877 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -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);