Fossil SCM
For the "fossil ui remote:/" command, consistently use hardcoded IPv4 loopback addresses, to avoid inconsistent implementations of "localhost". Fix a bug in the error message output for the -P option.
Commit
af78e282bb0a068f8f0d3254d41f0e414f6397f9cfc6c63e32b5df3b34a0e42e
Parent
202d3ea2b5aa1d0…
2 files changed
+1
-1
+2
-1
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -2610,11 +2610,11 @@ | ||
| 2610 | 2610 | |
| 2611 | 2611 | /* Convert the zIpAddr text string into an actual IPv6 address */ |
| 2612 | 2612 | if( inet_pton(AF_INET6, zIpAddr, &inaddr.sin6_addr)==0 |
| 2613 | 2613 | && (z4to6[0]==0 || inet_pton(AF_INET6, z4to6, &inaddr.sin6_addr)==0) |
| 2614 | 2614 | ){ |
| 2615 | - fossil_fatal("not a valid IP address: %s", z4to6); | |
| 2615 | + fossil_fatal("not a valid IP address: %s", zIpAddr); | |
| 2616 | 2616 | } |
| 2617 | 2617 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2618 | 2618 | /* Bind to the loop-back IP address */ |
| 2619 | 2619 | inaddr.sin6_addr = in6addr_loopback; |
| 2620 | 2620 | }else{ |
| 2621 | 2621 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -2610,11 +2610,11 @@ | |
| 2610 | |
| 2611 | /* Convert the zIpAddr text string into an actual IPv6 address */ |
| 2612 | if( inet_pton(AF_INET6, zIpAddr, &inaddr.sin6_addr)==0 |
| 2613 | && (z4to6[0]==0 || inet_pton(AF_INET6, z4to6, &inaddr.sin6_addr)==0) |
| 2614 | ){ |
| 2615 | fossil_fatal("not a valid IP address: %s", z4to6); |
| 2616 | } |
| 2617 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2618 | /* Bind to the loop-back IP address */ |
| 2619 | inaddr.sin6_addr = in6addr_loopback; |
| 2620 | }else{ |
| 2621 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -2610,11 +2610,11 @@ | |
| 2610 | |
| 2611 | /* Convert the zIpAddr text string into an actual IPv6 address */ |
| 2612 | if( inet_pton(AF_INET6, zIpAddr, &inaddr.sin6_addr)==0 |
| 2613 | && (z4to6[0]==0 || inet_pton(AF_INET6, z4to6, &inaddr.sin6_addr)==0) |
| 2614 | ){ |
| 2615 | fossil_fatal("not a valid IP address: %s", zIpAddr); |
| 2616 | } |
| 2617 | }else if( flags & HTTP_SERVER_LOCALHOST ){ |
| 2618 | /* Bind to the loop-back IP address */ |
| 2619 | inaddr.sin6_addr = in6addr_loopback; |
| 2620 | }else{ |
| 2621 |
+2
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3523,11 +3523,12 @@ | ||
| 3523 | 3523 | } |
| 3524 | 3524 | blob_append_escaped_arg(&ssh, "fossil", 1); |
| 3525 | 3525 | }else{ |
| 3526 | 3526 | blob_appendf(&ssh, " %$", zFossilCmd); |
| 3527 | 3527 | } |
| 3528 | - blob_appendf(&ssh, " ui --nobrowser --localauth --port %d", iPort); | |
| 3528 | + blob_appendf(&ssh, " ui --nobrowser --localauth --port 127.0.0.1:%d", | |
| 3529 | + iPort); | |
| 3529 | 3530 | if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound); |
| 3530 | 3531 | if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob); |
| 3531 | 3532 | if( g.zCkoutAlias ) blob_appendf(&ssh," --ckout-alias %!$",g.zCkoutAlias); |
| 3532 | 3533 | if( zExtPage ){ |
| 3533 | 3534 | if( !file_is_absolute_path(zExtPage) ){ |
| 3534 | 3535 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3523,11 +3523,12 @@ | |
| 3523 | } |
| 3524 | blob_append_escaped_arg(&ssh, "fossil", 1); |
| 3525 | }else{ |
| 3526 | blob_appendf(&ssh, " %$", zFossilCmd); |
| 3527 | } |
| 3528 | blob_appendf(&ssh, " ui --nobrowser --localauth --port %d", iPort); |
| 3529 | if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound); |
| 3530 | if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob); |
| 3531 | if( g.zCkoutAlias ) blob_appendf(&ssh," --ckout-alias %!$",g.zCkoutAlias); |
| 3532 | if( zExtPage ){ |
| 3533 | if( !file_is_absolute_path(zExtPage) ){ |
| 3534 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3523,11 +3523,12 @@ | |
| 3523 | } |
| 3524 | blob_append_escaped_arg(&ssh, "fossil", 1); |
| 3525 | }else{ |
| 3526 | blob_appendf(&ssh, " %$", zFossilCmd); |
| 3527 | } |
| 3528 | blob_appendf(&ssh, " ui --nobrowser --localauth --port 127.0.0.1:%d", |
| 3529 | iPort); |
| 3530 | if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound); |
| 3531 | if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob); |
| 3532 | if( g.zCkoutAlias ) blob_appendf(&ssh," --ckout-alias %!$",g.zCkoutAlias); |
| 3533 | if( zExtPage ){ |
| 3534 | if( !file_is_absolute_path(zExtPage) ){ |
| 3535 |