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 1261211 - ipa automount importer fails to import indirect maps having same key and different mount point.
Summary: ipa automount importer fails to import indirect maps having same key and diff...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-08 23:07 UTC by German Parente
Modified: 2019-08-15 05:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-11 10:51:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description German Parente 2015-09-08 23:07:49 UTC
Description of problem:

Customer is trying to import maps using the automountlocation-import command and it fails with duplicate keys.

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

How reproducible: always.


Steps to Reproduce:

Define these two different maps:

[root@idm-replica ~]# cat auto.test1 
test    ipa.example.com:/test
[root@idm-replica ~]# 

[root@idm-replica ~]# cat auto.test2 
test     idm-replica.example.org:/test

import them by doing:

ipa automountlocation-import default ./auto.test1 --continue
Imported maps:
Added ipa.example.com:/test

Imported keys:
Added test to auto.master

-------------------------

ipa automountlocation-import default ./auto.test2 --continue
Imported maps:
Added idm-replica.example.org:/test

Imported keys:


Duplicate keys skipped:
Skipped test

------------------------

The second import fails to import key. Because it's also added to auto.master.

If we see the objects created in audit logs, the dn is not including the map name (auto.testX)  not the mount point. So, we have this entry:

----------------------------------------------------
time: 20150908175129
dn: description=test,automountmapname=auto.master,cn=default,cn=automount,dc=example,dc=org
changetype: add
objectClass: automount
objectClass: top
automountKey: test
automountInformation: ipa.example.com:/test
description: test
creatorsName: uid=admin,cn=users,cn=accounts,dc=example,dc=org
modifiersName: uid=admin,cn=users,cn=accounts,dc=example,dc=org
createTimestamp: 20150908155129Z
modifyTimestamp: 20150908155129Z
----------------------------------------------------

At importing the second map, the dn will be exactly the same and that's why it fails. 

Probably importer should not use by default auto.master as automountmapname.


Actual results:

map is not imported.

Expected results:

Should be imported.

Additional info:

Comment 2 Petr Vobornik 2015-09-09 17:34:39 UTC
In the output of second command is stated that the map was imported:

Added idm-replica.example.org:/test

A failure of adding of a duplicate key to a auto.master map didn't prevent that (because --continue was used).

But I don't see any attempt to add keys from a map file defined in the master file.

Comment 3 Rob Crittenden 2015-09-09 17:44:55 UTC
I think the problem is that this expects that the import be done from an auto.master which utilizes these two maps, auto.test and auto.test1, and not a discrete map file containing a single map.

Comment 4 German Parente 2015-09-09 19:00:26 UTC
At the end, the result is that what customer wants to describe is not possible by importing the automount maps.

The map is created but as the second key is not imported, the specification of the map will not be exactly what customer has currently in its maps.

Comment 5 Rob Crittenden 2015-09-09 19:04:26 UTC
If they use their file-based auto.master it should work better. It might look something like:

/test    /etc/auto.test
/test1   /etc/auto.test1

I don't dispute that the import is quite a bit misleading and possibly broken when used with a leaf map.

Comment 6 Petr Vobornik 2015-09-10 15:08:48 UTC
Is there anything to fix? Should we close this bz?

Comment 7 German Parente 2015-09-10 16:47:14 UTC
I would have said the importer. But if you consider this is not a bug, feel free to close it.

Regarding comment 5, the customer issue is different. He has same key, indirect, that is mounted differently depending the site.

Example is

test      server1:/space/test

and 

test      server2:/space/test

If you try to specify this in ipa if fails because ipa is building the DN using indirect key + auto,master. So the dn will be duplicate and the import will fail. But the customer specification is valid one, though.

Comment 8 Rob Crittenden 2015-09-10 17:38:33 UTC
In this case site == location which means they cannot live within the same auto.master. They need to have a separate location for each "site" where keys would be duplicated.

Comment 9 German Parente 2015-09-10 17:49:04 UTC
Thanks and sorry for my ignorance. I guess I should specify it like this ?


[root@idm-replica ~]# ipa automountlocation-add site1
--------------------------------
Added automount location "site1"
--------------------------------
  Location: site1
[root@idm-replica ~]# ipa automountlocation-add site2
--------------------------------
Added automount location "site2"
--------------------------------

ipa automountlocation-import site1 auto.test1 
Imported maps:
Added ipa.example.com:/test

Imported keys:
Added test to auto.master

[root@idm-replica ~]# ipa automountlocation-import site2 auto.test2
Imported maps:
Added idm-replica.example.org:/test

Imported keys:
Added test to auto.master

I think we can close this bug, then. Sorry for the noise.

Comment 10 Petr Vobornik 2015-09-11 10:51:29 UTC
closing according to comment 9


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