Skip to content

Commit

Permalink
stub for pledge(2) for systems that lack it
Browse files Browse the repository at this point in the history
  • Loading branch information
djmdjm committed Nov 29, 2015
1 parent 452c0b6 commit 14c887c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions openbsd-compat/bsd-pledge.c
Original file line number Diff line number Diff line change
@@ -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 */
4 changes: 4 additions & 0 deletions openbsd-compat/openbsd-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 14c887c

Please sign in to comment.