This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 192447 - snmpconf generates snmpd.conf file with wrong SELINUX context
snmpconf generates snmpd.conf file with wrong SELINUX context
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Safranek
:
Depends On:
Blocks: 247461 247462 248329
  Show dependency treegraph
 
Reported: 2006-05-19 15:10 EDT by Chris Stankaitis
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0738
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:00:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Example of using matchpathcon and setfscreatecon (6.46 KB, text/x-chdr)
2006-05-30 08:57 EDT, Daniel Walsh
no flags Details

  None (edit)
Description Chris Stankaitis 2006-05-19 15:10:41 EDT
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
Comment 2 Daniel Walsh 2006-05-30 08:56:05 EDT
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



Comment 3 Daniel Walsh 2006-05-30 08:57:41 EDT
Created attachment 130225 [details]
Example of using matchpathcon and setfscreatecon
Comment 5 RHEL Product and Program Management 2007-06-13 12:05:24 EDT
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.
Comment 10 errata-xmlrpc 2007-11-15 11:00:09 EST
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

Note You need to log in before you can comment on or make changes to this bug.