MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / shellAuth

Function shellAuth

modules/dasSQLITE/sqlite/shell.c:17178–17218  ·  view source on GitHub ↗

** When the ".auth ON" is set, the following authorizer callback is ** invoked. It always returns SQLITE_OK. */

Source from the content-addressed store, hash-verified

17176** invoked. It always returns SQLITE_OK.
17177*/
17178static int shellAuth(
17179 void *pClientData,
17180 int op,
17181 const char *zA1,
17182 const char *zA2,
17183 const char *zA3,
17184 const char *zA4
17185){
17186 ShellState *p = (ShellState*)pClientData;
17187 static const char *azAction[] = { 0,
17188 "CREATE_INDEX", "CREATE_TABLE", "CREATE_TEMP_INDEX",
17189 "CREATE_TEMP_TABLE", "CREATE_TEMP_TRIGGER", "CREATE_TEMP_VIEW",
17190 "CREATE_TRIGGER", "CREATE_VIEW", "DELETE",
17191 "DROP_INDEX", "DROP_TABLE", "DROP_TEMP_INDEX",
17192 "DROP_TEMP_TABLE", "DROP_TEMP_TRIGGER", "DROP_TEMP_VIEW",
17193 "DROP_TRIGGER", "DROP_VIEW", "INSERT",
17194 "PRAGMA", "READ", "SELECT",
17195 "TRANSACTION", "UPDATE", "ATTACH",
17196 "DETACH", "ALTER_TABLE", "REINDEX",
17197 "ANALYZE", "CREATE_VTABLE", "DROP_VTABLE",
17198 "FUNCTION", "SAVEPOINT", "RECURSIVE"
17199 };
17200 int i;
17201 const char *az[4];
17202 az[0] = zA1;
17203 az[1] = zA2;
17204 az[2] = zA3;
17205 az[3] = zA4;
17206 utf8_printf(p->out, "authorizer: %s", azAction[op]);
17207 for(i=0; i<4; i++){
17208 raw_printf(p->out, " ");
17209 if( az[i] ){
17210 output_c_string(p->out, az[i]);
17211 }else{
17212 raw_printf(p->out, "NULL");
17213 }
17214 }
17215 raw_printf(p->out, "\n");
17216 if( p->bSafeMode ) (void)safeModeAuth(pClientData, op, zA1, zA2, zA3, zA4);
17217 return SQLITE_OK;
17218}
17219#endif
17220
17221/*

Callers

nothing calls this directly

Calls 3

utf8_printfFunction · 0.85
output_c_stringFunction · 0.85
safeModeAuthFunction · 0.85

Tested by

no test coverage detected