plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

login.c (264B)


      1 #include <u.h>
      2 #include <libc.h>
      3 #include <auth.h>
      4 
      5 int
      6 login(char *user, char *password, char *namespace)
      7 {
      8 	int rv;
      9 	AuthInfo *ai;
     10 
     11 	if((ai = auth_userpasswd(user, password)) == nil)
     12 		return -1;
     13 
     14 	rv = auth_chuid(ai, namespace);
     15 	auth_freeAI(ai);
     16 	return rv;
     17 }