henesyinit from p9fce6d0435 years agoHistory
37 lines · 635 B · Text
RawDownload
#include <alef.h>#include <auth.h>#include "authlocal.h" intern byte *ccmsg = "can't connect to AS"; intauthenticate(int fd, int afd){	int rv;	byte trbuf[TICKREQLEN];	byte tbuf[2*TICKETLEN]; 	if(fsession(fd, trbuf) < 0){		werrstr("fsession: %r");		return -1;	} 	/* no authentication required? */	memset(tbuf, 0, 2*TICKETLEN);	if(trbuf[0] == 0)		return 0; 	/* try getting to an auth server */	if(afd >= 0)		return _asgetticket(afd, trbuf, tbuf);	afd = authdial();	if(afd < 0){		werrstr(ccmsg);		return -1;	}	rv = _asgetticket(afd, trbuf, tbuf);	close(afd);	if(rv < 0)		return -1;	return fauth(fd, tbuf);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t