Hi, I tried to apply a security context on a directory with the following commands: [root@ local]# semanage fcontext -a -t httpd_sys_rw_content_t "netdot(/.*)?" [root@ local]# restorecon -R netdot/ When I list the contexts, it is part of the list.... [root@ local]# semanage fcontext -l | grep netdot ./netdot(/.*)? all files system_u:object_r:httpd_sys_rw_content_t:s0 ... but does not appear on the directory itself: [root@ local]# ls -ldZ netdot/ drwxr-xr-x. root root unconfined_u:object_r:*usr_t*:s0 netdot/ I am expecting to see something like: drwxr-xr-x. root root unconfined_u:object_r:*httpd_sys_rw_content_t*:s0 netdot/ What am I doing wrong or do not understand? Thanks,
Hello Bernard, On Mon, 2016-10-17 at 09:10 -0400, Bernard Fay wrote:> I tried to apply a security context on a directory with the following > commands: > > [root@ local]# semanage fcontext -a -t httpd_sys_rw_content_t "netdot(/.*)?" > [root@ local]# restorecon -R netdot/Try using absolute paths in your commands and see if that fixes your issue. Regards, Leonard. -- mount -t life -o ro /dev/dna /genetic/research
I used the full path and got it working: [root@ local]# semanage fcontext -a -t httpd_sys_rw_content_t "/usr/local/netdot(/.*)?" [root@ local]# restorecon -R /usr/local/netdot/ [root@ local]# ls -ldZ /usr/local/netdot/ drwxr-xr-x. root root unconfined_u:object_r:httpd_sys_rw_content_t:s0 /usr/local/netdot/ On Mon, Oct 17, 2016 at 9:10 AM, Bernard Fay <bernard.fay at gmail.com> wrote:> Hi, > > I tried to apply a security context on a directory with the following > commands: > > [root@ local]# semanage fcontext -a -t httpd_sys_rw_content_t > "netdot(/.*)?" > [root@ local]# restorecon -R netdot/ > > > When I list the contexts, it is part of the list.... > [root@ local]# semanage fcontext -l | grep netdot > ./netdot(/.*)? all files > system_u:object_r:httpd_sys_rw_content_t:s0 > > > ... but does not appear on the directory itself: > [root@ local]# ls -ldZ netdot/ > drwxr-xr-x. root root unconfined_u:object_r:*usr_t*:s0 netdot/ > > > I am expecting to see something like: > drwxr-xr-x. root root unconfined_u:object_r:*httpd_sys_rw_content_t*:s0 > netdot/ > > > What am I doing wrong or do not understand? > > Thanks, > >
Our emails crossed on the line! ;-) Thanks anway Leonard, On Mon, Oct 17, 2016 at 9:26 AM, Leonard den Ottolander < leonard at den.ottolander.nl> wrote:> Hello Bernard, > > On Mon, 2016-10-17 at 09:10 -0400, Bernard Fay wrote: > > I tried to apply a security context on a directory with the following > > commands: > > > > [root@ local]# semanage fcontext -a -t httpd_sys_rw_content_t > "netdot(/.*)?" > > [root@ local]# restorecon -R netdot/ > > Try using absolute paths in your commands and see if that fixes your > issue. > > Regards, > Leonard. > > -- > mount -t life -o ro /dev/dna /genetic/research > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >