diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-22 07:39:15 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-22 07:39:15 +0200 |
commit | 333253e5b9ba3431ee0ea1242d8195ddb1fa5c62 (patch) | |
tree | 8ddfa19ac5fbfa3b3f4a0cc2301d9627912de2ab /src | |
parent | 94ddd4a8b78b7c4d0e4ffe58c483bbe68babc1a0 (diff) | |
download | weechat-333253e5b9ba3431ee0ea1242d8195ddb1fa5c62.zip |
trigger: fix regex used in default triggers to hide passwords (closes #172)
"\S" is not supported on *BSD, so it is replaced by "[^ ]" (which should be
enough, since there should be no tabs or other whitespace different from
spaces in command line).
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/trigger/trigger-config.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index 57d84c871..2b75e2bea 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -64,11 +64,11 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "", "==^(" "(/(msg|quote) +nickserv " - "+(id|identify|register|ghost +\\S+|release +\\S+|regain +\\S+) +)|" - "/oper +\\S+ +|" + "+(id|identify|register|ghost +[^ ]+|release +[^ ]+|regain +[^ ]+) +)|" + "/oper +[^ ]+ +|" "/quote +pass +|" - "/set +\\S*password\\S* +|" - "/secure +(passphrase|decrypt|set +\\S+) +)" + "/set +[^ ]*password[^ ]* +|" + "/secure +(passphrase|decrypt|set +[^ ]+) +)" "(.*)" "==$1$.*+", "", @@ -78,7 +78,7 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "modifier", "5000|irc_message_auth", "", - "==^(.*(id|identify|register|ghost +\\S+|release +\\S+) +)(.*)==$1$.*+", + "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)==$1$.*+", "", "" }, /* hide server password in commands /server and /connect */ @@ -86,7 +86,7 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = "modifier", "5000|input_text_display;5000|history_add", "", - "==^(/(server|connect) .*-(sasl_)?password=)(\\S+)(.*)==$1$.*4$5" + "==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)==$1$.*4$5" "", "" }, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, |