Fossil SCM

Teach the chat pull subcommand to prompt for a password if no password has been remembered for the remote. Resolves the problem reported in [forum:ea82cf10d4|forum post ea82cf10d4].

stephan 2024-02-23 00:38 trunk
Commit 003c3e6c8a8863463e46954ea77e2385ec96e7d67bb998a53f687afc22d0b68a
1 file changed +9 -1
+9 -1
--- src/chat.c
+++ src/chat.c
@@ -1217,11 +1217,19 @@
12171217
zObs = obscure(g.url.user);
12181218
blob_appendf(&reqUri, "&resid=%t", zObs);
12191219
fossil_free(zObs);
12201220
}
12211221
zPw = g.url.passwd;
1222
- if( zPw==0 && isDefaultUrl ) zPw = unobscure(db_get("last-sync-pw", 0));
1222
+ if( zPw==0 && isDefaultUrl ){
1223
+ zPw = unobscure(db_get("last-sync-pw", 0));
1224
+ if( zPw==0 ){
1225
+ /* Can happen if "remember password" is not used. */
1226
+ g.url.flags |= URL_PROMPT_PW;
1227
+ url_prompt_for_password();
1228
+ zPw = g.url.passwd;
1229
+ }
1230
+ }
12231231
if( zPw && zPw[0] ){
12241232
zObs = obscure(zPw);
12251233
blob_appendf(&reqUri, "&token=%t", zObs);
12261234
fossil_free(zObs);
12271235
}
12281236
--- src/chat.c
+++ src/chat.c
@@ -1217,11 +1217,19 @@
1217 zObs = obscure(g.url.user);
1218 blob_appendf(&reqUri, "&resid=%t", zObs);
1219 fossil_free(zObs);
1220 }
1221 zPw = g.url.passwd;
1222 if( zPw==0 && isDefaultUrl ) zPw = unobscure(db_get("last-sync-pw", 0));
 
 
 
 
 
 
 
 
1223 if( zPw && zPw[0] ){
1224 zObs = obscure(zPw);
1225 blob_appendf(&reqUri, "&token=%t", zObs);
1226 fossil_free(zObs);
1227 }
1228
--- src/chat.c
+++ src/chat.c
@@ -1217,11 +1217,19 @@
1217 zObs = obscure(g.url.user);
1218 blob_appendf(&reqUri, "&resid=%t", zObs);
1219 fossil_free(zObs);
1220 }
1221 zPw = g.url.passwd;
1222 if( zPw==0 && isDefaultUrl ){
1223 zPw = unobscure(db_get("last-sync-pw", 0));
1224 if( zPw==0 ){
1225 /* Can happen if "remember password" is not used. */
1226 g.url.flags |= URL_PROMPT_PW;
1227 url_prompt_for_password();
1228 zPw = g.url.passwd;
1229 }
1230 }
1231 if( zPw && zPw[0] ){
1232 zObs = obscure(zPw);
1233 blob_appendf(&reqUri, "&token=%t", zObs);
1234 fossil_free(zObs);
1235 }
1236

Keyboard Shortcuts

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