]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: use MAXPATHLEN instead of PATH_MAX
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Aug 2013 14:59:39 +0000 (16:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 Aug 2013 14:59:39 +0000 (16:59 +0200)
Apollon Oikonomopoulos reported a build failure on Hurd where PATH_MAX
is not defined. The only place where it is referenced is ssl_sock.c,
all other places use MAXPATHLEN instead, with a fallback to 128 when
the OS does not define it. So let's switch to MAXPATHLEN as well.

src/ssl_sock.c

index ce1712d4f28ae98c46c108ca75523e7b1081fc2f..8169d7838fe7f7842a68016f08c9b1602dcedb31 100644 (file)
@@ -2543,14 +2543,14 @@ static int bind_parse_ciphers(char **args, int cur_arg, struct proxy *px, struct
 /* parse the "crt" bind keyword */
 static int bind_parse_crt(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
 {
-       char path[PATH_MAX];
+       char path[MAXPATHLEN];
        if (!*args[cur_arg + 1]) {
                memprintf(err, "'%s' : missing certificate location", args[cur_arg]);
                return ERR_ALERT | ERR_FATAL;
        }
 
        if ((*args[cur_arg + 1] != '/' ) && global.crt_base) {
-               if ((strlen(global.crt_base) + 1 + strlen(args[cur_arg + 1]) + 1) > PATH_MAX) {
+               if ((strlen(global.crt_base) + 1 + strlen(args[cur_arg + 1]) + 1) > MAXPATHLEN) {
                        memprintf(err, "'%s' : path too long", args[cur_arg]);
                        return ERR_ALERT | ERR_FATAL;
                }