From: Martin Willi Date: Mon, 24 Feb 2014 12:28:24 +0000 (+0100) Subject: swanctl: Be more verbose while loading connections and credentials X-Git-Tag: 5.2.0dr3~8^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebe78940aa05fc9fbb2e1127c25b1ae3c05bdd72;p=thirdparty%2Fstrongswan.git swanctl: Be more verbose while loading connections and credentials --- diff --git a/src/swanctl/commands/load_conns.c b/src/swanctl/commands/load_conns.c index 68ed3cda96..020819687b 100644 --- a/src/swanctl/commands/load_conns.c +++ b/src/swanctl/commands/load_conns.c @@ -214,6 +214,10 @@ static bool load_conn(vici_conn_t *conn, settings_t *cfg, section, vici_find_str(res, "", "errmsg")); ret = FALSE; } + else + { + printf("loaded connection '%s'\n", section); + } vici_free_res(res); return ret; } diff --git a/src/swanctl/commands/load_creds.c b/src/swanctl/commands/load_creds.c index dcfc6fe1f2..52cdfb9caf 100644 --- a/src/swanctl/commands/load_creds.c +++ b/src/swanctl/commands/load_creds.c @@ -55,6 +55,10 @@ static bool load_cert(vici_conn_t *conn, bool raw, char *dir, dir, vici_find_str(res, "", "errmsg")); ret = FALSE; } + else + { + printf("loaded %s certificate '%s'\n", type, dir); + } vici_free_res(res); return ret; } @@ -124,6 +128,10 @@ static bool load_key(vici_conn_t *conn, bool raw, char *dir, dir, vici_find_str(res, "", "errmsg")); ret = FALSE; } + else + { + printf("loaded %s key '%s'\n", type, dir); + } vici_free_res(res); return ret; } @@ -274,6 +282,7 @@ static bool load_secret(vici_conn_t *conn, char *type, char *owners, vici_req_t *req; vici_res_t *res; chunk_t data; + char *owner; bool ret = TRUE; req = vici_begin("load-shared"); @@ -281,9 +290,9 @@ static bool load_secret(vici_conn_t *conn, char *type, char *owners, vici_add_key_valuef(req, "type", "%s", type); vici_begin_list(req, "owners"); enumerator = enumerator_create_token(owners, " ", " "); - while (enumerator->enumerate(enumerator, &owners)) + while (enumerator->enumerate(enumerator, &owner)) { - vici_add_list_itemf(req, "%s", owners); + vici_add_list_itemf(req, "%s", owner); } enumerator->destroy(enumerator); vici_end_list(req); @@ -319,6 +328,17 @@ static bool load_secret(vici_conn_t *conn, char *type, char *owners, vici_find_str(res, "", "errmsg")); ret = FALSE; } + else + { + printf("loaded %s secret for: ", type); + enumerator = enumerator_create_token(owners, " ", " "); + while (enumerator->enumerate(enumerator, &owner)) + { + printf("'%s' ", owner); + } + enumerator->destroy(enumerator); + printf("\n"); + } vici_free_res(res); return ret; }