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