Fossil SCM

Put "--" before the host name on the ssh command lines of "fossil patch push", "fossil patch pull" and "fossil ui HOST:REPO", as the ssh transport already does, so that ssh does not take a user name that begins with "-" for an option.

dmestas 2026-11-14 16:37 UTC ssh-arg-quoting
Commit dda3a7874c8b262c0980ab9297b15dbbbd281b2f336ebd753844aba569defc46
2 files changed +1 -1 +1 -1
+1 -1
--- src/main.c
+++ src/main.c
@@ -3572,11 +3572,11 @@
35723572
blob_init(&ssh, 0, 0);
35733573
for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
35743574
blob_reset(&ssh);
35753575
transport_ssh_command(&ssh);
35763576
blob_appendf(&ssh,
3577
- " -t -L 127.0.0.1:%d:127.0.0.1:%d %!$",
3577
+ " -t -L 127.0.0.1:%d:127.0.0.1:%d -- %!$",
35783578
iPort, iPort, zRemote
35793579
);
35803580
if( zFossilCmd==0 ){
35813581
if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
35823582
ssh_add_path_argument(&ssh);
35833583
--- src/main.c
+++ src/main.c
@@ -3572,11 +3572,11 @@
3572 blob_init(&ssh, 0, 0);
3573 for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
3574 blob_reset(&ssh);
3575 transport_ssh_command(&ssh);
3576 blob_appendf(&ssh,
3577 " -t -L 127.0.0.1:%d:127.0.0.1:%d %!$",
3578 iPort, iPort, zRemote
3579 );
3580 if( zFossilCmd==0 ){
3581 if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
3582 ssh_add_path_argument(&ssh);
3583
--- src/main.c
+++ src/main.c
@@ -3572,11 +3572,11 @@
3572 blob_init(&ssh, 0, 0);
3573 for(isRetry=0; isRetry<2 && !bRunning; isRetry++){
3574 blob_reset(&ssh);
3575 transport_ssh_command(&ssh);
3576 blob_appendf(&ssh,
3577 " -t -L 127.0.0.1:%d:127.0.0.1:%d -- %!$",
3578 iPort, iPort, zRemote
3579 );
3580 if( zFossilCmd==0 ){
3581 if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
3582 ssh_add_path_argument(&ssh);
3583
+1 -1
--- src/patch.c
+++ src/patch.c
@@ -756,11 +756,11 @@
756756
blob_appendf(&cmd, " patch %s%s %$ -", zRemoteCmd, zForce, zDir);
757757
}else{
758758
Blob remote;
759759
*(char*)(zDir-1) = 0;
760760
transport_ssh_command(&cmd);
761
- blob_appendf(&cmd, " -T");
761
+ blob_appendf(&cmd, " -T --"); /* End of switches */
762762
blob_append_escaped_arg(&cmd, zRemote, 0);
763763
blob_init(&remote, 0, 0);
764764
if( zFossilCmd==0 ){
765765
if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
766766
ssh_add_path_argument(&cmd);
767767
--- src/patch.c
+++ src/patch.c
@@ -756,11 +756,11 @@
756 blob_appendf(&cmd, " patch %s%s %$ -", zRemoteCmd, zForce, zDir);
757 }else{
758 Blob remote;
759 *(char*)(zDir-1) = 0;
760 transport_ssh_command(&cmd);
761 blob_appendf(&cmd, " -T");
762 blob_append_escaped_arg(&cmd, zRemote, 0);
763 blob_init(&remote, 0, 0);
764 if( zFossilCmd==0 ){
765 if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
766 ssh_add_path_argument(&cmd);
767
--- src/patch.c
+++ src/patch.c
@@ -756,11 +756,11 @@
756 blob_appendf(&cmd, " patch %s%s %$ -", zRemoteCmd, zForce, zDir);
757 }else{
758 Blob remote;
759 *(char*)(zDir-1) = 0;
760 transport_ssh_command(&cmd);
761 blob_appendf(&cmd, " -T --"); /* End of switches */
762 blob_append_escaped_arg(&cmd, zRemote, 0);
763 blob_init(&remote, 0, 0);
764 if( zFossilCmd==0 ){
765 if( ssh_needs_path_argument(zRemote,-1) ^ isRetry ){
766 ssh_add_path_argument(&cmd);
767

Keyboard Shortcuts

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