]> git.armaanb.net Git - opendoas.git/blob - libopenbsd/setusercontext.c
Add compatibility functions from OpenBSD.
[opendoas.git] / libopenbsd / setusercontext.c
1 /* Copyright 2015 Nathan Holstein */
2
3 #include <errno.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6
7 #include "openbsd.h"
8
9 int
10 setusercontext(login_cap_t *lc, struct passwd *pwd, uid_t uid, unsigned int flags)
11 {
12         if (lc != NULL || pwd == NULL ||
13                         (flags & ~(LOGIN_SETGROUP | LOGIN_SETPRIORITY |
14                                    LOGIN_SETRESOURCES | LOGIN_SETUMASK |
15                                    LOGIN_SETUSER)) != 0) {
16                 errno = EINVAL;
17                 return -1;
18         }
19
20         fprintf(stderr, "failing setusercontext() for %d\n", (int) uid);
21
22         return -1;
23 }
24