Re: SELinux blocking Dovecot from mysqld socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2/5/19 2:06 PM, Todd Zullinger wrote:
Robert Moskowitz wrote:
On 2/5/19 10:41 AM, Ondrej Mosnacek wrote:
cat >dovecot_mysql.te <<EOF
policy_module(dovecot_mysql,1.0.0)
gen_require(`
         type dovecot_t;
')
mysql_read_config(dovecot_t)
mysql_stream_connect(dovecot_t)
EOF
For some reason this made an empty file.  Don't know if it was the lack of
spaces on that first line?  I use this myself a lot, but always put spaces
around the > and <<
No need for spaces after >.  The issue with the above
example is that the HERE-DOC includes "`" chars which bash
tries to interpret.  It should display an error like this
when you run it:

     -bash: bad substitution: no closing "`" in `

To fix that, use:

     cat >dovecot_mysql.te <<\EOF
     ...

The change is the \ preceding EOF, telling bash to not
perform parameter/command/arithmetic expansions on the
HERE-DOC contents.


Ouch.  I have encountered this before and have had to use the \EOF convention.

Missed it this time around.

thanks for pointing it out.
_______________________________________________
selinux mailing list -- selinux@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to selinux-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/selinux@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux