Fossil SCM

Make sure the subscriber table is not synced unless the client has appropriate permissions.

drh 2018-06-25 22:01 trunk
Commit 7f0c7fcfcee67d07f4351f04986b808992a91779ff93be629b2ebfa8bf9e3d8b
2 files changed +19 -19 +2 -1
+19 -19
--- src/configure.c
+++ src/configure.c
@@ -36,11 +36,11 @@
3636
#define CONFIGSET_SHUN 0x000010 /* Shun settings */
3737
#define CONFIGSET_USER 0x000020 /* The USER table */
3838
#define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */
3939
#define CONFIGSET_XFER 0x000080 /* Transfer configuration */
4040
#define CONFIGSET_ALIAS 0x000100 /* URL Aliases */
41
-#define CONFIGSET_SCRIBERS 0x000200 /* Email subscribers */
41
+#define CONFIGSET_SCRIBER 0x000200 /* Email subscribers */
4242
#define CONFIGSET_FORUM 0x000400 /* Forum posts */
4343
4444
#define CONFIGSET_ALL 0x0007ff /* Everything */
4545
4646
#define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */
@@ -60,23 +60,23 @@
6060
static struct {
6161
const char *zName; /* Name of the configuration set */
6262
int groupMask; /* Mask for that configuration set */
6363
const char *zHelp; /* What it does */
6464
} 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" },
7878
};
7979
8080
8181
/*
8282
** The following is a list of settings that we are willing to
@@ -161,11 +161,11 @@
161161
162162
{ "@shun", CONFIGSET_SHUN },
163163
164164
{ "@alias", CONFIGSET_ALIAS },
165165
166
- { "@subscriber", CONFIGSET_SCRIBERS },
166
+ { "@subscriber", CONFIGSET_SCRIBER },
167167
168168
{ "xfer-common-script", CONFIGSET_XFER },
169169
{ "xfer-push-script", CONFIGSET_XFER },
170170
{ "xfer-commit-script", CONFIGSET_XFER },
171171
{ "xfer-ticket-script", CONFIGSET_XFER },
@@ -235,11 +235,11 @@
235235
}
236236
for(i=0; i<count(aConfig); i++){
237237
if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){
238238
int m = aConfig[i].groupMask;
239239
if( !g.perm.Admin ){
240
- m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBERS);
240
+ m &= ~(CONFIGSET_USER|CONFIGSET_SCRIBER);
241241
}
242242
if( !g.perm.RdForum ){
243243
m &= ~(CONFIGSET_FORUM);
244244
}
245245
if( !g.perm.RdAddr ){
@@ -350,11 +350,11 @@
350350
** /subscriber $SMTIME $SEMAIL suname $V ...
351351
*/
352352
void configure_receive(const char *zName, Blob *pContent, int groupMask){
353353
int checkMask; /* Masks for which we must first check existance of tables */
354354
355
- checkMask = CONFIGSET_SCRIBERS;
355
+ checkMask = CONFIGSET_SCRIBER;
356356
if( zName[0]=='/' ){
357357
/* The new format */
358358
char *azToken[24];
359359
int nToken = 0;
360360
int ii, jj;
@@ -403,11 +403,11 @@
403403
}else{
404404
thisMask = configure_is_exportable(aType[ii].zName);
405405
}
406406
if( (thisMask & groupMask)==0 ) return;
407407
if( (thisMask & checkMask)!=0 ){
408
- if( (thisMask & CONFIGSET_SCRIBERS)!=0 ){
408
+ if( (thisMask & CONFIGSET_SCRIBER)!=0 ){
409409
email_schema(1);
410410
}
411411
checkMask &= ~thisMask;
412412
}
413413
@@ -585,11 +585,11 @@
585585
nCard++;
586586
blob_reset(&rec);
587587
}
588588
db_finalize(&q);
589589
}
590
- if( (groupMask & CONFIGSET_SCRIBERS)!=0
590
+ if( (groupMask & CONFIGSET_SCRIBER)!=0
591591
&& db_table_exists("repository","subscriber")
592592
){
593593
db_prepare(&q, "SELECT mtime, quote(semail),"
594594
" quote(suname), quote(sdigest),"
595595
" quote(sdonotcall), quote(ssub),"
596596
--- 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 @@
14201420
if( g.perm.Read ){
14211421
char *zName = blob_str(&xfer.aToken[1]);
14221422
if( zName[0]=='/' ){
14231423
/* New style configuration transfer */
14241424
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;
14261427
if( !g.perm.RdAddr ) groupMask &= ~CONFIGSET_ADDR;
14271428
configure_send_group(xfer.pOut, groupMask, 0);
14281429
}
14291430
}
14301431
}else
14311432
--- 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

Keyboard Shortcuts

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