void credential_reject(struct credential *c) { int i; credential_apply_config(c); for (i = 0; i < c->helpers.nr; i++) credential_do(c, c->helpers.items[i].string, "erase"); FREE_AND_NULL(c->username); FREE_AND_NULL(c->password); c->approved = 0; }
void credential_approve(struct credential *c) { int i; if (c->approved) return; if (!c->username || !c->password) return; credential_apply_config(c); for (i = 0; i < c->helpers.nr; i++) credential_do(c, c->helpers.items[i].string, "store"); c->approved = 1; }
void credential_fill(struct credential *c) { int i; if (c->username && c->password) return; credential_apply_config(c); for (i = 0; i < c->helpers.nr; i++) { credential_do(c, c->helpers.items[i].string, "get"); if (c->username && c->password) return; } credential_getpass(c); if (!c->username && !c->password) die("unable to get password from user"); }