Bug 234948 - Console hangs when adding a custom entry and schema items are in certain order
Summary: Console hangs when adding a custom entry and schema items are in certain order
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: UI - Dir Browser
Version: 1.0.4
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
: 229693 435646 462970 (view as bug list)
Depends On:
Blocks: 152373 249650 FDS1.2.0
TreeView+ depends on / blocked
 
Reported: 2007-04-03 00:56 UTC by Ulf Weltman
Modified: 2015-01-04 23:25 UTC (History)
6 users (show)

Fixed In Version: 8.1
Clone Of:
Environment:
Last Closed: 2009-04-29 22:59:56 UTC
Embargoed:


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

Description Ulf Weltman 2007-04-03 00:56:01 UTC
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 16:44:25 UTC
*** Bug 435646 has been marked as a duplicate of this bug. ***

Comment 3 Rich Megginson 2008-12-05 17:45:57 UTC
*** Bug 462970 has been marked as a duplicate of this bug. ***

Comment 4 Rich Megginson 2008-12-05 17:48:56 UTC
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 18:16:53 UTC
*** Bug 229693 has been marked as a duplicate of this bug. ***

Comment 6 Rich Megginson 2008-12-05 22:55:51 UTC
Created attachment 325922 [details]
diffs

Comment 7 Rich Megginson 2008-12-05 23:47:11 UTC
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 Severance 2009-03-19 14:21:59 UTC
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 22:59:56 UTC
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.