Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blocklist sensitive to spurious whitespace #1377

Closed
dpc22 opened this issue Apr 13, 2022 · 1 comment · Fixed by #1385
Closed

blocklist sensitive to spurious whitespace #1377

dpc22 opened this issue Apr 13, 2022 · 1 comment · Fixed by #1385
Labels
Milestone

Comments

@dpc22
Copy link
Contributor

dpc22 commented Apr 13, 2022

Version

6.2.66

Installation method

My own rpm, derived from the official rpm

Expected behavior

If someone pastes an email address into the blocklist on the list with some spurious whitespace at the end, for example:

"localpart@domain "

(obviously without the quotes), that entry in the block list should still work.

Ideally Sympa would also automatically trim any whitespace at the start and end of each line when the blocklist is updated.

Actual behavior

One of my users complained that an entry on their blocklist (with 733 entries!) wasn't working.

The cause turned out to be a stray space at the end of that specific line in the block list.

Additional information

lib/Sympa/Scenario.pm:

sub do_search {
            [...]
            while (my $pattern = <$ifh>) {
                next if $pattern =~ /\A\s*\z/ or $pattern =~ /\A[#;]/;
                chomp $pattern;
                $pattern =~ s/([^\w\x80-\xFF])/\\$1/g;

A quick test reveals that an input of $pattern="localpart@domain " turns into "localpart@domain\ ": the trailing space gets quoted.

I would suggest replacing the chomp() with something that removes all white space at the start and end of each line.

@ikedas ikedas added the bug label Apr 14, 2022
ikedas added a commit that referenced this issue Apr 21, 2022
blocklist sensitive to spurious whitespace (#1377)
@ikedas
Copy link
Member

ikedas commented Apr 21, 2022

Fixed. Thank you for reporting bug and suggesting fix!

@ikedas ikedas added this to the 6.2.70 milestone Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants