vici: Return authentication rounds with unique names

To simplify handling of authentication rounds in dictionaries/hashtables on the
client side, we assign unique names to each authentication round when listing
connection.
This commit is contained in:
Martin Willi
2015-03-18 13:59:14 +01:00
parent d1ad65f7b2
commit 94bb26fae3
2 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -103,7 +103,7 @@ CALLBACK(conn_sn, int,
{
return vici_parse_cb(res, children_sn, NULL, NULL, NULL);
}
if (streq(name, "local") || streq(name, "remote"))
if (strpfx(name, "local") || strpfx(name, "remote"))
{
hashtable_t *auth;
@@ -112,7 +112,8 @@ CALLBACK(conn_sn, int,
if (ret == 0)
{
printf(" %s %s authentication:\n",
name, auth->get(auth, "class") ?: "unspecified");
strpfx(name, "local") ? "local" : "remote",
auth->get(auth, "class") ?: "unspecified");
if (auth->get(auth, "id"))
{
printf(" id: %s\n", auth->get(auth, "id"));