henesyinit from p9fce6d0435 years agoHistory
28 lines · 429 B · C
RawDownload
#include <u.h>#include <libc.h>#include <auth.h>#include "authsrv.h" static intgetkey(char *authkey){	int fd;	int n; 	fd = open("/dev/key", OREAD);	if(fd < 0)		return -1;	n = read(fd, authkey, DESKEYLEN);	close(fd);	return n != DESKEYLEN ? -1 : 0;} intgetauthkey(char *authkey){	if(getkey(authkey) == 0)		return 1;	print("can't read /dev/key, please enter machine key\n");	getpass(authkey, 0);	return 1;}