Fossil SCM
Fix issues with file-to-file sync. Allow --localauth to enable --private syncing.
Commit
bbf257dc9e633c29c6b2d2cae8f5c7da50e43241
Parent
e3e368c3298ee69…
2 files changed
+1
-1
+4
+1
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -302,11 +302,11 @@ | ||
| 302 | 302 | if( g.urlIsSsh ){ |
| 303 | 303 | fprintf(sshOut, "\n\n"); |
| 304 | 304 | }else if( g.urlIsFile ){ |
| 305 | 305 | char *zCmd; |
| 306 | 306 | fclose(transport.pFile); |
| 307 | - zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1", | |
| 307 | + zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1 --localauth", | |
| 308 | 308 | fossil_nameofexe(), g.urlName, transport.zOutFile, transport.zInFile |
| 309 | 309 | ); |
| 310 | 310 | fossil_system(zCmd); |
| 311 | 311 | free(zCmd); |
| 312 | 312 | transport.pFile = fopen(transport.zInFile, "rb"); |
| 313 | 313 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | if( g.urlIsSsh ){ |
| 303 | fprintf(sshOut, "\n\n"); |
| 304 | }else if( g.urlIsFile ){ |
| 305 | char *zCmd; |
| 306 | fclose(transport.pFile); |
| 307 | zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1", |
| 308 | fossil_nameofexe(), g.urlName, transport.zOutFile, transport.zInFile |
| 309 | ); |
| 310 | fossil_system(zCmd); |
| 311 | free(zCmd); |
| 312 | transport.pFile = fopen(transport.zInFile, "rb"); |
| 313 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -302,11 +302,11 @@ | |
| 302 | if( g.urlIsSsh ){ |
| 303 | fprintf(sshOut, "\n\n"); |
| 304 | }else if( g.urlIsFile ){ |
| 305 | char *zCmd; |
| 306 | fclose(transport.pFile); |
| 307 | zCmd = mprintf("\"%s\" http \"%s\" \"%s\" \"%s\" 127.0.0.1 --localauth", |
| 308 | fossil_nameofexe(), g.urlName, transport.zOutFile, transport.zInFile |
| 309 | ); |
| 310 | fossil_system(zCmd); |
| 311 | free(zCmd); |
| 312 | transport.pFile = fopen(transport.zInFile, "rb"); |
| 313 |
+4
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -423,13 +423,15 @@ | ||
| 423 | 423 | pXfer->nDeltaSent++; |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | remote_has(rid); |
| 427 | 427 | blob_reset(&uuid); |
| 428 | +#if 0 | |
| 428 | 429 | if( blob_buffer(pXfer->pOut)[blob_size(pXfer->pOut)-1]!='\n' ){ |
| 429 | 430 | blob_appendf(pXfer->pOut, "\n", 1); |
| 430 | 431 | } |
| 432 | +#endif | |
| 431 | 433 | } |
| 432 | 434 | |
| 433 | 435 | /* |
| 434 | 436 | ** Send the file identified by rid as a compressed artifact. Basically, |
| 435 | 437 | ** send the content exactly as it appears in the BLOB table using |
| @@ -821,10 +823,11 @@ | ||
| 821 | 823 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 822 | 824 | ); |
| 823 | 825 | manifest_crosslink_begin(); |
| 824 | 826 | while( blob_line(xfer.pIn, &xfer.line) ){ |
| 825 | 827 | if( blob_buffer(&xfer.line)[0]=='#' ) continue; |
| 828 | + if( blob_size(&xfer.line)==0 ) continue; | |
| 826 | 829 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 827 | 830 | |
| 828 | 831 | /* file UUID SIZE \n CONTENT |
| 829 | 832 | ** file UUID DELTASRC SIZE \n CONTENT |
| 830 | 833 | ** |
| @@ -1129,10 +1132,11 @@ | ||
| 1129 | 1132 | ** If the user has the "x" privilege (which must be set explicitly - |
| 1130 | 1133 | ** it is not automatic with "a" or "s") then this pragma causes |
| 1131 | 1134 | ** private information to be pulled in addition to public records. |
| 1132 | 1135 | */ |
| 1133 | 1136 | if( blob_eq(&xfer.aToken[1], "send-private") ){ |
| 1137 | + login_check_credentials(); | |
| 1134 | 1138 | if( !g.okPrivate ){ |
| 1135 | 1139 | server_private_xfer_not_authorized(); |
| 1136 | 1140 | }else{ |
| 1137 | 1141 | xfer.syncPrivate = 1; |
| 1138 | 1142 | } |
| 1139 | 1143 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -423,13 +423,15 @@ | |
| 423 | pXfer->nDeltaSent++; |
| 424 | } |
| 425 | } |
| 426 | remote_has(rid); |
| 427 | blob_reset(&uuid); |
| 428 | if( blob_buffer(pXfer->pOut)[blob_size(pXfer->pOut)-1]!='\n' ){ |
| 429 | blob_appendf(pXfer->pOut, "\n", 1); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | /* |
| 434 | ** Send the file identified by rid as a compressed artifact. Basically, |
| 435 | ** send the content exactly as it appears in the BLOB table using |
| @@ -821,10 +823,11 @@ | |
| 821 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 822 | ); |
| 823 | manifest_crosslink_begin(); |
| 824 | while( blob_line(xfer.pIn, &xfer.line) ){ |
| 825 | if( blob_buffer(&xfer.line)[0]=='#' ) continue; |
| 826 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 827 | |
| 828 | /* file UUID SIZE \n CONTENT |
| 829 | ** file UUID DELTASRC SIZE \n CONTENT |
| 830 | ** |
| @@ -1129,10 +1132,11 @@ | |
| 1129 | ** If the user has the "x" privilege (which must be set explicitly - |
| 1130 | ** it is not automatic with "a" or "s") then this pragma causes |
| 1131 | ** private information to be pulled in addition to public records. |
| 1132 | */ |
| 1133 | if( blob_eq(&xfer.aToken[1], "send-private") ){ |
| 1134 | if( !g.okPrivate ){ |
| 1135 | server_private_xfer_not_authorized(); |
| 1136 | }else{ |
| 1137 | xfer.syncPrivate = 1; |
| 1138 | } |
| 1139 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -423,13 +423,15 @@ | |
| 423 | pXfer->nDeltaSent++; |
| 424 | } |
| 425 | } |
| 426 | remote_has(rid); |
| 427 | blob_reset(&uuid); |
| 428 | #if 0 |
| 429 | if( blob_buffer(pXfer->pOut)[blob_size(pXfer->pOut)-1]!='\n' ){ |
| 430 | blob_appendf(pXfer->pOut, "\n", 1); |
| 431 | } |
| 432 | #endif |
| 433 | } |
| 434 | |
| 435 | /* |
| 436 | ** Send the file identified by rid as a compressed artifact. Basically, |
| 437 | ** send the content exactly as it appears in the BLOB table using |
| @@ -821,10 +823,11 @@ | |
| 823 | "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);" |
| 824 | ); |
| 825 | manifest_crosslink_begin(); |
| 826 | while( blob_line(xfer.pIn, &xfer.line) ){ |
| 827 | if( blob_buffer(&xfer.line)[0]=='#' ) continue; |
| 828 | if( blob_size(&xfer.line)==0 ) continue; |
| 829 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 830 | |
| 831 | /* file UUID SIZE \n CONTENT |
| 832 | ** file UUID DELTASRC SIZE \n CONTENT |
| 833 | ** |
| @@ -1129,10 +1132,11 @@ | |
| 1132 | ** If the user has the "x" privilege (which must be set explicitly - |
| 1133 | ** it is not automatic with "a" or "s") then this pragma causes |
| 1134 | ** private information to be pulled in addition to public records. |
| 1135 | */ |
| 1136 | if( blob_eq(&xfer.aToken[1], "send-private") ){ |
| 1137 | login_check_credentials(); |
| 1138 | if( !g.okPrivate ){ |
| 1139 | server_private_xfer_not_authorized(); |
| 1140 | }else{ |
| 1141 | xfer.syncPrivate = 1; |
| 1142 | } |
| 1143 |