1
0
mirror of https://github.com/skeeto/endlessh.git synced 2024-05-19 06:49:58 +00:00

Add pledge for OpenBSD

Closes #32.
This commit is contained in:
arun
2019-07-20 20:18:38 +05:30
committed by Christopher Wellons
parent a154fcaf43
commit b2c811ecf7

View File

@ -1,4 +1,9 @@
#define _XOPEN_SOURCE 600
#if defined(__OpenBSD__)
# define _BSD_SOURCE /* for pledge(2) */
#else
# define _XOPEN_SOURCE 600
#endif
#include <time.h>
#include <errno.h>
#include <stdio.h>
@ -596,6 +601,11 @@ sendline(struct client *client, int max_line_length, unsigned long *rng)
int
main(int argc, char **argv)
{
#if (defined(__OpenBSD__))
if (pledge("inet stdio rpath", NULL) == -1)
die();
#endif
struct config config = CONFIG_DEFAULT;
const char *config_file = DEFAULT_CONFIG_FILE;
config_load(&config, config_file, 1);