Bug 813387

Summary: zero-length /etc/sysconfig/network file
Product: Red Hat Enterprise Linux 5 Reporter: Dmitri Pal <dpal>
Component: ipa-clientAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.7CC: arubin, bgollahe, jgalipea, ksiddiqu, mkosek
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-client-2.1.3-3.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 07:08:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Correct creation of temporary file for replacing variables
none
Correct creation of temporary file for replacing variables none

Description Dmitri Pal 2012-04-17 15:52:45 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2640

User reported that on CentOS 5 with 2.1.3-1 ipa-client-install was creating a zero-length /etc/sysconfig/network file.

The contents of the original file were:

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=kelvin-c5

He was installing with:

ipa-client-install --no-ntp --force --hostname=kelvin-c5.<dnsdomainname>

The full thread is at https://www.redhat.com/archives/freeipa-users/2012-April/msg00049.html

Comment 1 Rob Crittenden 2012-05-08 14:42:45 UTC
Re-assigning product to RHEL 5, this does not occur in RHEL 6.

Comment 2 Rob Crittenden 2012-05-08 14:43:42 UTC
I have been able to reproduct in el5.7 but not 6.2, 6,3 or several versions of Fedora. This must be a bug in the backport of 2.1.3 back to RHEL 5.x

Comment 3 Rob Crittenden 2012-05-08 18:28:34 UTC
Created attachment 583056 [details]
Correct creation of temporary file for replacing variables

Basically we were opening a temporary file to be used to do the variable replacement and then trying to read that file as the source. Since we just opened it there was nothing to read so we exited, leaving a zero-length file.

Once the right file was used I found a block indention problem that was causing us to try to operate on a closed file.

With both of these fixed the --hostname argument no longer results in a zero-length /etc/sysconfig/network file.

Comment 5 Rob Crittenden 2012-05-09 13:07:30 UTC
Created attachment 583270 [details]
Correct creation of temporary file for replacing variables

Corrected patch.

Comment 11 errata-xmlrpc 2013-01-08 07:08:16 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.

http://rhn.redhat.com/errata/RHBA-2013-0019.html