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.

drh 2025-04-15 14:54 trunk
Commit af78e282bb0a068f8f0d3254d41f0e414f6397f9cfc6c63e32b5df3b34a0e42e
2 files changed +1 -1 +2 -1
+1 -1
--- src/cgi.c
+++ src/cgi.c
@@ -2610,11 +2610,11 @@
26102610
26112611
/* Convert the zIpAddr text string into an actual IPv6 address */
26122612
if( inet_pton(AF_INET6, zIpAddr, &inaddr.sin6_addr)==0
26132613
&& (z4to6[0]==0 || inet_pton(AF_INET6, z4to6, &inaddr.sin6_addr)==0)
26142614
){
2615
- fossil_fatal("not a valid IP address: %s", z4to6);
2615
+ fossil_fatal("not a valid IP address: %s", zIpAddr);
26162616
}
26172617
}else if( flags & HTTP_SERVER_LOCALHOST ){
26182618
/* Bind to the loop-back IP address */
26192619
inaddr.sin6_addr = in6addr_loopback;
26202620
}else{
26212621
--- 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 @@
35233523
}
35243524
blob_append_escaped_arg(&ssh, "fossil", 1);
35253525
}else{
35263526
blob_appendf(&ssh, " %$", zFossilCmd);
35273527
}
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);
35293530
if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound);
35303531
if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob);
35313532
if( g.zCkoutAlias ) blob_appendf(&ssh," --ckout-alias %!$",g.zCkoutAlias);
35323533
if( zExtPage ){
35333534
if( !file_is_absolute_path(zExtPage) ){
35343535
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button