last day (22 days later) » 

13:45
Thanks for dropping in
no problem
as I said I'm trying to understand things better
OK
What you said about the message being exclusive to the next line is kind of confusing in the context of the output I'm seeing from audit2allow
I'll try to explain that point better:
`#============= httpd_t ==============`

`#!!!! This avc can be allowed using one of the these booleans:`
`# httpd_read_user_content, httpd_enable_homedirs`
`allow httpd_t user_home_t:file read;`
`allow httpd_t var_lib_t:file unlink;`
If I isolate the messages then the read errors produces

`#============= httpd_t ==============`

`#!!!! This avc can be allowed using one of the these booleans:`
`# httpd_read_user_content, httpd_enable_homedirs`
`allow httpd_t user_home_t:file read;`

and the unlink errors produce
13:47
ok I see the problem I'm having now
#============= httpd_t ==============

#!!!! This avc can be allowed using one of the these booleans:
# httpd_can_network_connect, httpd_can_network_connect_db
allow httpd_t mysqld_port_t:tcp_socket name_connect;

#!!!! This avc can be allowed using one of the these booleans:
# httpd_can_sendmail, allow_ypbind, httpd_can_network_connect
allow httpd_t smtp_port_t:tcp_socket name_connect;

#!!!! This avc can be allowed using one of the these booleans:
# httpd_read_user_content, httpd_enable_homedirs
the format of the output is confusing
are you trying to host web content in public_html?
under $HOME/user/$public_html?
OK, let's take one of the messages:
no, under /srv
I understand the messages I was confused by the format I think.
there being no blank line between
allow httpd_t user_home_t:file read;
allow httpd_t var_lib_t:file unlink;
seemed to me to be suggesting they were related
but they're not
so it makes sense now
14:27
sorry brb
yeah, they are not. Every "#!!!! This avc can be allowed ..." line refers to the first `allow` line below
So:
#!!!! This avc can be allowed using one of the these booleans:
# httpd_read_user_content, httpd_enable_homedirs
allow httpd_t user_home_t:file read;
is a semantic block
so to speak
yes, that makes sense now
now I just need to figure out why /srv/www on this system is correctly labelled :httpd_sys_content_t
I know I didn't do it
14:51
5
Q: Correct usage of /srv on debian systems

L. LopezI'm a bit confused about what goes inside /srv and looking for good practices about its usage on Debian. Acording to the FHS: "/srv contains site-specific data which is served by this system." However I'm not sure if things like MySQL data files, munin's rrd files and stuff like that can/should...

there is a hint about that in this Q/A
@dawud ok interesting - when is that configured - during installation ?
or rather, when I create a system and later come back and add www to /srv when/how is it labelled ?
15:15
It is part of the reference policy as installed by default. You can check it in a live system under grep -R www /etc/selinux/targeted/contexts/ , or using semanage fcontext -l | grep www
the labelling should occur on creation time, i.e., whenever a file/dir is created (`mkdir` `touch` `cp`, but not `mv` ) in a location known in the policy, it gets labeled accordingly
when you `mv` a file, it keeps its original SELinux label. It is a common pitfall.
ok I have just spun up a new CentOS 6.4 system to test it and that's not happening I created /srv/www/iain and it didn't get labelled as httpd_sys_content_t instead it's var_t
ok. check matchpathcon /srv/www/iain and restorecon -v -R /srv/www
15:36
matchpathcon /srv/www/iain
/srv/www/iain system_u:object_r:httpd_sys_content_t:s0
ls -Z /srv/www/iain
-rw-r--r--. root root unconfined_u:object_r:var_t:s0 /srv/www/iain
any idea why it isn't picking up the default ?
15:51
WRT that issue, there was an interesting Q/A recently:
1
Q: SELinux - canonical way of automatically applying a context on file creation

Adrian FrühwirthMy current understanding is that you have to manually use restorecon to apply the desired context to a newly created file or directory unless you are happy with the context that it inherits from its parent directory. I am wondering if it is possible to automatically apply a context on creation b...

I have always thought labeling occurs on creation. I don't even recall relabeling when moving from /var/www to /srv/www. But, then, I also have the restorecond service running by default.
I have just tried it in my Fedora 19, and /srv/www does not get properly labeled on creation
restoring works fine
`# restorecon -v -R /srv/`
`restorecon reset /srv/www context unconfined_u:object_r:var_t:s0->unconfined_u:object_r:httpd_sys_content_t:s0`
ok so is this a bug like Michael suggests ?
I am tempted to ask this in IRC, sometimes you can find Dan Walsh himself hanging around, and He Must Know
I honestly don't know.
This is a minor annoyance, anyway, (IMHO)

  last day (22 days later) »