Fossil SCM
Make sure the subscriber table is not synced unless the client has appropriate permissions.
Commit
7f0c7fcfcee67d07f4351f04986b808992a91779ff93be629b2ebfa8bf9e3d8b
Parent
6f34395cc815b11…
2 files changed
+19
-19
+2
-1
+19
-19
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -36,11 +36,11 @@ | ||
| 36 | 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | -#define CONFIGSET_SCRIBERS 0x000200 /* Email subscribers */ | |
| 41 | +#define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */ | |
| 42 | 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | 43 | |
| 44 | 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | 45 | |
| 46 | 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -60,23 +60,23 @@ | ||
| 60 | 60 | static struct { |
| 61 | 61 | const char *zName; /* Name of the configuration set */ |
| 62 | 62 | int groupMask; /* Mask for that configuration set */ |
| 63 | 63 | const char *zHelp; /* What it does */ |
| 64 | 64 | } aGroupName[] = { |
| 65 | - { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, | |
| 66 | - { "/project", CONFIGSET_PROJ, "Project name and description" }, | |
| 67 | - { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, | |
| 68 | - "Web interface appearance settings" }, | |
| 69 | - { "/css", CONFIGSET_CSS, "Style sheet" }, | |
| 70 | - { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, | |
| 71 | - { "/ticket", CONFIGSET_TKT, "Ticket setup", }, | |
| 72 | - { "/user", CONFIGSET_USER, "Users and privilege settings" }, | |
| 73 | - { "/xfer", CONFIGSET_XFER, "Transfer setup", }, | |
| 74 | - { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, | |
| 75 | - { "/subscribers", CONFIGSET_SCRIBERS,"Email notification subscriber list" }, | |
| 76 | -/* { "/forum", CONFIGSET_FORUM, "Forum posts", }, */ | |
| 77 | - { "/all", CONFIGSET_ALL, "All of the above" }, | |
| 65 | + { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, | |
| 66 | + { "/project", CONFIGSET_PROJ, "Project name and description" }, | |
| 67 | + { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, | |
| 68 | + "Web interface appearance settings" }, | |
| 69 | + { "/css", CONFIGSET_CSS, "Style sheet" }, | |
| 70 | + { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, | |
| 71 | + { "/ticket", CONFIGSET_TKT, "Ticket setup", }, | |
| 72 | + { "/user", CONFIGSET_USER, "Users and privilege settings" }, | |
| 73 | + { "/xfer", CONFIGSET_XFER, "Transfer setup", }, | |
| 74 | + { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, | |
| 75 | + { "/subscriber", CONFIGSET_SCRIBER,"Email notification subscriber list" }, | |
| 76 | +/*{ "/forum", CONFIGSET_FORUM, "Forum posts", },*/ | |
| 77 | + { "/all", CONFIGSET_ALL, "All of the above" }, | |
| 78 | 78 | }; |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | /* |
| 82 | 82 | ** The following is a list of settings that we are willing to |
| @@ -161,11 +161,11 @@ | ||
| 161 | 161 | |
| 162 | 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | 163 | |
| 164 | 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | 165 | |
| 166 | - { "@subscriber", CONFIGSET_SCRIBERS }, | |
| 166 | + { "@subscriber", CONFIGSET_SCRIBER }, | |
| 167 | 167 | |
| 168 | 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | ||
| 235 | 235 | } |
| 236 | 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | 238 | int m = aConfig[i].groupMask; |
| 239 | 239 | if( !g.perm.Admin ){ |
| 240 | - m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBERS); | |
| 240 | + m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBER); | |
| 241 | 241 | } |
| 242 | 242 | if( !g.perm.RdForum ){ |
| 243 | 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | 244 | } |
| 245 | 245 | if( !g.perm.RdAddr ){ |
| @@ -350,11 +350,11 @@ | ||
| 350 | 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | 351 | */ |
| 352 | 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | 354 | |
| 355 | - checkMask = CONFIGSET_SCRIBERS; | |
| 355 | + checkMask = CONFIGSET_SCRIBER; | |
| 356 | 356 | if( zName[0]=='/' ){ |
| 357 | 357 | /* The new format */ |
| 358 | 358 | char *azToken[24]; |
| 359 | 359 | int nToken = 0; |
| 360 | 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | ||
| 403 | 403 | }else{ |
| 404 | 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | 405 | } |
| 406 | 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | - if( (thisMask & CONFIGSET_SCRIBERS)!=0 ){ | |
| 408 | + if( (thisMask & CONFIGSET_SCRIBER)!=0 ){ | |
| 409 | 409 | email_schema(1); |
| 410 | 410 | } |
| 411 | 411 | checkMask &= ~thisMask; |
| 412 | 412 | } |
| 413 | 413 | |
| @@ -585,11 +585,11 @@ | ||
| 585 | 585 | nCard++; |
| 586 | 586 | blob_reset(&rec); |
| 587 | 587 | } |
| 588 | 588 | db_finalize(&q); |
| 589 | 589 | } |
| 590 | - if( (groupMask & CONFIGSET_SCRIBERS)!=0 | |
| 590 | + if( (groupMask & CONFIGSET_SCRIBER)!=0 | |
| 591 | 591 | && db_table_exists("repository","subscriber") |
| 592 | 592 | ){ |
| 593 | 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | 594 | " quote(suname), quote(sdigest)," |
| 595 | 595 | " quote(sdonotcall), quote(ssub)," |
| 596 | 596 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -36,11 +36,11 @@ | |
| 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_SCRIBERS 0x000200 /* Email subscribers */ |
| 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | |
| 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | |
| 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -60,23 +60,23 @@ | |
| 60 | static struct { |
| 61 | const char *zName; /* Name of the configuration set */ |
| 62 | int groupMask; /* Mask for that configuration set */ |
| 63 | const char *zHelp; /* What it does */ |
| 64 | } aGroupName[] = { |
| 65 | { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, |
| 66 | { "/project", CONFIGSET_PROJ, "Project name and description" }, |
| 67 | { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, |
| 68 | "Web interface appearance settings" }, |
| 69 | { "/css", CONFIGSET_CSS, "Style sheet" }, |
| 70 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 71 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 72 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 73 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 74 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 75 | { "/subscribers", CONFIGSET_SCRIBERS,"Email notification subscriber list" }, |
| 76 | /* { "/forum", CONFIGSET_FORUM, "Forum posts", }, */ |
| 77 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | /* |
| 82 | ** The following is a list of settings that we are willing to |
| @@ -161,11 +161,11 @@ | |
| 161 | |
| 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | |
| 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | |
| 166 | { "@subscriber", CONFIGSET_SCRIBERS }, |
| 167 | |
| 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | |
| 235 | } |
| 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | int m = aConfig[i].groupMask; |
| 239 | if( !g.perm.Admin ){ |
| 240 | m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBERS); |
| 241 | } |
| 242 | if( !g.perm.RdForum ){ |
| 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | } |
| 245 | if( !g.perm.RdAddr ){ |
| @@ -350,11 +350,11 @@ | |
| 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | */ |
| 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | |
| 355 | checkMask = CONFIGSET_SCRIBERS; |
| 356 | if( zName[0]=='/' ){ |
| 357 | /* The new format */ |
| 358 | char *azToken[24]; |
| 359 | int nToken = 0; |
| 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | |
| 403 | }else{ |
| 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | } |
| 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | if( (thisMask & CONFIGSET_SCRIBERS)!=0 ){ |
| 409 | email_schema(1); |
| 410 | } |
| 411 | checkMask &= ~thisMask; |
| 412 | } |
| 413 | |
| @@ -585,11 +585,11 @@ | |
| 585 | nCard++; |
| 586 | blob_reset(&rec); |
| 587 | } |
| 588 | db_finalize(&q); |
| 589 | } |
| 590 | if( (groupMask & CONFIGSET_SCRIBERS)!=0 |
| 591 | && db_table_exists("repository","subscriber") |
| 592 | ){ |
| 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | " quote(suname), quote(sdigest)," |
| 595 | " quote(sdonotcall), quote(ssub)," |
| 596 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -36,11 +36,11 @@ | |
| 36 | #define CONFIGSET_SHUN 0x000010 /* Shun settings */ |
| 37 | #define CONFIGSET_USER 0x000020 /* The USER table */ |
| 38 | #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ |
| 39 | #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ |
| 40 | #define CONFIGSET_ALIAS 0x000100 /* URL Aliases */ |
| 41 | #define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */ |
| 42 | #define CONFIGSET_FORUM 0x000400 /* Forum posts */ |
| 43 | |
| 44 | #define CONFIGSET_ALL 0x0007ff /* Everything */ |
| 45 | |
| 46 | #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ |
| @@ -60,23 +60,23 @@ | |
| 60 | static struct { |
| 61 | const char *zName; /* Name of the configuration set */ |
| 62 | int groupMask; /* Mask for that configuration set */ |
| 63 | const char *zHelp; /* What it does */ |
| 64 | } aGroupName[] = { |
| 65 | { "/email", CONFIGSET_ADDR, "Concealed email addresses in tickets" }, |
| 66 | { "/project", CONFIGSET_PROJ, "Project name and description" }, |
| 67 | { "/skin", CONFIGSET_SKIN | CONFIGSET_CSS, |
| 68 | "Web interface appearance settings" }, |
| 69 | { "/css", CONFIGSET_CSS, "Style sheet" }, |
| 70 | { "/shun", CONFIGSET_SHUN, "List of shunned artifacts" }, |
| 71 | { "/ticket", CONFIGSET_TKT, "Ticket setup", }, |
| 72 | { "/user", CONFIGSET_USER, "Users and privilege settings" }, |
| 73 | { "/xfer", CONFIGSET_XFER, "Transfer setup", }, |
| 74 | { "/alias", CONFIGSET_ALIAS, "URL Aliases", }, |
| 75 | { "/subscriber", CONFIGSET_SCRIBER,"Email notification subscriber list" }, |
| 76 | /*{ "/forum", CONFIGSET_FORUM, "Forum posts", },*/ |
| 77 | { "/all", CONFIGSET_ALL, "All of the above" }, |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | /* |
| 82 | ** The following is a list of settings that we are willing to |
| @@ -161,11 +161,11 @@ | |
| 161 | |
| 162 | { "@shun", CONFIGSET_SHUN }, |
| 163 | |
| 164 | { "@alias", CONFIGSET_ALIAS }, |
| 165 | |
| 166 | { "@subscriber", CONFIGSET_SCRIBER }, |
| 167 | |
| 168 | { "xfer-common-script", CONFIGSET_XFER }, |
| 169 | { "xfer-push-script", CONFIGSET_XFER }, |
| 170 | { "xfer-commit-script", CONFIGSET_XFER }, |
| 171 | { "xfer-ticket-script", CONFIGSET_XFER }, |
| @@ -235,11 +235,11 @@ | |
| 235 | } |
| 236 | for(i=0; i<count(aConfig); i++){ |
| 237 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 238 | int m = aConfig[i].groupMask; |
| 239 | if( !g.perm.Admin ){ |
| 240 | m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBER); |
| 241 | } |
| 242 | if( !g.perm.RdForum ){ |
| 243 | m &= ~(CONFIGSET_FORUM); |
| 244 | } |
| 245 | if( !g.perm.RdAddr ){ |
| @@ -350,11 +350,11 @@ | |
| 350 | ** /subscriber $SMTIME $SEMAIL suname $V ... |
| 351 | */ |
| 352 | void configure_receive(const char *zName, Blob *pContent, int groupMask){ |
| 353 | int checkMask; /* Masks for which we must first check existance of tables */ |
| 354 | |
| 355 | checkMask = CONFIGSET_SCRIBER; |
| 356 | if( zName[0]=='/' ){ |
| 357 | /* The new format */ |
| 358 | char *azToken[24]; |
| 359 | int nToken = 0; |
| 360 | int ii, jj; |
| @@ -403,11 +403,11 @@ | |
| 403 | }else{ |
| 404 | thisMask = configure_is_exportable(aType[ii].zName); |
| 405 | } |
| 406 | if( (thisMask & groupMask)==0 ) return; |
| 407 | if( (thisMask & checkMask)!=0 ){ |
| 408 | if( (thisMask & CONFIGSET_SCRIBER)!=0 ){ |
| 409 | email_schema(1); |
| 410 | } |
| 411 | checkMask &= ~thisMask; |
| 412 | } |
| 413 | |
| @@ -585,11 +585,11 @@ | |
| 585 | nCard++; |
| 586 | blob_reset(&rec); |
| 587 | } |
| 588 | db_finalize(&q); |
| 589 | } |
| 590 | if( (groupMask & CONFIGSET_SCRIBER)!=0 |
| 591 | && db_table_exists("repository","subscriber") |
| 592 | ){ |
| 593 | db_prepare(&q, "SELECT mtime, quote(semail)," |
| 594 | " quote(suname), quote(sdigest)," |
| 595 | " quote(sdonotcall), quote(ssub)," |
| 596 |
+2
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1420,11 +1420,12 @@ | ||
| 1420 | 1420 | if( g.perm.Read ){ |
| 1421 | 1421 | char *zName = blob_str(&xfer.aToken[1]); |
| 1422 | 1422 | if( zName[0]=='/' ){ |
| 1423 | 1423 | /* New style configuration transfer */ |
| 1424 | 1424 | int groupMask = configure_name_to_mask(&zName[1], 0); |
| 1425 | - if( !g.perm.Admin ) groupMask &= ~CONFIGSET_USER; | |
| 1425 | + if( !g.perm.Admin ) groupMask &= ~(CONFIGSET_USER|CONFIGSET_SCRIBER); | |
| 1426 | + if( !g.perm.RdForum ) groupMask & ~CONFIGSET_FORUM; | |
| 1426 | 1427 | if( !g.perm.RdAddr ) groupMask &= ~CONFIGSET_ADDR; |
| 1427 | 1428 | configure_send_group(xfer.pOut, groupMask, 0); |
| 1428 | 1429 | } |
| 1429 | 1430 | } |
| 1430 | 1431 | }else |
| 1431 | 1432 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1420,11 +1420,12 @@ | |
| 1420 | if( g.perm.Read ){ |
| 1421 | char *zName = blob_str(&xfer.aToken[1]); |
| 1422 | if( zName[0]=='/' ){ |
| 1423 | /* New style configuration transfer */ |
| 1424 | int groupMask = configure_name_to_mask(&zName[1], 0); |
| 1425 | if( !g.perm.Admin ) groupMask &= ~CONFIGSET_USER; |
| 1426 | if( !g.perm.RdAddr ) groupMask &= ~CONFIGSET_ADDR; |
| 1427 | configure_send_group(xfer.pOut, groupMask, 0); |
| 1428 | } |
| 1429 | } |
| 1430 | }else |
| 1431 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1420,11 +1420,12 @@ | |
| 1420 | if( g.perm.Read ){ |
| 1421 | char *zName = blob_str(&xfer.aToken[1]); |
| 1422 | if( zName[0]=='/' ){ |
| 1423 | /* New style configuration transfer */ |
| 1424 | int groupMask = configure_name_to_mask(&zName[1], 0); |
| 1425 | if( !g.perm.Admin ) groupMask &= ~(CONFIGSET_USER|CONFIGSET_SCRIBER); |
| 1426 | if( !g.perm.RdForum ) groupMask & ~CONFIGSET_FORUM; |
| 1427 | if( !g.perm.RdAddr ) groupMask &= ~CONFIGSET_ADDR; |
| 1428 | configure_send_group(xfer.pOut, groupMask, 0); |
| 1429 | } |
| 1430 | } |
| 1431 | }else |
| 1432 |