Skip to content

Commit c7b561f

Browse files
committed
simple filtering of shell input to skip history for key and rekey statements
1 parent 3e3f8ab commit c7b561f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/shell.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,15 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){
624624
#else
625625
free(zPrior);
626626
zResult = shell_readline(zPrompt);
627+
/* BEGIN SQLCIPHER */
628+
#ifdef SQLITE_HAS_CODEC
629+
/* Simplistic filtering of input lines to prevent PRAGKA key and
630+
PRAGMA rekey statements from being stored in readline history.
631+
Note that this will only prevent single line statements, but that
632+
will be sufficient for common cases. */
633+
if(sqlite3_strlike("%pragma%key%=%", zResult, 0)==0) return zResult;
634+
#endif
635+
/* END SQLCIPHER */
627636
if( zResult && *zResult ) shell_add_history(zResult);
628637
#endif
629638
}

0 commit comments

Comments
 (0)