Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/cmd/unix/drawterm/libauthsrv/authdial.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <authsrv.h>
4
#include <bio.h>
5
#include <ndb.h>
6
 
7
int
8
authdial(char *netroot, char *dom)
9
{
10
	char server[Ndbvlen];
11
	Ndbtuple *nt;
12
 
13
 
14
	if(dom != nil){
15
		/* look up an auth server in an authentication domain */
16
		nt = csgetval(netroot, "authdom", dom, "auth", server);
17
 
18
		/* if that didn't work, just try the IP domain */
19
		if(nt == nil)
20
			nt = csgetval(netroot, "dom", dom, "auth", server);
21
		if(nt == nil){
22
			werrstr("no auth server found for %s", dom);
23
			return -1;
24
		}
25
		ndbfree(nt);
26
		return dial(netmkaddr(server, netroot, "ticket"), 0, 0, 0);
27
	} else {
28
		/* look for one relative to my machine */
29
		return dial(netmkaddr("$auth", netroot, "ticket"), 0, 0, 0);
30
	}
31
}