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/planix-v0/sys/src/cmd/auth/respond.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 <auth.h>
4
 
5
void
6
usage(void)
7
{
8
	fprint(2, "usage: auth/respond 'params' chal\n");
9
	exits("usage");
10
}
11
 
12
void
13
main(int argc, char **argv)
14
{
15
	char buf[128];
16
	int n;
17
 
18
	ARGBEGIN{
19
	default:
20
		usage();
21
	}ARGEND
22
 
23
	if(argc != 2)
24
		usage();
25
 
26
	memset(buf, 0, sizeof buf);
27
	n = auth_respond(argv[1], strlen(argv[1]), buf, sizeof buf-1, auth_getkey, "%s", argv[0]);
28
	if(n < 0)
29
		sysfatal("auth_respond: %r");
30
	write(1, buf, n);
31
	print("\n");
32
}
33
 
34