priority between file context rules

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

 



Hi,

 

I am trying to set contexts on httpd files on a server running CentOS release 6.4 (Final).

The server has several httpd running serving different hosts.

 

The directory tree is :

/WEBS/client_name/service_name/ contains configuration files, documents to serve, …

/WEBLOGS/client_name/service_name/ contains httpd logs

/WEBDATA/client_name/service_name/ contains datas

 

Here are the rules I wrote :

[root@odbfi007v ~]# semanage fcontext -l | grep WEB

/WEBDATA/lost\+found(/.*)?                         all files          system_u:object_r:lost_found_t:s0

/WEBLOGS(/.*)                                      all files          system_u:object_r:httpd_log_t:s0

/WEBLOGS/lost\+found(/.*)?                         all files          system_u:object_r:lost_found_t:s0

/WEBS/[^/]+/[^/]+/conf(/.*)?                       all files          system_u:object_r:httpd_config_t:s0

/WEBS/[^/]+/[^/]+/docs(/.*)?                       all files          system_u:object_r:httpd_sys_content_t:s0

/WEBS/[^/]+/[^/]+/logs                             all files          system_u:object_r:httpd_log_t:s0

/WEBS/lost\+found(/.*)?                            all files          system_u:object_r:lost_found_t:s0

 

I would like to set a default type on /WEBS and his subfolders:

semanage fcontext -a -t httpd_sys_content_t '/WEBS(/.*)?'

restorecon -Rv /WEBS*

However, this command sets the type httpd_sys_content_t recursively on everything in /WEBS

What is the priority between file context rules? I thought more precise rules will prevail on others.

 

Regards,

 

Hervé




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
--
selinux mailing list
selinux@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/selinux

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

  Powered by Linux