]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm who: Use wildcards for user matching.
authorTimo Sirainen <tss@iki.fi>
Thu, 18 Mar 2010 02:12:24 +0000 (04:12 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 18 Mar 2010 02:12:24 +0000 (04:12 +0200)
--HG--
branch : HEAD

src/doveadm/doveadm-who.c

index 12ea544e3a3d13138a23f3f87c5cfd858587f691..155839b7f943f07c797dd4c6d5894ae02e39fcb0 100644 (file)
@@ -4,6 +4,7 @@
 #include "array.h"
 #include "network.h"
 #include "istream.h"
+#include "wildcard-match.h"
 #include "hash.h"
 #include "doveadm.h"
 
@@ -166,7 +167,7 @@ static bool who_user_filter_match(const struct who_user *user,
                                  const struct who_filter *filter)
 {
        if (filter->username != NULL) {
-               if (strstr(user->username, filter->username) == NULL)
+               if (!wildcard_match_icase(user->username, filter->username))
                        return FALSE;
        }
        if (filter->net_bits > 0) {
@@ -232,7 +233,7 @@ static bool who_line_filter_match(const struct who_line *line,
                                  const struct who_filter *filter)
 {
        if (filter->username != NULL) {
-               if (strstr(line->username, filter->username) == NULL)
+               if (!wildcard_match_icase(line->username, filter->username))
                        return FALSE;
        }
        if (filter->net_bits > 0) {