Fossil SCM
Add missing db_unprotect() calls to backoffice.
Commit
c75dcc621bb0feeb51b0c8c01b1dbbf0847413b1ffe99d4afd7c8d8e31bb92a3
Parent
75deba73b5e00d6…
1 file changed
+4
+4
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -241,10 +241,11 @@ | ||
| 241 | 241 | ** process (1) no longer exists and the current time exceeds (2). |
| 242 | 242 | */ |
| 243 | 243 | static void backofficeReadLease(Lease *pLease){ |
| 244 | 244 | Stmt q; |
| 245 | 245 | memset(pLease, 0, sizeof(*pLease)); |
| 246 | + db_unprotect(PROTECT_CONFIG); | |
| 246 | 247 | db_prepare(&q, "SELECT value FROM repository.config" |
| 247 | 248 | " WHERE name='backoffice'"); |
| 248 | 249 | if( db_step(&q)==SQLITE_ROW ){ |
| 249 | 250 | const char *z = db_column_text(&q,0); |
| 250 | 251 | z = backofficeParseInt(z, &pLease->idCurrent); |
| @@ -251,10 +252,11 @@ | ||
| 251 | 252 | z = backofficeParseInt(z, &pLease->tmCurrent); |
| 252 | 253 | z = backofficeParseInt(z, &pLease->idNext); |
| 253 | 254 | backofficeParseInt(z, &pLease->tmNext); |
| 254 | 255 | } |
| 255 | 256 | db_finalize(&q); |
| 257 | + db_protect_pop(); | |
| 256 | 258 | } |
| 257 | 259 | |
| 258 | 260 | /* |
| 259 | 261 | ** Return a string that describes how long it has been since the |
| 260 | 262 | ** last backoffice run. The string is obtained from fossil_malloc(). |
| @@ -277,15 +279,17 @@ | ||
| 277 | 279 | |
| 278 | 280 | /* |
| 279 | 281 | ** Write a lease to the backoffice property |
| 280 | 282 | */ |
| 281 | 283 | static void backofficeWriteLease(Lease *pLease){ |
| 284 | + db_unprotect(PROTECT_CONFIG); | |
| 282 | 285 | db_multi_exec( |
| 283 | 286 | "REPLACE INTO repository.config(name,value,mtime)" |
| 284 | 287 | " VALUES('backoffice','%lld %lld %lld %lld',now())", |
| 285 | 288 | pLease->idCurrent, pLease->tmCurrent, |
| 286 | 289 | pLease->idNext, pLease->tmNext); |
| 290 | + db_protect_pop(); | |
| 287 | 291 | } |
| 288 | 292 | |
| 289 | 293 | /* |
| 290 | 294 | ** Check to see if the specified Win32 process is still alive. It |
| 291 | 295 | ** should be noted that even if this function returns non-zero, the |
| 292 | 296 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -241,10 +241,11 @@ | |
| 241 | ** process (1) no longer exists and the current time exceeds (2). |
| 242 | */ |
| 243 | static void backofficeReadLease(Lease *pLease){ |
| 244 | Stmt q; |
| 245 | memset(pLease, 0, sizeof(*pLease)); |
| 246 | db_prepare(&q, "SELECT value FROM repository.config" |
| 247 | " WHERE name='backoffice'"); |
| 248 | if( db_step(&q)==SQLITE_ROW ){ |
| 249 | const char *z = db_column_text(&q,0); |
| 250 | z = backofficeParseInt(z, &pLease->idCurrent); |
| @@ -251,10 +252,11 @@ | |
| 251 | z = backofficeParseInt(z, &pLease->tmCurrent); |
| 252 | z = backofficeParseInt(z, &pLease->idNext); |
| 253 | backofficeParseInt(z, &pLease->tmNext); |
| 254 | } |
| 255 | db_finalize(&q); |
| 256 | } |
| 257 | |
| 258 | /* |
| 259 | ** Return a string that describes how long it has been since the |
| 260 | ** last backoffice run. The string is obtained from fossil_malloc(). |
| @@ -277,15 +279,17 @@ | |
| 277 | |
| 278 | /* |
| 279 | ** Write a lease to the backoffice property |
| 280 | */ |
| 281 | static void backofficeWriteLease(Lease *pLease){ |
| 282 | db_multi_exec( |
| 283 | "REPLACE INTO repository.config(name,value,mtime)" |
| 284 | " VALUES('backoffice','%lld %lld %lld %lld',now())", |
| 285 | pLease->idCurrent, pLease->tmCurrent, |
| 286 | pLease->idNext, pLease->tmNext); |
| 287 | } |
| 288 | |
| 289 | /* |
| 290 | ** Check to see if the specified Win32 process is still alive. It |
| 291 | ** should be noted that even if this function returns non-zero, the |
| 292 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -241,10 +241,11 @@ | |
| 241 | ** process (1) no longer exists and the current time exceeds (2). |
| 242 | */ |
| 243 | static void backofficeReadLease(Lease *pLease){ |
| 244 | Stmt q; |
| 245 | memset(pLease, 0, sizeof(*pLease)); |
| 246 | db_unprotect(PROTECT_CONFIG); |
| 247 | db_prepare(&q, "SELECT value FROM repository.config" |
| 248 | " WHERE name='backoffice'"); |
| 249 | if( db_step(&q)==SQLITE_ROW ){ |
| 250 | const char *z = db_column_text(&q,0); |
| 251 | z = backofficeParseInt(z, &pLease->idCurrent); |
| @@ -251,10 +252,11 @@ | |
| 252 | z = backofficeParseInt(z, &pLease->tmCurrent); |
| 253 | z = backofficeParseInt(z, &pLease->idNext); |
| 254 | backofficeParseInt(z, &pLease->tmNext); |
| 255 | } |
| 256 | db_finalize(&q); |
| 257 | db_protect_pop(); |
| 258 | } |
| 259 | |
| 260 | /* |
| 261 | ** Return a string that describes how long it has been since the |
| 262 | ** last backoffice run. The string is obtained from fossil_malloc(). |
| @@ -277,15 +279,17 @@ | |
| 279 | |
| 280 | /* |
| 281 | ** Write a lease to the backoffice property |
| 282 | */ |
| 283 | static void backofficeWriteLease(Lease *pLease){ |
| 284 | db_unprotect(PROTECT_CONFIG); |
| 285 | db_multi_exec( |
| 286 | "REPLACE INTO repository.config(name,value,mtime)" |
| 287 | " VALUES('backoffice','%lld %lld %lld %lld',now())", |
| 288 | pLease->idCurrent, pLease->tmCurrent, |
| 289 | pLease->idNext, pLease->tmNext); |
| 290 | db_protect_pop(); |
| 291 | } |
| 292 | |
| 293 | /* |
| 294 | ** Check to see if the specified Win32 process is still alive. It |
| 295 | ** should be noted that even if this function returns non-zero, the |
| 296 |