Oefenweb / ansible-postfix

Ansible role to set up postfix in Debian-like systems
MIT License
174 stars 82 forks source link

Make lineinfile regex more specific #103

Closed awigen closed 3 years ago

awigen commented 4 years ago

Currently the regex can match a substring of line we are looking for. This patch changes the regexes to include one whitespace.

tersmitten commented 4 years ago

Is this a bugfix or improvement?

And is it always a space or can it be any whitespace char?

awigen commented 4 years ago

This is a bugfix, I ran into issues with many aliases.

And is it always a space or can it be any whitespace char?

Good question, I check postfix' source and it uses a ISSPACE marcro which uses ctype's isspace() and the man page reports:

   isspace()
          checks for white-space characters.  In the "C" and "POSIX" locales, these are:
          space, form-feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'),
          and vertical tab ('\v').

So the pull request should be updated to include these characters.