提交 5f0a9c45 编写于 作者: J John Ferlan

util: Alter virAuthGet*Path API return processing

If we never find the valid credtype in the list, then we'd return
NULL without an error signaled forcing the caller to generate one
that will probably be incorrect. Let's be specific.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
上级 efd82615
......@@ -191,10 +191,12 @@ virAuthGetUsernamePath(const char *path,
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0)
VIR_FREE(cred.result);
break;
return cred.result;
}
return cred.result;
virReportError(VIR_ERR_AUTH_FAILED, "%s",
_("Missing VIR_CRED_AUTHNAME credential type"));
return NULL;
}
......@@ -267,10 +269,13 @@ virAuthGetPasswordPath(const char *path,
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0)
VIR_FREE(cred.result);
break;
return cred.result;
}
return cred.result;
virReportError(VIR_ERR_AUTH_FAILED, "%s",
_("Missing VIR_CRED_PASSPHRASE or VIR_CRED_NOECHOPROMPT "
"credential type"));
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册