simple filtering of shell input to skip history for key and rekey statements

This commit is contained in:
Stephen Lombardo 2018-08-28 15:38:02 -04:00
parent 3e3f8ab353
commit c7b561fab7
1 changed files with 9 additions and 0 deletions

View File

@ -624,6 +624,15 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){
#else
free(zPrior);
zResult = shell_readline(zPrompt);
/* BEGIN SQLCIPHER */
#ifdef SQLITE_HAS_CODEC
/* Simplistic filtering of input lines to prevent PRAGKA key and
PRAGMA rekey statements from being stored in readline history.
Note that this will only prevent single line statements, but that
will be sufficient for common cases. */
if(sqlite3_strlike("%pragma%key%=%", zResult, 0)==0) return zResult;
#endif
/* END SQLCIPHER */
if( zResult && *zResult ) shell_add_history(zResult);
#endif
}