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;
37 rpc = auth_allocrpc();
40 quotefmtinstall(); /* just in case */
42 params = vsmprint(fmt, arg);
47 if(dorpc(rpc, "start", params, strlen(params), getkey) != ARok
48 || dorpc(rpc, "read", nil, 0, getkey) != ARok)
51 rpc->arg[rpc->narg] = '\0';
52 if(tokenize(rpc->arg, f, 2) != 2){
53 werrstr("bad answer from factotum");
56 up = malloc(sizeof(*up)+rpc->narg+1);