Fossil SCM
Start to address backwards compatibility for open fossils by prompting for missing password.
Commit
18caf358f0868eaeb8c50d2ffb0d914ec126f810
Parent
087cae847dbf0c7…
2 files changed
+7
+9
-2
+7
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -48,13 +48,20 @@ | ||
| 48 | 48 | } |
| 49 | 49 | }else{ |
| 50 | 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | 51 | } |
| 52 | 52 | url_parse(0, URL_REMEMBER); |
| 53 | + if( g.urlIsSsh ){ | |
| 54 | + clone_ssh_db_options(); | |
| 55 | + } | |
| 53 | 56 | if( g.urlProtocol==0 ) return 0; |
| 54 | 57 | if( g.urlUser!=0 && g.urlPasswd==0 ){ |
| 55 | 58 | g.urlPasswd = unobscure(db_get("last-sync-pw", 0)); |
| 59 | + } | |
| 60 | + if( g.urlIsSsh && g.urlPasswd==0 ){ | |
| 61 | + g.urlFlags |= URL_PROMPT_PW; | |
| 62 | + url_prompt_for_password(); | |
| 56 | 63 | } |
| 57 | 64 | #if 0 /* Disabled for now */ |
| 58 | 65 | if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){ |
| 59 | 66 | /* When doing an automatic pull, also automatically pull shuns from |
| 60 | 67 | ** the server if pull_shuns is enabled. |
| 61 | 68 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -48,13 +48,20 @@ | |
| 48 | } |
| 49 | }else{ |
| 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | } |
| 52 | url_parse(0, URL_REMEMBER); |
| 53 | if( g.urlProtocol==0 ) return 0; |
| 54 | if( g.urlUser!=0 && g.urlPasswd==0 ){ |
| 55 | g.urlPasswd = unobscure(db_get("last-sync-pw", 0)); |
| 56 | } |
| 57 | #if 0 /* Disabled for now */ |
| 58 | if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){ |
| 59 | /* When doing an automatic pull, also automatically pull shuns from |
| 60 | ** the server if pull_shuns is enabled. |
| 61 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -48,13 +48,20 @@ | |
| 48 | } |
| 49 | }else{ |
| 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | } |
| 52 | url_parse(0, URL_REMEMBER); |
| 53 | if( g.urlIsSsh ){ |
| 54 | clone_ssh_db_options(); |
| 55 | } |
| 56 | if( g.urlProtocol==0 ) return 0; |
| 57 | if( g.urlUser!=0 && g.urlPasswd==0 ){ |
| 58 | g.urlPasswd = unobscure(db_get("last-sync-pw", 0)); |
| 59 | } |
| 60 | if( g.urlIsSsh && g.urlPasswd==0 ){ |
| 61 | g.urlFlags |= URL_PROMPT_PW; |
| 62 | url_prompt_for_password(); |
| 63 | } |
| 64 | #if 0 /* Disabled for now */ |
| 65 | if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){ |
| 66 | /* When doing an automatic pull, also automatically pull shuns from |
| 67 | ** the server if pull_shuns is enabled. |
| 68 |
+9
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1336,11 +1336,13 @@ | ||
| 1336 | 1336 | |
| 1337 | 1337 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1338 | 1338 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0 |
| 1339 | 1339 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1340 | 1340 | |
| 1341 | - clone_ssh_db_options(); | |
| 1341 | + if( g.urlIsSsh ){ | |
| 1342 | + clone_ssh_db_options(); | |
| 1343 | + } | |
| 1342 | 1344 | transport_stats(0, 0, 1); |
| 1343 | 1345 | socket_global_init(); |
| 1344 | 1346 | memset(&xfer, 0, sizeof(xfer)); |
| 1345 | 1347 | xfer.pIn = &recv; |
| 1346 | 1348 | xfer.pOut = &send; |
| @@ -1744,11 +1746,16 @@ | ||
| 1744 | 1746 | fossil_print("Error: %s\n", zMsg); |
| 1745 | 1747 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1746 | 1748 | if( nCycle<2 ){ |
| 1747 | 1749 | g.urlPasswd = 0; |
| 1748 | 1750 | go = 1; |
| 1749 | - if( g.cgiOutput==0 ) url_prompt_for_password(); | |
| 1751 | + if( g.cgiOutput==0 ){ | |
| 1752 | + if( g.urlIsSsh ){ | |
| 1753 | + g.urlFlags |= URL_PROMPT_PW; | |
| 1754 | + } | |
| 1755 | + url_prompt_for_password(); | |
| 1756 | + } | |
| 1750 | 1757 | } |
| 1751 | 1758 | }else{ |
| 1752 | 1759 | blob_appendf(&xfer.err, "server says: %s\n", zMsg); |
| 1753 | 1760 | nErr++; |
| 1754 | 1761 | } |
| 1755 | 1762 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1336,11 +1336,13 @@ | |
| 1336 | |
| 1337 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1338 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0 |
| 1339 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1340 | |
| 1341 | clone_ssh_db_options(); |
| 1342 | transport_stats(0, 0, 1); |
| 1343 | socket_global_init(); |
| 1344 | memset(&xfer, 0, sizeof(xfer)); |
| 1345 | xfer.pIn = &recv; |
| 1346 | xfer.pOut = &send; |
| @@ -1744,11 +1746,16 @@ | |
| 1744 | fossil_print("Error: %s\n", zMsg); |
| 1745 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1746 | if( nCycle<2 ){ |
| 1747 | g.urlPasswd = 0; |
| 1748 | go = 1; |
| 1749 | if( g.cgiOutput==0 ) url_prompt_for_password(); |
| 1750 | } |
| 1751 | }else{ |
| 1752 | blob_appendf(&xfer.err, "server says: %s\n", zMsg); |
| 1753 | nErr++; |
| 1754 | } |
| 1755 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1336,11 +1336,13 @@ | |
| 1336 | |
| 1337 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1338 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE))==0 |
| 1339 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1340 | |
| 1341 | if( g.urlIsSsh ){ |
| 1342 | clone_ssh_db_options(); |
| 1343 | } |
| 1344 | transport_stats(0, 0, 1); |
| 1345 | socket_global_init(); |
| 1346 | memset(&xfer, 0, sizeof(xfer)); |
| 1347 | xfer.pIn = &recv; |
| 1348 | xfer.pOut = &send; |
| @@ -1744,11 +1746,16 @@ | |
| 1746 | fossil_print("Error: %s\n", zMsg); |
| 1747 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1748 | if( nCycle<2 ){ |
| 1749 | g.urlPasswd = 0; |
| 1750 | go = 1; |
| 1751 | if( g.cgiOutput==0 ){ |
| 1752 | if( g.urlIsSsh ){ |
| 1753 | g.urlFlags |= URL_PROMPT_PW; |
| 1754 | } |
| 1755 | url_prompt_for_password(); |
| 1756 | } |
| 1757 | } |
| 1758 | }else{ |
| 1759 | blob_appendf(&xfer.err, "server says: %s\n", zMsg); |
| 1760 | nErr++; |
| 1761 | } |
| 1762 |