BUG/MINOR: ssl/crt-list: warn when a line is malformated
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 7 Feb 2023 16:06:35 +0000 (17:06 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 7 Feb 2023 16:28:54 +0000 (17:28 +0100)
Display a warning when some text exists between the filename and the
options. This part is completely ignored so if there are filters here,
they were never parsed.

This could be backported in every versions. In the older versions, the
parsing was done in ssl_sock_load_cert_list_file() in ssl_sock.c.

src/ssl_crtlist.c

index 825f380..31428d6 100644 (file)
@@ -403,6 +403,11 @@ int crtlist_parse_line(char *line, char **crt_path, struct crtlist_entry *entry,
        *crt_path = args[0];
 
        if (ssl_b) {
+               if (ssl_b > 1) {
+                       memprintf(err, "parsing [%s:%d]: malformated line, filters can't be between filename and options!", file, linenum);
+                       cfgerr |= ERR_WARN;
+               }
+
                ssl_conf = calloc(1, sizeof *ssl_conf);
                if (!ssl_conf) {
                        memprintf(err, "not enough memory!");