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 815816 - dhclient doesn't report failure to open given config file
Summary: dhclient doesn't report failure to open given config file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dhcp
Version: 6.3
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Popelka
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 760559
TreeView+ depends on / blocked
 
Reported: 2012-04-24 14:57 UTC by Ladislav Jozsa
Modified: 2012-04-24 15:34 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-24 15:34:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ladislav Jozsa 2012-04-24 14:57:22 UTC
Description of problem:
When running dhclient -cf ./dhclient.conf eth0 and the conf file is unreadable e.g. due to SELinux permissions or the conf file simple does not exist, dhclient does not report error nor non-zero exit status.

Version-Release number of selected component (if applicable):
dhclient-4.1.1-30.P1.el6

How reproducible:
always

Steps to Reproduce:d
1. Run dhclient -cf ./dhclient.conf eth0 where ./dhclient.conf file doesn't exist
2. # ls -l
total 0

# dhclient -cf ./dhclient.conf eth0

# echo $?
0
  
Actual results:
dhclient silently goes over missing config file and reports exit status 0.

Expected results:
dhclient should at least exit with non-zero status or even better complain about missing conf file or permission error

Additional info:
Filtered outpupt from strace:

grep open /tmp/dhclient.out 
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libcap-ng.so.0", O_RDONLY) = 3
open("/lib64/libc.so.6", O_RDONLY)      = 3
open("/dev/null", O_RDWR|O_CLOEXEC)     = 3
open("/etc/nsswitch.conf", O_RDONLY)    = 4
open("/etc/ld.so.cache", O_RDONLY)      = 4
open("/lib64/libnss_files.so.2", O_RDONLY) = 4
open("/etc/services", O_RDONLY|O_CLOEXEC) = 4
open("/var/run/dhclient.pid", O_RDONLY|O_CLOEXEC) = 4
open("/var/run/dhclient.pid", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 4
open("/proc/net/dev", O_RDONLY|O_CLOEXEC) = 4
open("./dhclient.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
open("/var/lib/dhclient/dhclient.leases", O_RDONLY|O_CLOEXEC) = 4
open("/var/lib/dhclient/dhclient.leases", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
open("/etc/localtime", O_RDONLY)        = 5
open("/proc/net/dev", O_RDONLY|O_CLOEXEC) = 5

Comment 2 Jiri Popelka 2012-04-24 15:34:55 UTC
Thank you for the report, however I think I have to disagree here.
dhclient (unlike dhcpd) can freely work without any configuration file.
The dhclient.conf serves only to overwrite the default values.

You can see (rpm -ql dhclient) that we don't ship any dhclient.conf because the defaults are fine in most cases. If I fixed this bug I'd need to ship dhclient with default (empty) dhclient.conf.


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