Bug 192447 - snmpconf generates snmpd.conf file with wrong SELINUX context
Summary: snmpconf generates snmpd.conf file with wrong SELINUX context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jan Safranek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 247461 247462 248329
TreeView+ depends on / blocked
 
Reported: 2006-05-19 19:10 UTC by Chris Stankaitis
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHBA-2007-0738
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 16:00:09 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0738 0 normal SHIPPED_LIVE net-snmp bug fix update 2007-11-14 16:40:02 UTC

Description Chris Stankaitis 2006-05-19 19:10:41 UTC
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 12:56:05 UTC
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 12:57:41 UTC
Created attachment 130225 [details]
Example of using matchpathcon and setfscreatecon

Comment 5 RHEL Program Management 2007-06-13 16:05:24 UTC
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 16:00:09 UTC
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.