1 #ifndef _LIB_OPENBSD_H_
2 #define _LIB_OPENBSD_H_
8 #include "readpassphrase.h"
10 /* API definitions lifted from OpenBSD src/include */
13 #ifndef HAVE_LOGIN_CAP_H
14 #define LOGIN_SETGROUP 0x0001 /* Set group */
15 #define LOGIN_SETLOGIN 0x0002 /* Set login */
16 #define LOGIN_SETPATH 0x0004 /* Set path */
17 #define LOGIN_SETPRIORITY 0x0008 /* Set priority */
18 #define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */
19 #define LOGIN_SETUMASK 0x0020 /* Set umask */
20 #define LOGIN_SETUSER 0x0040 /* Set user */
21 #define LOGIN_SETENV 0x0080 /* Set environment */
22 #define LOGIN_SETALL 0x00ff /* Set all. */
24 typedef struct login_cap login_cap_t;
26 int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned int);
27 #endif /* !HAVE_LOGIN_CAP_H */
30 #define _PW_NAME_LEN 63
33 #ifndef HAVE_REALLOCARRAY
34 void * reallocarray(void *optr, size_t nmemb, size_t size);
35 #endif /* HAVE_REALLOCARRAY */
37 long long strtonum(const char *numstr, long long minval,
38 long long maxval, const char **errstrp);
39 #endif /* !HAVE_STRTONUM */
42 #ifndef HAVE_EXPLICIT_BZERO
43 void explicit_bzero(void *, size_t);
46 size_t strlcat(char *dst, const char *src, size_t dsize);
47 #endif /* !HAVE_STRLCAT */
49 size_t strlcpy(char *dst, const char *src, size_t dsize);
50 #endif /* !HAVE_STRLCPY */
54 int execvpe(const char *, char *const *, char *const *);
55 #endif /* !HAVE_EXECVPE */
56 #ifndef HAVE_SETRESUID
57 int setresuid(uid_t, uid_t, uid_t);
58 #endif /* !HAVE_SETRESUID */
60 int pledge(const char *promises, const char *paths[]);
61 #endif /* !HAVE_PLEDGE */
65 void verrc(int eval, int code, const char *fmt, va_list ap);
66 #endif /* !HAVE_VERRC */
68 void errc(int eval, int code, const char *fmt, ...);
69 #endif /* !HAVE_ERRC */
71 #ifndef HAVE_SETPROGNAME
72 const char * getprogname(void);
73 void setprogname(const char *progname);
74 #endif /* !HAVE_SETPROGNAME */
76 #endif /* _LIB_OPENBSD_H_ */