]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
swanctl: Don't print status message if nothing was loaded to stderr
authorTobias Brunner <tobias@strongswan.org>
Wed, 27 Jan 2021 13:51:56 +0000 (14:51 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 4 Feb 2021 15:50:36 +0000 (16:50 +0100)
This is not an error (as reflected by the returned status code) so we
should not print to stderr as output there might still be considered an
error (or at least an audit-worthy event) by some scripts.

src/swanctl/commands/load_authorities.c
src/swanctl/commands/load_conns.c
src/swanctl/commands/load_pools.c

index 32f59b4b64a12f116f2bd0a069c5e665a0ee4487..832509bf4d739084d8cea2fd12f1a77150dfc8d2 100644 (file)
@@ -292,7 +292,7 @@ int load_authorities_cfg(vici_conn_t *conn, command_format_options_t format,
        }
        if (found == 0)
        {
-               fprintf(stderr, "no authorities found, %u unloaded\n", unloaded);
+               printf("no authorities found, %u unloaded\n", unloaded);
                return 0;
        }
        if (loaded == found)
@@ -301,6 +301,7 @@ int load_authorities_cfg(vici_conn_t *conn, command_format_options_t format,
                           loaded, unloaded);
                return 0;
        }
+
        fprintf(stderr, "loaded %u of %u authorities, %u failed to load, "
                        "%u unloaded\n", loaded, found, found - loaded, unloaded);
        return EINVAL;
index de23816fb43c094b2d56972a3086d2eeef8d53b4..47e434956bbdf1259969432f242d36d1c939acf9 100644 (file)
@@ -410,7 +410,7 @@ int load_conns_cfg(vici_conn_t *conn, command_format_options_t format,
        }
        if (found == 0)
        {
-               fprintf(stderr, "no connections found, %u unloaded\n", unloaded);
+               printf("no connections found, %u unloaded\n", unloaded);
                return 0;
        }
        if (loaded == found)
index 0ff6827e11ea68c8382a38bb558237f9c45a097e..a3bbcfd3ae5967102bd8e93c1b8773e5ed308cb3 100644 (file)
@@ -233,7 +233,7 @@ int load_pools_cfg(vici_conn_t *conn, command_format_options_t format,
        }
        if (found == 0)
        {
-               fprintf(stderr, "no pools found, %u unloaded\n", unloaded);
+               printf("no pools found, %u unloaded\n", unloaded);
                return 0;
        }
        if (loaded == found)