diff --git a/src/redis-cli.c b/src/redis-cli.c index 34f03394703..0177effa25d 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -3262,16 +3262,19 @@ void cliLoadPreferences(void) { /* Some commands can include sensitive information and shouldn't be put in the * history file. Currently these commands are include: * - AUTH - * - ACL SETUSER + * - ACL SETUSER, ACL GETUSER * - CONFIG SET masterauth/masteruser/requirepass * - HELLO with [AUTH username password] - * - MIGRATE with [AUTH password] or [AUTH2 username password] */ + * - MIGRATE with [AUTH password] or [AUTH2 username password] + * - SENTINEL CONFIG SET sentinel-pass password, SENTINEL CONFIG SET sentinel-user username + * - SENTINEL SET auth-pass password, SENTINEL SET auth-user username */ static int isSensitiveCommand(int argc, char **argv) { if (!strcasecmp(argv[0],"auth")) { return 1; } else if (argc > 1 && - !strcasecmp(argv[0],"acl") && - !strcasecmp(argv[1],"setuser")) + !strcasecmp(argv[0],"acl") && ( + !strcasecmp(argv[1],"setuser") || + !strcasecmp(argv[1],"getuser"))) { return 1; } else if (argc > 2 && @@ -3310,6 +3313,24 @@ static int isSensitiveCommand(int argc, char **argv) { return 0; } } + } else if (argc > 4 && !strcasecmp(argv[0], "sentinel")) { + /* SENTINEL CONFIG SET sentinel-pass password + * SENTINEL CONFIG SET sentinel-user username */ + if (!strcasecmp(argv[1], "config") && + !strcasecmp(argv[2], "set") && + (!strcasecmp(argv[3], "sentinel-pass") || + !strcasecmp(argv[3], "sentinel-user"))) + { + return 1; + } + /* SENTINEL SET auth-pass password + * SENTINEL SET auth-user username */ + if (!strcasecmp(argv[1], "set") && + (!strcasecmp(argv[3], "auth-pass") || + !strcasecmp(argv[3], "auth-user"))) + { + return 1; + } } return 0; }