Blob


1 /*
2 * This is just a repository for a password.
3 * We don't want to encourage this, there's
4 * no server side.
5 *
6 * Client:
7 * start proto=pass ...
8 * read password
9 */
11 #include "std.h"
12 #include "dat.h"
14 static int
15 passproto(Conv *c)
16 {
17 Key *k;
19 k = keyfetch(c, "%A", c->attr);
20 if(k == nil)
21 return -1;
22 c->state = "write";
23 convprint(c, "%q %q",
24 strfindattr(k->attr, "user"),
25 strfindattr(k->privattr, "!password"));
26 return 0;
27 }
29 static Role passroles[] = {
30 "client", passproto,
31 0
32 };
34 Proto pass =
35 {
36 "pass",
37 passroles,
38 "user? !password?",
39 nil,
40 nil
41 };