Fossil

Check-in [9284bfb1]
Login

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

Overview
Comment:Fix logic so ignoring login requirement only affects ssh:// URLs.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ssh-test-http
Files: files | file ages | folders
SHA1:9284bfb157da42c03070ba13521855eaa98b9e25
User & Date: andybradford 2013-08-09 07:49:44
Context
2013-08-09
07:56
Correct typo that resulted in space being on the wrong side of the word. check-in: 738b5053 user: andybradford tags: ssh-test-http
07:49
Fix logic so ignoring login requirement only affects ssh:// URLs. check-in: 9284bfb1 user: andybradford tags: ssh-test-http
07:29
Reimplement the default test-http behavior while retaining the ability to use http to take advantage of Fossil capabilities with SSH URLs. check-in: 7c9347f9 user: andybradford tags: ssh-test-http
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/http.c.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  const char *zPw;     /* The user password */
  Blob pw;             /* The nonce with user password appended */
  Blob sig;            /* The signature field */

  zLogin = url_or_fossil_user();
  blob_zero(pLogin);
  if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ||
      url_ssh_use_http()==0 ){
    return;  /* If no login card for users "nobody" and "anonymous" */
  }
  blob_zero(&nonce);
  blob_zero(&pw);
  sha1sum_blob(pPayload, &nonce);
  blob_copy(&pw, &nonce);
  if( g.urlPasswd ){







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  const char *zPw;     /* The user password */
  Blob pw;             /* The nonce with user password appended */
  Blob sig;            /* The signature field */

  zLogin = url_or_fossil_user();
  blob_zero(pLogin);
  if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ||
      (g .urlIsSsh && url_ssh_use_http()==0 ) ){
    return;  /* If no login card for users "nobody" and "anonymous" */
  }
  blob_zero(&nonce);
  blob_zero(&pw);
  sha1sum_blob(pPayload, &nonce);
  blob_copy(&pw, &nonce);
  if( g.urlPasswd ){

Changes to src/url.c.

410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
}

/*
** Prompt the user for the password for g.urlUser.  Store the result
** in g.urlPasswd.
*/
void url_prompt_for_password(void){
  if( g.urlIsFile || url_ssh_use_http()==0 ) return;
  if( isatty(fileno(stdin))
   && (g.urlFlags & URL_PROMPT_PW)!=0
   && (g.urlFlags & URL_PROMPTED)==0
  ){
    g.urlFlags |= URL_PROMPTED;
    g.urlPasswd = prompt_for_user_password(url_or_fossil_user());
    if( g.urlPasswd[0]
................................................................................
  }
}

/*
** Return true if http mode is in use for "ssh://" URL.
*/
int url_ssh_use_http(void){
  return g.urlIsSsh && ( db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp );
}

/*
** Remember the URL if requested.
*/
void url_remember(void){
  db_set("last-sync-url", g.urlCanonical, 0);







|







 







|







410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
}

/*
** Prompt the user for the password for g.urlUser.  Store the result
** in g.urlPasswd.
*/
void url_prompt_for_password(void){
  if( g.urlIsFile || ( g.urlIsSsh && url_ssh_use_http()==0 ) ) return;
  if( isatty(fileno(stdin))
   && (g.urlFlags & URL_PROMPT_PW)!=0
   && (g.urlFlags & URL_PROMPTED)==0
  ){
    g.urlFlags |= URL_PROMPTED;
    g.urlPasswd = prompt_for_user_password(url_or_fossil_user());
    if( g.urlPasswd[0]
................................................................................
  }
}

/*
** Return true if http mode is in use for "ssh://" URL.
*/
int url_ssh_use_http(void){
  return db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp;
}

/*
** Remember the URL if requested.
*/
void url_remember(void){
  db_set("last-sync-url", g.urlCanonical, 0);