Fossil SCM

But, do not allow access to private columns of fx_ tables unless the user has "Email" privilege (letter "e").

drh 2021-04-08 00:47 trunk
Commit 719dfbb95d3e545e43d6153bcadb2b024dccd9264564562df4255b34c84c686d
1 file changed +4 -5
+4 -5
--- src/report.c
+++ src/report.c
@@ -207,15 +207,10 @@
207207
** READ authorizations that have no table name. These can be
208208
** ignored. */
209209
rc = SQLITE_IGNORE;
210210
break;
211211
}
212
- if( sqlite3_strnicmp(zArg1, "fx_", 3)==0 ){
213
- /* Ok to read any table whose name begins with "fx_" */
214
- rc = SQLITE_OK;
215
- break;
216
- }
217212
while( lwr<=upr ){
218213
int i = (lwr+upr)/2;
219214
cmp = fossil_stricmp(zArg1, azAllowed[i]);
220215
if( cmp<0 ){
221216
upr = i - 1;
@@ -223,10 +218,14 @@
223218
lwr = i + 1;
224219
}else{
225220
break;
226221
}
227222
}
223
+ if( cmp ){
224
+ /* Always ok to access tables whose names begin with "fx_" */
225
+ cmp = sqlite3_strnicmp(zArg1, "fx_", 3);
226
+ }
228227
if( cmp ){
229228
*(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
230229
rc = SQLITE_DENY;
231230
}else if( !g.perm.RdAddr && sqlite3_strnicmp(zArg2, "private_", 8)==0 ){
232231
rc = SQLITE_IGNORE;
233232
--- src/report.c
+++ src/report.c
@@ -207,15 +207,10 @@
207 ** READ authorizations that have no table name. These can be
208 ** ignored. */
209 rc = SQLITE_IGNORE;
210 break;
211 }
212 if( sqlite3_strnicmp(zArg1, "fx_", 3)==0 ){
213 /* Ok to read any table whose name begins with "fx_" */
214 rc = SQLITE_OK;
215 break;
216 }
217 while( lwr<=upr ){
218 int i = (lwr+upr)/2;
219 cmp = fossil_stricmp(zArg1, azAllowed[i]);
220 if( cmp<0 ){
221 upr = i - 1;
@@ -223,10 +218,14 @@
223 lwr = i + 1;
224 }else{
225 break;
226 }
227 }
 
 
 
 
228 if( cmp ){
229 *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
230 rc = SQLITE_DENY;
231 }else if( !g.perm.RdAddr && sqlite3_strnicmp(zArg2, "private_", 8)==0 ){
232 rc = SQLITE_IGNORE;
233
--- src/report.c
+++ src/report.c
@@ -207,15 +207,10 @@
207 ** READ authorizations that have no table name. These can be
208 ** ignored. */
209 rc = SQLITE_IGNORE;
210 break;
211 }
 
 
 
 
 
212 while( lwr<=upr ){
213 int i = (lwr+upr)/2;
214 cmp = fossil_stricmp(zArg1, azAllowed[i]);
215 if( cmp<0 ){
216 upr = i - 1;
@@ -223,10 +218,14 @@
218 lwr = i + 1;
219 }else{
220 break;
221 }
222 }
223 if( cmp ){
224 /* Always ok to access tables whose names begin with "fx_" */
225 cmp = sqlite3_strnicmp(zArg1, "fx_", 3);
226 }
227 if( cmp ){
228 *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
229 rc = SQLITE_DENY;
230 }else if( !g.perm.RdAddr && sqlite3_strnicmp(zArg2, "private_", 8)==0 ){
231 rc = SQLITE_IGNORE;
232

Keyboard Shortcuts

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