Fossil SCM

Added db_unprotect/pop wrappers around the "clone --ssh-command" handling to avoid a bogus "unauthorized change to protected setting" error, as reported [forum:/forumpost/29027c6a67c280e7 | on the forum].

wyoung 2021-09-02 07:52 trunk
Commit d700f5ff4f215c6941d4466b2cb17bd3dc3bf818c4d6c1e21d78d2b8d21d3cf8
1 file changed +4
--- src/clone.c
+++ src/clone.c
@@ -353,11 +353,13 @@
353353
** Look for SSH clone command line options and setup in globals.
354354
*/
355355
void clone_ssh_find_options(void){
356356
const char *zSshCmd; /* SSH command string */
357357
358
+ db_unprotect(PROTECT_ALL);
358359
zSshCmd = find_option("ssh-command","c",1);
360
+ db_protect_pop();
359361
if( zSshCmd && zSshCmd[0] ){
360362
g.zSshCmd = mprintf("%s", zSshCmd);
361363
}
362364
}
363365
@@ -365,11 +367,13 @@
365367
** Set SSH options discovered in global variables (set from command line
366368
** options).
367369
*/
368370
void clone_ssh_db_set_options(void){
369371
if( g.zSshCmd && g.zSshCmd[0] ){
372
+ db_unprotect(PROTECT_ALL);
370373
db_set("ssh-command", g.zSshCmd, 0);
374
+ db_protect_pop();
371375
}
372376
}
373377
374378
/*
375379
** WEBPAGE: download
376380
--- src/clone.c
+++ src/clone.c
@@ -353,11 +353,13 @@
353 ** Look for SSH clone command line options and setup in globals.
354 */
355 void clone_ssh_find_options(void){
356 const char *zSshCmd; /* SSH command string */
357
 
358 zSshCmd = find_option("ssh-command","c",1);
 
359 if( zSshCmd && zSshCmd[0] ){
360 g.zSshCmd = mprintf("%s", zSshCmd);
361 }
362 }
363
@@ -365,11 +367,13 @@
365 ** Set SSH options discovered in global variables (set from command line
366 ** options).
367 */
368 void clone_ssh_db_set_options(void){
369 if( g.zSshCmd && g.zSshCmd[0] ){
 
370 db_set("ssh-command", g.zSshCmd, 0);
 
371 }
372 }
373
374 /*
375 ** WEBPAGE: download
376
--- src/clone.c
+++ src/clone.c
@@ -353,11 +353,13 @@
353 ** Look for SSH clone command line options and setup in globals.
354 */
355 void clone_ssh_find_options(void){
356 const char *zSshCmd; /* SSH command string */
357
358 db_unprotect(PROTECT_ALL);
359 zSshCmd = find_option("ssh-command","c",1);
360 db_protect_pop();
361 if( zSshCmd && zSshCmd[0] ){
362 g.zSshCmd = mprintf("%s", zSshCmd);
363 }
364 }
365
@@ -365,11 +367,13 @@
367 ** Set SSH options discovered in global variables (set from command line
368 ** options).
369 */
370 void clone_ssh_db_set_options(void){
371 if( g.zSshCmd && g.zSshCmd[0] ){
372 db_unprotect(PROTECT_ALL);
373 db_set("ssh-command", g.zSshCmd, 0);
374 db_protect_pop();
375 }
376 }
377
378 /*
379 ** WEBPAGE: download
380

Keyboard Shortcuts

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