Fossil SCM
But, do not allow access to private columns of fx_ tables unless the user has "Email" privilege (letter "e").
Commit
719dfbb95d3e545e43d6153bcadb2b024dccd9264564562df4255b34c84c686d
Parent
cfb6e5eae34a00d…
1 file changed
+4
-5
+4
-5
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -207,15 +207,10 @@ | ||
| 207 | 207 | ** READ authorizations that have no table name. These can be |
| 208 | 208 | ** ignored. */ |
| 209 | 209 | rc = SQLITE_IGNORE; |
| 210 | 210 | break; |
| 211 | 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 | 212 | while( lwr<=upr ){ |
| 218 | 213 | int i = (lwr+upr)/2; |
| 219 | 214 | cmp = fossil_stricmp(zArg1, azAllowed[i]); |
| 220 | 215 | if( cmp<0 ){ |
| 221 | 216 | upr = i - 1; |
| @@ -223,10 +218,14 @@ | ||
| 223 | 218 | lwr = i + 1; |
| 224 | 219 | }else{ |
| 225 | 220 | break; |
| 226 | 221 | } |
| 227 | 222 | } |
| 223 | + if( cmp ){ | |
| 224 | + /* Always ok to access tables whose names begin with "fx_" */ | |
| 225 | + cmp = sqlite3_strnicmp(zArg1, "fx_", 3); | |
| 226 | + } | |
| 228 | 227 | if( cmp ){ |
| 229 | 228 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 230 | 229 | rc = SQLITE_DENY; |
| 231 | 230 | }else if( !g.perm.RdAddr && sqlite3_strnicmp(zArg2, "private_", 8)==0 ){ |
| 232 | 231 | rc = SQLITE_IGNORE; |
| 233 | 232 |
| --- 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 |