11 dorpc(AuthRpc *rpc, char *verb, char *val, int len, AuthGetkey *getkey)
16 if((ret = auth_rpc(rpc, verb, val, len)) != ARneedkey && ret != ARbadkey)
19 return ARgiveup; /* don't know how */
20 if((*getkey)(rpc->arg) < 0)
21 return ARgiveup; /* user punted */
26 auth_getuserpasswd(AuthGetkey *getkey, char *fmt, ...)
29 char *f[3], *p, *params;
38 fd = open("/mnt/factotum/rpc", ORDWR);
41 rpc = auth_allocrpc(fd);
44 quotefmtinstall(); /* just in case */
46 params = vsmprint(fmt, arg);
51 if(dorpc(rpc, "start", params, strlen(params), getkey) != ARok
52 || dorpc(rpc, "read", nil, 0, getkey) != ARok)
55 rpc->arg[rpc->narg] = '\0';
56 if(tokenize(rpc->arg, f, 2) != 2){
57 werrstr("bad answer from factotum");
60 up = malloc(sizeof(*up)+rpc->narg+1);