Le 22/06/18 à 06:36, Noah Meyerhans a écrit :
On Thu, Mar 01, 2018 at 12:49:48PM +0100, Laurent Bigonville wrote:
On package installation, the /var/lib/spamassassin directory ends up
wrongly labeled on disk.
Thanks for this report.

There are two solutions here to fix this problem, either:

1) ship the directory in the package itself and do not create it in the
postinst script. This has also the advantage that dpkg -S will return
the owner of the directory.
This seems best.

2) Call restorecon just after creating the directory (before creating
anything else in it), something like:
"which restorecon >/dev/null 2>&1 && restorecon /var/lib/spamassassin"
should work.
I don't have much experience with SELinux. Are there any advantages to
using restorecon approach?

No, not really, it's sometimes needed if the maintainer scripts are generating files at installation time, but usually it's better the let dpkg do the right thing(tm) and let it create the files/directories.

Reply via email to