void nfs_readlink (svccb *sbp) { if (const authunix_parms *aup = sbp->getaup ()) setres (strbuf ("%d", int (aup->aup_uid))); else setres (NFSERR_ACCES); sendreply (sbp); }
void mousectl(Cmdbuf *cb) { Proc *up = externup(); Cmdtab *ct; qlock(&mousectlqlock); if(waserror()){ qunlock(&mousectlqlock); nexterror(); } ct = lookupcmd(cb, mousectlmsg, nelem(mousectlmsg)); switch(ct->index){ case CMaccelerated: setaccelerated(cb->nf == 1 ? 1 : atoi(cb->f[1])); break; case CMintellimouse: setintellimouse(); break; case CMlinear: setlinear(); break; case CMps2: intellimouse = 0; ps2mouse(); break; case CMps2intellimouse: ps2mouse(); setintellimouse(); break; case CMres: if(cb->nf >= 2) setres(atoi(cb->f[1])); else setres(1); break; case CMreset: resetmouse(); if(accelerated) setaccelerated(accelerated); if(resolution) setres(resolution); if(intellimouse) setintellimouse(); break; case CMhwaccel: if(strcmp(cb->f[1], "on")==0) mousehwaccel = 1; else if(strcmp(cb->f[1], "off")==0) mousehwaccel = 0; else cmderror(cb, "bad mouse control message"); } qunlock(&mousectlqlock); poperror(); }
void sfssrp_authorizer::authmore (const sfsagent_authmore_arg *argp, sfsagent_auth_res *resp, cbv cb) { resp->set_authenticate (false); sfs_autharg2 aarg (SFS_SRPAUTH); aarg.srpauth->req.type = SFS_SIGNED_AUTHREQ; aarg.srpauth->req.authid = srpc->sessid; aarg.srpauth->req.seqno = argp->seqno; aarg.srpauth->req.user = srpc->user; switch (srpc->next (&aarg.srpauth->msg, &argp->more)) { case SRP_SETPWD: if (!argp->checkserver) { getpwd (strbuf () << "Passphrase for " << srpc->getname () << ": ", false, wrap (this, &sfssrp_authorizer::authmore_2, argp, resp, cb)); return; } break; case SRP_NEXT: if (!argp->checkserver) setres (resp, aarg); break; case SRP_DONE: if (argp->checkserver) resp->set_authenticate (true); break; default: break; } (*cb) (); }
void sfssrp_authorizer::authinit (const sfsagent_authinit_arg *argp, sfsagent_auth_res *resp, cbv cb) { resp->set_authenticate (false); if (!ntries_ok (argp->ntries)) { (*cb) (); return; } sfs_autharg2 aarg (SFS_SRPAUTH); if (!reqinit (&aarg.srpauth->req, argp)) { (*cb) (); return; } if (!srpc) { srpc = New srp_client; delete_srpc = true; } if (!srpc->init (&aarg.srpauth->msg, aarg.srpauth->req.authid, aarg.srpauth->req.user, NULL, // XXX -- eventually change next line to just 6 argp->server_release < 8 ? 3 : 6)) warn ("SRP client initialization failed\n"); else setres (resp, aarg); (*cb) (); }