Bug 962737 - The file /etc/idmapd.conf will be incorrect if you configured NFSv4 Domain with the same words in /etc/idmapd.conf.
The file /etc/idmapd.conf will be incorrect if you configured NFSv4 Domain w...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ovirt-node (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Fabian Deutsch
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2013-05-14 06:58 EDT by wanghui
Modified: 2014-01-21 14:34 EST (History)
14 users (show)

See Also:
Fixed In Version: ovirt-node-3.0.0-6.el6
Doc Type: Bug Fix
Doc Text:
Previously, if you set the domain to some value that is found elsewhere in the idmapd.conf file, and then updated again, it would replace all occurences of the value in the file. This has been fixed by making sure to only edit the Domain line in idmapd.conf.
Story Points: ---
Clone Of:
Last Closed: 2014-01-21 14:34:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description wanghui 2013-05-14 06:58:24 EDT
Description of problem:
The configuration file /etc/idmapd.conf will be incorrect if you configured NFSv4 Domain with the same words in /etc/idmapd.conf.

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

How reproducible:

Steps to Reproduce:
1. Clear install RHEV-H.
2. On the Remote Storage page, configure NFSv4 Domain with the same words in /etc/idmapd.conf.
   eg: nobody
3. On the Remote Storage page, configure NFSv4 Domain with another name.
4. Check in the /etc/idmapd.conf file.
Actual results:
After step4, it changes all the name which is matched with NFSv4 Domain name which is setted up before in /etc/idmapd.conf.

This problem is caused by the following code.
    574 def set_nfsv4_domain(domain):
    575     idmap_conf = "/etc/idmapd.conf"
    576     current_domain = get_current_nfsv4_domain()
    577     unmount_config(idmap_conf)
    578     if current_domain.startswith("#"):
    579         current_domain = "#Domain = %s" % current_domain.replace("# ",""        )
    580         system("sed -i 's/%s/Domain = %s/g' %s" \
    581             % (current_domain, domain, idmap_conf))
    582     else:
    583         system("sed -i 's/%s/%s/g' %s" \
    584             % (current_domain, domain, idmap_conf))
    585     if ovirt_store_config(idmap_conf):
    586         logger.info("NFSv4 domain set as: " + domain)
    587     else:
    588         logger.warning("Setting nfsv4 domain failed")
    589     system_closefds("service rpcidmapd restart")
    590     system_closefds("nfsidmap -c &>/dev/null")

From the line 583-584, we can see it will replace all the words which are matched with the input domain. And that's we do wanted since we only want to change the domain name.

Expected results:
After step4, it only changes the name of the domain field in /etc/idmapd.conf.

Additional info:
Comment 2 Mike Burns 2013-05-15 11:09:57 EDT
Patch:  http://gerrit.ovirt.org/14751

This makes sure that it only edits lines that start with "Domain"
Comment 8 wanghui 2013-10-18 07:01:34 EDT
Because the bug#980451 in rhev-hypervisor6.5 blocks the test of this bug. So I will wait to check this bug once the bug#980451 is fixed.

Comment 9 wanghui 2013-10-28 04:16:05 EDT
Test version:

Test steps:
1. Clear install rhevh-6.5-20131024.1.0.iso.
2. Configure NFSv4 domain name with nobody.
3. On the Remote Storage page, configure NFSv4 Domain with another name.
4. Check in the /etc/idmapd.conf file.

Test result:
1. After step4, it only changes the Domain field in /etc/idmapd.conf file.

This bug is fixed in rhevh-6.5-20131024.1.0.iso. So change the status from ON_QA to VERIFIED.
Comment 11 Cheryn Tan 2013-11-07 19:32:22 EST
This bug is currently attached to errata RHBA-2013:15277. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:


Thanks in advance.
Comment 13 errata-xmlrpc 2014-01-21 14:34:08 EST
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.


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