Bug 234948 - Console hangs when adding a custom entry and schema items are in certain order
Console hangs when adding a custom entry and schema items are in certain order
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: UI - Dir Browser (Show other bugs)
1.0.4
All Linux
high Severity high
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
: 229693 435646 462970 (view as bug list)
Depends On:
Blocks: 152373 249650 FDS1.2.0
  Show dependency treegraph
 
Reported: 2007-04-02 20:56 EDT by Ulf Weltman
Modified: 2015-01-04 18:25 EST (History)
6 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-29 18:59:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
diffs (8.81 KB, patch)
2008-12-05 17:55 EST, Rich Megginson
no flags Details | Diff
cvs commit log (1.03 KB, text/plain)
2008-12-05 18:47 EST, Rich Megginson
no flags Details

  None (edit)
Description Ulf Weltman 2007-04-02 20:56:01 EDT
Directory Browser advanced editor throws a NPE if you try to add an object of a
custom object class if the schema for that objectclass has the SUP item before
the DESC.  For example:
objectClasses: ( testschema-oid NAME 'testschema' SUP top DESC 'testschema' MUST
( cn ) X-ORIGIN 'testschema' )

java.lang.NullPointerException
        at
com.netscape.admin.dirserv.propedit.DSEntryPanel.createActionPanel(Unknown Source)
        at com.netscape.admin.dirserv.propedit.DSEntryPanel.<init>(Unknown Source)
        at com.netscape.admin.dirserv.EntryEditor.doGenericDialog(Unknown Source)
        at com.netscape.admin.dirserv.EntryEditor.addGeneric(Unknown Source)
        at com.netscape.admin.dirserv.EntryEditor.createObject(Unknown Source)
        at com.netscape.admin.dirserv.DSContentPage.actionNewObject(Unknown Source)
        at com.netscape.admin.dirserv.DSContentPage.actionPerformed(Unknown Source)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
        at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
        at java.awt.Component.processMouseEvent(Component.java:5163)
        at java.awt.Component.processEvent(Component.java:4960)
        at java.awt.Container.processEvent(Container.java:1569)
        at java.awt.Component.dispatchEventImpl(Component.java:3678)
        at java.awt.Container.dispatchEventImpl(Container.java:1627)
        at java.awt.Component.dispatchEvent(Component.java:3540)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
       at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
        at java.awt.Container.dispatchEventImpl(Container.java:1613)
        at java.awt.Window.dispatchEventImpl(Window.java:1606)
        at java.awt.Component.dispatchEvent(Component.java:3540)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Comment 2 Rich Megginson 2008-03-03 11:44:25 EST
*** Bug 435646 has been marked as a duplicate of this bug. ***
Comment 3 Rich Megginson 2008-12-05 12:45:57 EST
*** Bug 462970 has been marked as a duplicate of this bug. ***
Comment 4 Rich Megginson 2008-12-05 12:48:56 EST
This is one of the consequences of https://bugzilla.redhat.com/show_bug.cgi?id=170791

If you add the following oc:

objectClasses: ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL DESC 'Sudoer Entries' MUST ( cn ) MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoOption $ description ) X-ORIGIN 'SUDO' )

If you look at the entry over LDAP you see something like this:

objectClasses: ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' DESC 'Sudoer Entries'
  STRUCTURAL MUST cn MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ su
 doOption $ description ) X-ORIGIN ( 'SUDO' 'user defined' ) )

Note that the entry read over LDAP does not have SUP top.  This confuses the console.  I think the solution is to always add top to structural objectclasses.
Comment 5 Rich Megginson 2008-12-05 13:16:53 EST
*** Bug 229693 has been marked as a duplicate of this bug. ***
Comment 6 Rich Megginson 2008-12-05 17:55:51 EST
Created attachment 325922 [details]
diffs
Comment 7 Rich Megginson 2008-12-05 18:47:11 EST
Created attachment 325941 [details]
cvs commit log

Reviewed by: nkinder (Thanks!)
Fix Description: The problem is primarily due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 "Schema file parsing overly picky?" - the console schema editor expects an objectclass to always have at least 1 superior.  The bug causes SUP not to be present in the schema entry in the directory server.  The fix is to use a schema helper function to make sure the list of superior objectclasses always contains at least "top".  I also added a check for a null value to avoid the NullPointerException console error.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Comment 8 Jenny Galipeau 2009-03-19 10:21:59 EDT
fix verified HP-UX and RHEL 4 - DS 8.1

The following added to user99.ldif and server restart

objectClasses: ( testschema-oid NAME 'testschema' SUP top DESC '' STRUCTURAL M
 AY cn X-ORIGIN 'user defined' )

No NPE, can add user, advanced editor and add new objectclass without issue.
Comment 9 Chandrasekar Kannan 2009-04-29 18:59:56 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html

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