Fossil SCM
Added missing db_unprotect()/db_protect_pop() to the login-group command.
Commit
ca5a5c7948cc68317ea16372db65ec11bff2399981196adc085ce9ad028a70b0
Parent
8aaaa4f5333bba5…
2 files changed
+1
-1
+2
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -359,11 +359,11 @@ | ||
| 359 | 359 | ** |
| 360 | 360 | ** Each of these routines pushes the previous protection mask onto |
| 361 | 361 | ** a finite-size stack. Each should be followed by a call to |
| 362 | 362 | ** db_protect_pop() to pop the stack and restore the protections that |
| 363 | 363 | ** existed prior to the call. The protection mask stack has a limited |
| 364 | -** depth, so take care not to next calls too deeply. | |
| 364 | +** depth, so take care not to nest calls too deeply. | |
| 365 | 365 | ** |
| 366 | 366 | ** About Database Write Protection |
| 367 | 367 | ** ------------------------------- |
| 368 | 368 | ** |
| 369 | 369 | ** This is *not* a primary means of defending the application from |
| 370 | 370 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -359,11 +359,11 @@ | |
| 359 | ** |
| 360 | ** Each of these routines pushes the previous protection mask onto |
| 361 | ** a finite-size stack. Each should be followed by a call to |
| 362 | ** db_protect_pop() to pop the stack and restore the protections that |
| 363 | ** existed prior to the call. The protection mask stack has a limited |
| 364 | ** depth, so take care not to next calls too deeply. |
| 365 | ** |
| 366 | ** About Database Write Protection |
| 367 | ** ------------------------------- |
| 368 | ** |
| 369 | ** This is *not* a primary means of defending the application from |
| 370 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -359,11 +359,11 @@ | |
| 359 | ** |
| 360 | ** Each of these routines pushes the previous protection mask onto |
| 361 | ** a finite-size stack. Each should be followed by a call to |
| 362 | ** db_protect_pop() to pop the stack and restore the protections that |
| 363 | ** existed prior to the call. The protection mask stack has a limited |
| 364 | ** depth, so take care not to nest calls too deeply. |
| 365 | ** |
| 366 | ** About Database Write Protection |
| 367 | ** ------------------------------- |
| 368 | ** |
| 369 | ** This is *not* a primary means of defending the application from |
| 370 |
+2
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1985,10 +1985,11 @@ | ||
| 1985 | 1985 | ** other repository and on our own repository. |
| 1986 | 1986 | */ |
| 1987 | 1987 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1988 | 1988 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1989 | 1989 | db_begin_transaction(); |
| 1990 | + db_unprotect(PROTECT_CONFIG); | |
| 1990 | 1991 | db_multi_exec( |
| 1991 | 1992 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1992 | 1993 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1993 | 1994 | "INSERT INTO \"%w\".config(name,value) " |
| 1994 | 1995 | " SELECT 'peer-name-%q', value FROM other.config" |
| @@ -2008,10 +2009,11 @@ | ||
| 2008 | 2009 | "REPLACE INTO \"%w\".config(name,value)" |
| 2009 | 2010 | " SELECT name, value FROM other.config" |
| 2010 | 2011 | " WHERE name GLOB 'peer-*' OR name GLOB 'login-group-*'", |
| 2011 | 2012 | zSelf |
| 2012 | 2013 | ); |
| 2014 | + db_protect_pop(); | |
| 2013 | 2015 | db_end_transaction(0); |
| 2014 | 2016 | db_multi_exec("DETACH other"); |
| 2015 | 2017 | |
| 2016 | 2018 | /* Propagate the changes to all other members of the login-group */ |
| 2017 | 2019 | zSql = mprintf( |
| 2018 | 2020 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1985,10 +1985,11 @@ | |
| 1985 | ** other repository and on our own repository. |
| 1986 | */ |
| 1987 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1988 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1989 | db_begin_transaction(); |
| 1990 | db_multi_exec( |
| 1991 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1992 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1993 | "INSERT INTO \"%w\".config(name,value) " |
| 1994 | " SELECT 'peer-name-%q', value FROM other.config" |
| @@ -2008,10 +2009,11 @@ | |
| 2008 | "REPLACE INTO \"%w\".config(name,value)" |
| 2009 | " SELECT name, value FROM other.config" |
| 2010 | " WHERE name GLOB 'peer-*' OR name GLOB 'login-group-*'", |
| 2011 | zSelf |
| 2012 | ); |
| 2013 | db_end_transaction(0); |
| 2014 | db_multi_exec("DETACH other"); |
| 2015 | |
| 2016 | /* Propagate the changes to all other members of the login-group */ |
| 2017 | zSql = mprintf( |
| 2018 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1985,10 +1985,11 @@ | |
| 1985 | ** other repository and on our own repository. |
| 1986 | */ |
| 1987 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1988 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1989 | db_begin_transaction(); |
| 1990 | db_unprotect(PROTECT_CONFIG); |
| 1991 | db_multi_exec( |
| 1992 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1993 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| 1994 | "INSERT INTO \"%w\".config(name,value) " |
| 1995 | " SELECT 'peer-name-%q', value FROM other.config" |
| @@ -2008,10 +2009,11 @@ | |
| 2009 | "REPLACE INTO \"%w\".config(name,value)" |
| 2010 | " SELECT name, value FROM other.config" |
| 2011 | " WHERE name GLOB 'peer-*' OR name GLOB 'login-group-*'", |
| 2012 | zSelf |
| 2013 | ); |
| 2014 | db_protect_pop(); |
| 2015 | db_end_transaction(0); |
| 2016 | db_multi_exec("DETACH other"); |
| 2017 | |
| 2018 | /* Propagate the changes to all other members of the login-group */ |
| 2019 | zSql = mprintf( |
| 2020 |