Description of problem: used snmpconf to generate an snmpd.conf file. file was created without proper SELINUX user/context as compared to the stock snmpd.conf file. Version-Release number of selected component (if applicable): net-snmp-libs-5.1.2-11.EL4.6 net-snmp-5.1.2-11.EL4.6 net-snmp-utils-5.1.2-11.EL4.6 How reproducible: Always Steps to Reproduce: 1. cd /etc/snmp 2. mv snmpd.conf snmpd.conf.orig 3. snmpdconf Actual results: # ls -lZ -rw-r--r-- root root root:object_r:etc_t snmpd.conf -rw-r--r-- root root system_u:object_r:snmpd_etc_t snmpd.conf.orig Expected results: -rw-r--r-- root root system_u:object_r:snmpd_etc_t snmpd.conf -rw-r--r-- root root system_u:object_r:snmpd_etc_t snmpd.conf.orig Additional info: had to manually - chcon -u system_u -t snmpd_etc_t snmpd.conf
snmpd_etc_t is the correct context. You can use matchpathcon to get the correct context for the file, and then setfscreatecon to cause the file to be created with the correct context. setfilecon will change the file context after it has been created. I will attach a patch with examples of how this was done in MAKEDEV
Created attachment 130225 [details] Example of using matchpathcon and setfscreatecon
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0738.html