RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1227293 - chrooted_path not handled properly by dhcpd resource agent [patch]
Summary: chrooted_path not handled properly by dhcpd resource agent [patch]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Fabio Massimo Di Nitto
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-02 11:01 UTC by Radek Steiger
Modified: 2015-11-19 04:48 UTC (History)
2 users (show)

Fixed In Version: resource-agents-3.9.5-47.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 04:48:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch: replace hardcoded paths with OCF_RESKEY_chrooted_path (681 bytes, patch)
2015-06-02 11:02 UTC, Radek Steiger
no flags Details | Diff
optional patch: change default chroot path to dhcp's real default path (427 bytes, patch)
2015-06-02 11:07 UTC, Radek Steiger
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2190 0 normal SHIPPED_LIVE resource-agents bug fix and enhancement update 2015-11-19 08:06:48 UTC

Description Radek Steiger 2015-06-02 11:01:24 UTC
> Description of problem:

The dhcpd resource agent provides chrooted_path parameter however the default /var/lib/dhcp path is hardcoded at certain places in the agent script, therefore using this parameter doesn't give the expected results. If I set chrooted_path to anything other, following shows in the log: 

Jun  2 10:49:48 virt-142 dhcpd: isc-dhcpd-4.2.5
Jun  2 10:49:48 virt-142 crmd[1674]: notice: process_lrm_event: Operation dhcpd_monitor_0: not running (node=virt-142, call=588, rc=7, cib-update=440, confirmed=true)
Jun  2 10:49:49 virt-142 dhcpd: isc-dhcpd-4.2.5
Jun  2 10:49:49 virt-142 dhcpd(dhcpd)[2052]: ERROR: could not copy /lib64/libdl.so.2 to chroot jail
Jun  2 10:49:49 virt-142 dhcpd(dhcpd)[2052]: ERROR: Could not fully initialize the chroot environment.
Jun  2 10:49:49 virt-142 lrmd[1671]: notice: operation_finished: dhcpd_start_0:2052:stderr [ cp: cannot create regular file '/var/lib/dhcp/lib*/': No such file or directory ]
Jun  2 10:49:49 virt-142 lrmd[1671]: notice: operation_finished: dhcpd_start_0:2052:stderr [ ocf-exit-reason:could not copy /lib64/libdl.so.2 to chroot jail ]
Jun  2 10:49:49 virt-142 lrmd[1671]: notice: operation_finished: dhcpd_start_0:2052:stderr [ ocf-exit-reason:Could not fully initialize the chroot environment. ]
Jun  2 10:49:49 virt-142 dhcpd: isc-dhcpd-4.2.5
Jun  2 10:49:49 virt-142 crmd[1674]: notice: process_lrm_event: Operation dhcpd_start_0: not installed (node=virt-142, call=589, rc=5, cib-update=441, confirmed=true)
Jun  2 10:49:49 virt-142 crmd[1674]: notice: process_lrm_event: virt-142-dhcpd_start_0:589 [ cp: cannot create regular file '/var/lib/dhcp/lib*/': No such file or directory\nocf-exit-reason:could not copy /lib64/libdl.so.2 to chroot jail\nocf-exit-reason:Could not fully initialize the chroot environment.\n ]
Jun  2 10:49:49 virt-142 dhcpd: isc-dhcpd-4.2.5
Jun  2 10:49:49 virt-142 dhcpd(dhcpd)[2203]: INFO: dhcpd already stopped
Jun  2 10:49:49 virt-142 crmd[1674]: notice: process_lrm_event: Operation dhcpd_stop_0: ok (node=virt-142, call=590, rc=0, cib-update=442, confirmed=true)


> Version-Release number of selected component (if applicable):

resource-agents-3.9.5-40.el7_1.3.x86_64


> How reproducible:

Always


> Steps to Reproduce:
0. create custom dhcp config in /etc/mydhcp.conf
1. pcs resource create DHCP dhcpd config=/etc/mydhcp.conf chrooted_path=/var/lib/mydhcpjail user=dhcpd group=dhcpd interface=eth0
2. 
3. 


> Actual results:

Libs are missing from /var/lib/mydhcpjail. See the log above.


> Expected results:

/var/lib/mydhcpjail is fully populated with required libs.

Comment 1 Radek Steiger 2015-06-02 11:02:23 UTC
Created attachment 1033704 [details]
proposed patch: replace hardcoded paths with OCF_RESKEY_chrooted_path

Comment 2 Radek Steiger 2015-06-02 11:07:21 UTC
Created attachment 1033706 [details]
optional patch: change default chroot path to dhcp's real default path

By default dhcp uses /var/lib/dhcpd directory. The resource agent however uses its own /var/lib/dhcp directory for chroot by default which causes problems with selinux. This patch changes the default chroot_path to the same directory as provided by dhcp rpm package.

Comment 3 David Vossel 2015-06-25 18:19:25 UTC
modified patches a bit and posted them upstream.

https://github.com/ClusterLabs/resource-agents/pull/627

Comment 9 errata-xmlrpc 2015-11-19 04:48:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2190.html


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