Bug 499018 - ipa host-mod: modifying host's location just keeps adding more location attributes
ipa host-mod: modifying host's location just keeps adding more location attr...
Status: CLOSED UPSTREAM
Product: freeIPA
Classification: Community
Component: ipa-admintools (Show other bugs)
2.0
All Linux
medium Severity medium
: v2 release
: ---
Assigned To: Dmitri Pal
Chandrasekar Kannan
:
Depends On:
Blocks: 431020
  Show dependency treegraph
 
Reported: 2009-05-04 16:16 EDT by Jenny Galipeau
Modified: 2015-01-04 18:38 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-28 05:28:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
apache error_log (957.48 KB, application/octet-stream)
2009-05-05 07:50 EDT, Jenny Galipeau
no flags Details

  None (edit)
Description Jenny Galipeau 2009-05-04 16:16:16 EDT
Description of problem:
Instead of modifying the existing localityname attribute, ipa host-mod --locality keeps adding more localityname attributes.  

On a side note: Probably shouldn't be multi-valued.  The host can only physically be in one place :-)

[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: this is a very interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga

[root@jennyv2 schema]# ipa host-mod --locality="Brookline, NH" jennyv4.bos.redhat.com
Host updated

[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: this is a very interesting description
  localityname: Mountain View, CA
  localityname: Brookline, NH
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga

[root@jennyv2 schema]# ipa host-mod --locality="Westford, MA" jennyv4.bos.redhat.com
Host updated

[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: this is a very interesting description
  localityname: Mountain View, CA
  localityname: Brookline, NH
  localityname: Westford, MA
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga


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

How reproducible:
always

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:
each modification creates another localityname attribute

Expected results:
one localityname attribute - host-mod to replace the value.

Additional info:
Comment 1 Jenny Galipeau 2009-05-04 17:44:07 EDT
additonal info

ipa host-show FQDN on host with multiple localityname results in 
ipa: ERROR: an internal error has occured
Comment 2 Rob Crittenden 2009-05-04 17:48:59 EDT
The Apache error log should contain the backtrace hidden by this internal error output. Can you attach a tail -100 /var/log/httpd/error_log to the bug?
Comment 3 Jenny Galipeau 2009-05-05 07:50:31 EDT
Created attachment 342441 [details]
apache error_log
Comment 4 Pavel Zuna 2009-05-27 13:41:15 EDT
The problem is/was that LDAP had synonyms for its attributes. 'localityname' (used by the host plugin) is equivalent to 'l' and 'locality'. LDAP seems to prefer the shortest versions.

The LDAP backend(s) in IPA generate modlists (i.e. what should be modified) by comparing the new and old values of the attribute. But since the new value is stored under 'localityname' and the old value is returned from LDAP under 'l', there is no valid comparison going on.

I submitted a patch on freeipa-devel that should fix this issue in the host plugin, but we should be careful when creating new plugins, as there is no easy generic fix for this kind of bug.

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