Bug 229699
Summary: | objectclass without parent causes StringIndexOutOfBounds in console | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Aaron Luchko <aaron> | ||||||||
Component: | UI - Configuration | Assignee: | Amita Sharma <amsharma> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||||
Severity: | low | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 1.0.4 | CC: | amsharma, jgalipea | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2015-12-07 17:02:59 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: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 434915 | ||||||||||
Attachments: |
|
Description
Aaron Luchko
2007-02-22 20:12:21 UTC
Turns out that this bug only occurs when the objectclass doesn't inherit from another (ie 'SUP top'), which it appears it's supposed to, and the attribute thing has nothing to do with it. The problem here is that when you are running the user editor, the console expects there to be the "person" objectclass somewhere in there. Otherwise, it gets confused. Created attachment 481673 [details]
Console Framework Diffs
The exception was occuring since the Console assumed that an entry created by going to "New->User" would have the givenname and sn attribute present and never checked if they were null before calling the String.substring() method. The fix is to first check if these attributes are null.
There were other issues around this problem as well. The ResourcePageObservable class that is used to represent the entry being edited keeps a list of objectclasses along with the list of attributes and values for the entry (including the objectclass attribute). The problem was that removing an objectclass from the entry in the editor did not remove the objectclass from the objectclass list. This causes the editor to make assumptions about the entry, such as the presence of the givenname and sn attribute that caused the exception. The fix is to sync the objectclass list with the actual objectclasses that are present in the entry when a change is made.
Created attachment 481675 [details]
DS Console Patch
Checked idm-console-framework patch into console (HEAD). Thanks to Noriko for her review! Checking in src/com/netscape/management/client/ug/ResourceEditor.java; /cvs/dirsec/console/src/com/netscape/management/client/ug/ResourceEditor.java,v <-- ResourceEditor.java new revision: 1.2; previous revision: 1.1 done Checking in src/com/netscape/management/client/ug/ResourcePageObservable.java; /cvs/dirsec/console/src/com/netscape/management/client/ug/ResourcePageObservable.java,v <-- ResourcePageObservable.java Pushed ds-console patch to master. Thanks to Noriko for her review! Counting objects: 17, done. Delta compression using up to 2 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (9/9), 1.23 KiB, done. Total 9 (delta 4), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds-console.git 35194d5..2ada9d0 master -> master Created attachment 513721 [details]
SS
Followed below steps on RHEL6 - DS9.0
2. Add the following schema:
# cat /opt/fedora-ds/slapd-localhost/config/schema/61-maillist.ldif
dn: cn=schema
attributeTypes: ( 1.3.6.1.4.1.18320.1.2 NAME 'maildrop' DESC 'Email account or username to deliver all email to' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'A Postfix Schema' )
objectClasses: ( 1.3.6.1.4.1.18320.2.1 NAME 'PostfixUser' DESC 'Email user with a live email box at HCI' MUST (maildrop $ mail) X-ORIGIN 'A Postfix Schema' )
and restart the server
ldapmodify -x -h localhost -p 1389 -D "cn=directory manager" -w Secret123 -v << EOF
dn: cn=schema
changetype: modify
add: attributetypes
attributeTypes: ( 1.3.6.1.4.1.18320.1.2 NAME 'maildrop' DESC 'Email account or username to deliver all email to' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X ORIGIN 'A Postfix Schema' )
EOF
ldapmodify -x -h localhost -p 1389 -D "cn=directory manager" -w Secret123 -v << EOF
dn: cn=schema
changetype: modify
add: objectClasses
objectClasses: ( 1.3.6.1.4.1.18320.2.1 NAME 'PostfixUser' DESC 'Email user with a live email box at HCI' MUST (maildrop $ mail) X-ORIGIN 'A Postfix Schema' )
EOF
and restarted the server.
3. open the server localhost and in the directory tab select localhost and click
New > User
4. Click Advanced...
5. Add postfixuser to Object Class, then delete everything in Object Class
except for postfixuser and top. Add something for the mail address and maildrop
6. Click Ok, now in the Create New User window click Ok again
Perfectly working. no error. PFA for the Screen Shot.
|