persistentstorage/sql/SRC/Server/SqlSrvAuthorizer.cpp
changeset 15 3eacc0623088
parent 0 08ec8eefde2f
child 16 6b6fd149daa2
equal deleted inserted replaced
14:15018f1726c7 15:3eacc0623088
   267 		case SQLITE_DROP_INDEX://            Index Name      Table Name            
   267 		case SQLITE_DROP_INDEX://            Index Name      Table Name            
   268 		case SQLITE_DROP_TABLE://            Table Name      NULL 
   268 		case SQLITE_DROP_TABLE://            Table Name      NULL 
   269 		case SQLITE_DROP_TRIGGER://          Trigger Name    Table Name      
   269 		case SQLITE_DROP_TRIGGER://          Trigger Name    Table Name      
   270 		case SQLITE_DROP_VIEW://             View Name       NULL            
   270 		case SQLITE_DROP_VIEW://             View Name       NULL            
   271 		case SQLITE_ALTER_TABLE://			 Database Name   Table Name
   271 		case SQLITE_ALTER_TABLE://			 Database Name   Table Name
   272 		case SQLITE_CREATE_TEMP_INDEX://     Index Name      Table Name      
       
   273 		case SQLITE_CREATE_TEMP_TABLE://     Table Name      NULL            
       
   274 		case SQLITE_CREATE_TEMP_TRIGGER://   Trigger Name    Table Name      
       
   275 		case SQLITE_CREATE_TEMP_VIEW://      View Name       NULL            
       
   276 		case SQLITE_DROP_TEMP_INDEX://       Index Name      Table Name      
       
   277 		case SQLITE_DROP_TEMP_TABLE://       Table Name      NULL            
       
   278 		case SQLITE_DROP_TEMP_TRIGGER://     Trigger Name    Table Name      
       
   279 		case SQLITE_DROP_TEMP_VIEW://        View Name       NULL            
       
   280 		case SQLITE_SELECT://                NULL            NULL            
   272 		case SQLITE_SELECT://                NULL            NULL            
   281 		case SQLITE_TRANSACTION://           NULL            NULL          
   273 		case SQLITE_TRANSACTION://           NULL            NULL          
   282 		case SQLITE_DELETE://                Table Name      NULL
   274 		case SQLITE_DELETE://                Table Name      NULL
   283 		case SQLITE_INSERT://                Table Name      NULL   
   275 		case SQLITE_INSERT://                Table Name      NULL   
   284 		case SQLITE_UPDATE://                Table Name      Column Name		
   276 		case SQLITE_UPDATE://                Table Name      Column Name		
   292 		case SQLITE_FUNCTION:
   284 		case SQLITE_FUNCTION:
   293 			break;
   285 			break;
   294 		case SQLITE_PRAGMA://                Pragma Name     1st arg or NULL 
   286 		case SQLITE_PRAGMA://                Pragma Name     1st arg or NULL 
   295 			res = PragmaCheck(aDbObjName1, (aDbObjName2 != NULL), EFalse);
   287 			res = PragmaCheck(aDbObjName1, (aDbObjName2 != NULL), EFalse);
   296 			break;
   288 			break;
       
   289 //All "temp" operations are handled earlier, in CSqlSrvDatabase::AuthorizeCallback(), where a check for "temp"
       
   290 //database name is performed.
       
   291 //      case SQLITE_CREATE_TEMP_INDEX://     Index Name      Table Name      
       
   292 //      case SQLITE_CREATE_TEMP_TABLE://     Table Name      NULL            
       
   293 //      case SQLITE_CREATE_TEMP_TRIGGER://   Trigger Name    Table Name      
       
   294 //      case SQLITE_CREATE_TEMP_VIEW://      View Name       NULL            
       
   295 //      case SQLITE_DROP_TEMP_INDEX://       Index Name      Table Name      
       
   296 //      case SQLITE_DROP_TEMP_TABLE://       Table Name      NULL            
       
   297 //      case SQLITE_DROP_TEMP_TRIGGER://     Trigger Name    Table Name      
       
   298 //      case SQLITE_DROP_TEMP_VIEW://        View Name       NULL            
   297 		default:
   299 		default:
   298 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   300 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   299 			break;
   301 			break;
   300 			}
   302 			}
   301 	return res;
   303 	return res;
   358 				{
   360 				{
   359 				res = SQLITE_DENY;	
   361 				res = SQLITE_DENY;	
   360 				}
   362 				}
   361 			break;
   363 			break;
   362 		//No policy check
   364 		//No policy check
   363 		case SQLITE_CREATE_TEMP_INDEX://     Index Name      Table Name      
       
   364 		case SQLITE_CREATE_TEMP_TABLE://     Table Name      NULL            
       
   365 		case SQLITE_CREATE_TEMP_TRIGGER://   Trigger Name    Table Name      
       
   366 		case SQLITE_CREATE_TEMP_VIEW://      View Name       NULL            
       
   367 		case SQLITE_DROP_TEMP_INDEX://       Index Name      Table Name      
       
   368 		case SQLITE_DROP_TEMP_TABLE://       Table Name      NULL            
       
   369 		case SQLITE_DROP_TEMP_TRIGGER://     Trigger Name    Table Name      
       
   370 		case SQLITE_DROP_TEMP_VIEW://        View Name       NULL            
       
   371 		case SQLITE_SELECT://                NULL            NULL            
   365 		case SQLITE_SELECT://                NULL            NULL            
   372 		case SQLITE_TRANSACTION://           NULL            NULL            
   366 		case SQLITE_TRANSACTION://           NULL            NULL            
   373 			break;
   367 			break;
   374 		//"Database schema policy" for sqlite tables
   368 		//"Database schema policy" for sqlite tables
   375 		//"Database schema policy" || "Database write policy" for user tables
   369 		//"Database schema policy" || "Database write policy" for user tables
   421 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   415 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   422 			res = SQLITE_DENY;	
   416 			res = SQLITE_DENY;	
   423 		//No policy check
   417 		//No policy check
   424 		case SQLITE_FUNCTION:
   418 		case SQLITE_FUNCTION:
   425 			break;
   419 			break;
       
   420 //All "temp" operations are handled earlier, in CSqlSrvDatabase::AuthorizeCallback(), where a check for "temp"
       
   421 //database name is performed.
       
   422 //      case SQLITE_CREATE_TEMP_INDEX://     Index Name      Table Name      
       
   423 //      case SQLITE_CREATE_TEMP_TABLE://     Table Name      NULL            
       
   424 //      case SQLITE_CREATE_TEMP_TRIGGER://   Trigger Name    Table Name      
       
   425 //      case SQLITE_CREATE_TEMP_VIEW://      View Name       NULL            
       
   426 //      case SQLITE_DROP_TEMP_INDEX://       Index Name      Table Name      
       
   427 //      case SQLITE_DROP_TEMP_TABLE://       Table Name      NULL            
       
   428 //      case SQLITE_DROP_TEMP_TRIGGER://     Trigger Name    Table Name      
       
   429 //      case SQLITE_DROP_TEMP_VIEW://        View Name       NULL            
   426 		default:
   430 		default:
   427 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   431 			__SQLASSERT(EFalse, ESqlPanicInternalError);
   428 			break;
   432 			break;
   429 		}
   433 		}
   430 	return res;
   434 	return res;