summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-08-22 07:39:15 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-08-22 07:39:15 +0200
commit333253e5b9ba3431ee0ea1242d8195ddb1fa5c62 (patch)
tree8ddfa19ac5fbfa3b3f4a0cc2301d9627912de2ab
parent94ddd4a8b78b7c4d0e4ffe58c483bbe68babc1a0 (diff)
downloadweechat-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).
-rw-r--r--ChangeLog.asciidoc2
-rw-r--r--src/plugins/trigger/trigger-config.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 128d97126..d81c65e37 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -24,6 +24,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* aspell: fix crash with command "/aspell addword" if no word is given
(closes #164, closes #165)
* irc: fix translation of CTCP PING reply (closes #137)
+* trigger: fix regex used in default triggers to hide passwords ("\S" is not
+ supported on *BSD) (closes #172)
== Version 1.0 (2014-08-15)
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 },