Fossil

Check-in [d1eb341f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid prompting for the password for SSH syncs, since the password is never used. Omit debugging output on SSH syncs.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d1eb341f8020397940bcb14523c8543d5cfc8416
User & Date: drh 2012-08-31 19:57:42
Context
2012-08-31
20:46
Revert change [208d67675c]. The policy is to keep the Fossil source code ASCII even if Fossil itself is able to handle non-ASCII source files. Furthermore, the [208d67675c] change broken things. Also backout change [34fcb9634e] since it complicates the C code with unnecessary backslash characters in order to changes single-quotes to double-quotes in the generated HTML and Javascript, which is pointless. check-in: c19f34cb user: drh tags: trunk
19:57
Avoid prompting for the password for SSH syncs, since the password is never used. Omit debugging output on SSH syncs. check-in: d1eb341f user: drh tags: trunk
19:47
Improved handling of command-line arguments under windows. Possible fix for ticket [c8c0b78c84]. check-in: 0c7ae64a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/http_transport.c.

474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
  }
   /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
  return &transport.pBuf[iStart];
}

void transport_global_shutdown(void){
  if( g.urlIsSsh && sshPid ){
    printf("Closing SSH tunnel: ");
    fflush(stdout);
    pclose2(sshIn, sshOut, sshPid);
    sshPid = 0;
  }
  if( g.urlIsHttps ){
    #ifdef FOSSIL_ENABLE_SSL
    ssl_global_shutdown();
    #endif
  }else{
    socket_global_shutdown();
  }
}







|












474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
  }
   /* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
  return &transport.pBuf[iStart];
}

void transport_global_shutdown(void){
  if( g.urlIsSsh && sshPid ){
    /*printf("Closing SSH tunnel: ");*/
    fflush(stdout);
    pclose2(sshIn, sshOut, sshPid);
    sshPid = 0;
  }
  if( g.urlIsHttps ){
    #ifdef FOSSIL_ENABLE_SSL
    ssl_global_shutdown();
    #endif
  }else{
    socket_global_shutdown();
  }
}

Changes to src/sync.c.

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
    zUrl = g.argv[2];
  }
  if( zUrl==0 ){
    if( urlOptional ) fossil_exit(0);
    usage("URL");
  }
  url_parse(zUrl);
  if( g.urlUser!=0 && g.urlPasswd==0 ){
    if( zPw==0 ){
      url_prompt_for_password();
    }else{
      g.urlPasswd = mprintf("%s", zPw);
    }
  }
  if( !g.dontKeepUrl ){
................................................................................
  }
  if( g.argc==3 ){
    if( fossil_strcmp(g.argv[2],"off")==0 ){
      db_unset("last-sync-url", 0);
      db_unset("last-sync-pw", 0);
    }else{
      url_parse(g.argv[2]);
      if( g.urlUser && g.urlPasswd==0 ){
        url_prompt_for_password();
      }
      db_set("last-sync-url", g.urlCanonical, 0);
      if( g.urlPasswd ){
        db_set("last-sync-pw", obscure(g.urlPasswd), 0);
      }else{
        db_unset("last-sync-pw", 0);







|







 







|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
    zUrl = g.argv[2];
  }
  if( zUrl==0 ){
    if( urlOptional ) fossil_exit(0);
    usage("URL");
  }
  url_parse(zUrl);
  if( g.urlUser!=0 && g.urlPasswd==0 && g.urlIsSsh==0 ){
    if( zPw==0 ){
      url_prompt_for_password();
    }else{
      g.urlPasswd = mprintf("%s", zPw);
    }
  }
  if( !g.dontKeepUrl ){
................................................................................
  }
  if( g.argc==3 ){
    if( fossil_strcmp(g.argv[2],"off")==0 ){
      db_unset("last-sync-url", 0);
      db_unset("last-sync-pw", 0);
    }else{
      url_parse(g.argv[2]);
      if( g.urlUser && g.urlPasswd==0 && g.urlIsSsh==0 ){
        url_prompt_for_password();
      }
      db_set("last-sync-url", g.urlCanonical, 0);
      if( g.urlPasswd ){
        db_set("last-sync-pw", obscure(g.urlPasswd), 0);
      }else{
        db_unset("last-sync-pw", 0);

Changes to src/url.c.

388
389
390
391
392
393
394

395
396
397
398
/* Preemptively prompt for a password if a username is given in the
** URL but no password.
*/
void url_get_password_if_needed(void){
  if( (g.urlUser && g.urlUser[0])
   && (g.urlPasswd==0 || g.urlPasswd[0]==0)
   && isatty(fileno(stdin)) 

  ){
    url_prompt_for_password();
  }
}







>




388
389
390
391
392
393
394
395
396
397
398
399
/* Preemptively prompt for a password if a username is given in the
** URL but no password.
*/
void url_get_password_if_needed(void){
  if( (g.urlUser && g.urlUser[0])
   && (g.urlPasswd==0 || g.urlPasswd[0]==0)
   && isatty(fileno(stdin)) 
   && g.urlIsSsh==0
  ){
    url_prompt_for_password();
  }
}