aboutsummaryrefslogtreecommitdiff
path: root/src/libauth/login.c
blob: 8bbc7b1066e0d51b80d272ad3b80cac605f5f80f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <u.h>
#include <libc.h>
#include <auth.h>

int
login(char *user, char *password, char *namespace)
{
	int rv;
	AuthInfo *ai;

	if((ai = auth_userpasswd(user, password)) == nil)
		return -1;

	rv = auth_chuid(ai, namespace);
	auth_freeAI(ai);
	return rv;
}