Bug 725433

Summary: automountmap gets added even though the return code is 1.
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.2CC: benl, dpal, jgalipea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.1.0-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: Adding an indirect automount map to a mount point that already exists returns an error but the map is created anyway. Consequence: The map is not removeable using ipa tools. Fix: Adding an indirect map requires creating a key to store the mount point,. If adding the map fails because the key exists then remove the map. Result: The data is consistent.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:41:52 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:

Description Gowrishankar Rajaiyan 2011-07-25 13:29:08 UTC
Description of problem:


Version-Release number of selected component (if applicable):
ipa-server-2.0.99-3.20110721T0516zgit8e8ad51.el6.x86_64

How reproducible:


Steps to Reproduce:
1. # ipa  automountlocation-add baltimore
------------------------------------
Added automount location "baltimore"
------------------------------------
  Location: baltimore

2. # ipa automountmap-add baltimore auto.share
--------------------------------
Added automount map "auto.share"
--------------------------------
  Map: auto.share

3. # ipa automountkey-add baltimore auto.master --key=/share --info=auto.share
---------------------------------
Added automount key "auto.master"
---------------------------------
  Key: /share
  Mount information: auto.share

4. # ipa automountmap-add-indirect baltimore auto.share2 --mount=/usr/share/man
---------------------------------
Added automount map "auto.share2"
---------------------------------
  Map: auto.share2

5. # ipa automountmap-add-indirect baltimore auto.share3 --mount=/usr/share/man
ipa: ERROR: key named /usr/share/man already exists
(as expected)

6. # echo $?
1

  
Actual results:
# /usr/bin/ldapsearch -LLL -x -h localhost -D "cn=Directory Manager" -w Secret123 -b dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com "(&(objectclass=automountmap)(automountMapName=auto.share3))"
dn: automountmapname=auto.share3,cn=baltimore,cn=automount,dc=lab,dc=eng,dc=pn
 q,dc=redhat,dc=com
objectClass: automountmap
objectClass: top
automountMapName: auto.share3

Though the return code is 1, map gets created.

Expected results:
automountmap should not get created. 

Additional info:

Comment 1 Rob Crittenden 2011-07-25 13:40:58 UTC
https://fedorahosted.org/freeipa/ticket/1520

Comment 3 Rob Crittenden 2011-07-27 19:04:19 UTC
master: 62445b8673288212ab3cdc1f5b6d1d81457831ac

ipa-2-0: 7d91b33377f57fdd4d8275c472614daa64b77372

Comment 5 Gowrishankar Rajaiyan 2011-10-08 13:41:06 UTC
[root@bumblebee ~]# ipa  automountlocation-add baltimore
------------------------------------
Added automount location "baltimore"
------------------------------------
  Location: baltimore
[root@bumblebee ~]# ipa automountmap-add baltimore auto.share
--------------------------------
Added automount map "auto.share"
--------------------------------
  Map: auto.share
[root@bumblebee ~]# ipa automountkey-add baltimore auto.master --key=/share --info=auto.share
----------------------------
Added automount key "/share"
----------------------------
  Key: /share
  Mount information: auto.share
[root@bumblebee ~]# ipa automountmap-add-indirect baltimore auto.share2 --mount=/usr/share/man
---------------------------------
Added automount map "auto.share2"
---------------------------------
  Map: auto.share2
[root@bumblebee ~]# ipa automountmap-add-indirect baltimore auto.share3 --mount=/usr/share/man
ipa: ERROR: key named /usr/share/man already exists
[root@bumblebee ~]# echo $?
1

[root@bumblebee ~]# /usr/bin/ldapsearch  -LLL -x -h localhost -D "cn=Directory Manager" -w Secret123 -b dc=lab,dc=eng,dc=pnq,dc=redhat,dc=com "(&(objectclass=automountmap)(automountMapName=auto.share3))"
[root@bumblebee ~]# echo $?
0
[root@bumblebee ~]# 

Verified.
[root@bumblebee ~]# rpm -qi ipa-server
Name        : ipa-server                   Relocations: (not relocatable)
Version     : 2.1.2                             Vendor: Red Hat, Inc.
Release     : 2.el6                         Build Date: Fri 07 Oct 2011 05:09:04 PM EDT
Install Date: Sat 08 Oct 2011 07:36:33 AM EDT      Build Host: x86-001.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: ipa-2.1.2-2.el6.src.rpm
Size        : 3363225                          License: GPLv3+
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.freeipa.org/
Summary     : The IPA authentication server

Comment 6 Rob Crittenden 2011-10-31 21:14:29 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: Adding an indirect automount map to a mount point that already exists returns an error but the map is created anyway.
Consequence: The map is not removeable using ipa tools.
Fix: Adding an indirect map requires creating a key to store the mount point,. If adding the map fails because the key exists then remove the map.
Result: The data is consistent.

Comment 7 errata-xmlrpc 2011-12-06 18:41:52 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/RHSA-2011-1533.html