]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei mark: disallow '!' in labels
authorEric Wong <e@80x24.org>
Fri, 26 Mar 2021 09:51:26 +0000 (09:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 26 Mar 2021 23:08:24 +0000 (23:08 +0000)
'!' could wreak havoc if exposed to a shell like bash.  It seems
like a rare character for use in file/directory/mailbox names.

lib/PublicInbox/LeiMark.pm

index 7a2ccf7712dedffbc9556db9ca8b4706eb1d0e8d..6d236411b4639d03b100ff5a46c42f9da3d9f06c 100644 (file)
@@ -23,7 +23,7 @@ my %ERR = (
                my ($label) = @_;
                length($label) >= $L_MAX and
                        return "`$label' too long (must be <= $L_MAX)";
-               $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@\!,]*[a-z0-9]\z} ?
+               $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@,]*[a-z0-9]\z} ?
                        undef : "`$label' is invalid";
        },
        kw => sub {