X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=libopenbsd%2Fopenbsd.h;h=d3bdc0b61d58cf864c49753dde1bacf8b1228c88;hb=4daae4a9009b1340e4887d42974a0b0a50ae6c43;hp=1e5ff9776048a28d95a8f949ca4a98814acf7283;hpb=861d30f4b90c5312b33358caea08e8e26fc24818;p=opendoas.git diff --git a/libopenbsd/openbsd.h b/libopenbsd/openbsd.h index 1e5ff97..d3bdc0b 100644 --- a/libopenbsd/openbsd.h +++ b/libopenbsd/openbsd.h @@ -3,33 +3,16 @@ #include #include -#include -#include "readpassphrase.h" - -/* API definitions lifted from OpenBSD src/include */ - -/* bsd_auth.h */ -#ifndef HAVE_BSD_AUTH_H -int auth_userokay(char *, char *, char *, char *); -#endif /* !HAVE_BSD_AUTH_H */ +#ifndef __UNUSED +# define __UNUSED __attribute__ ((unused)) +#endif -/* login_cap.h */ -#ifndef HAVE_LOGIN_CAP_H -#define LOGIN_SETGROUP 0x0001 /* Set group */ -#define LOGIN_SETLOGIN 0x0002 /* Set login */ -#define LOGIN_SETPATH 0x0004 /* Set path */ -#define LOGIN_SETPRIORITY 0x0008 /* Set priority */ -#define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */ -#define LOGIN_SETUMASK 0x0020 /* Set umask */ -#define LOGIN_SETUSER 0x0040 /* Set user */ -#define LOGIN_SETENV 0x0080 /* Set environment */ -#define LOGIN_SETALL 0x00ff /* Set all. */ +#ifndef __dead +# define __dead __attribute__ ((noreturn)) +#endif -typedef struct login_cap login_cap_t; -struct passwd; -int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned int); -#endif /* !HAVE_LOGIN_CAP_H */ +/* API definitions lifted from OpenBSD src/include */ /* pwd.h */ #define _PW_NAME_LEN 63 @@ -64,13 +47,16 @@ int setresuid(uid_t, uid_t, uid_t); #ifndef HAVE_PLEDGE int pledge(const char *promises, const char *paths[]); #endif /* !HAVE_PLEDGE */ +#ifndef HAVE_CLOSEFROM +void closefrom(int); +#endif /* !HAVE_CLOSEFROM */ /* err.h */ #ifndef HAVE_VERRC -void verrc(int eval, int code, const char *fmt, va_list ap); +void __dead verrc(int eval, int code, const char *fmt, va_list ap); #endif /* !HAVE_VERRC */ #ifndef HAVE_ERRC -void errc(int eval, int code, const char *fmt, ...); +__dead void errc(int eval, int code, const char *fmt, ...); #endif /* !HAVE_ERRC */ #ifndef HAVE_SETPROGNAME @@ -78,4 +64,11 @@ const char * getprogname(void); void setprogname(const char *progname); #endif /* !HAVE_SETPROGNAME */ +#ifndef HAVE_SETRESGID +int setresgid(gid_t, gid_t, gid_t); +#endif +#ifndef HAVE_SETRESUID +int setresuid(uid_t, uid_t, uid_t); +#endif + #endif /* _LIB_OPENBSD_H_ */