[CentOS] how to set a directory to system_u?

Sun Oct 3 16:44:35 UTC 2021
centos at niob.at <centos at niob.at>

What about

   semanage fcontext   ??

see "man semanage-fcontext"

peter


Am 02.10.21 um 13:49 schrieb hw:
> Hi,
>
> I'm trying to a lable a directory for ejabberd to store files
> that were uploaded with the http_upload module.  Apparently
> I should set this to 'system_u:object_r:ejabberd_var_lib_t:s0'
> since all the files in /var/lib/ejabberd are.  So:
>
>
> ls -laZ /srv/data/
> unconfined_u:object_r:ejabberd_var_lib_t:s0 320 Jul 29 23:55 ejabberd
> semanage fcontext -a -t ejabberd_var_lib_t -s system_u '/srv/data/ejabberd(/.*)?'
> restorecon -R /srv/data/ejabberd/
> ls -laZ /srv/data/
> unconfined_u:object_r:ejabberd_var_lib_t:s0 320 Jul 29 23:55 ejabberd
>
>
> Why doesn't this work?  Why can't they finally write some decent tool to
> use selinux that allows us to keep it enabled???
>
> How can I set up the directory for ejabberd to store files in?
>
>