This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 18227 - Access permission error when customizing a bean
Summary: Access permission error when customizing a bean
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-30 14:08 UTC by Jesse Glick
Modified: 2008-12-22 18:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log file (12.80 KB, text/plain)
2001-11-30 14:08 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-11-30 14:08:12 UTC
Observed in release330 nov 30, i.e. more or less RC1.

Select ColorPreview in the sampledir and customize bean. When the dialog
appears, three properties "red", "green", "blue" are shown in the Property
Sheet. Try to set "blue" to "33". A security exception is shown. I'm not sure if
this applies to *all* customizations of user beans, but I don't see anything
unusual about this bean.

My analysis:

(1) The immediate cause is the fix for issue 11679.

(2) More generally, BeanNode.PropL.propertyChange can be called from
unprivileged user code. Since it in turn fires changes to IDE code, it should
probably use AccessController.invokePrivileged.

(3) PS.R.getValue should probably *not* use invokePrivileged unless someone can
show that this would not be a security hole.
Comment 1 Jesse Glick 2001-11-30 14:08:45 UTC
Created attachment 3641 [details]
Log file
Comment 2 _ pkuzel 2001-11-30 15:11:59 UTC
What about try {
  // invoking the method without setting accessible
} catch (IllegalAccessException ex) {
  AccessController.invokePrivileged( {...
    method.setAccessible(true);
    method.invoke(..);
    ..
  }
}

Again it is just a hack of JDK bug.
Comment 3 David Strupl 2001-11-30 17:02:50 UTC
Will try Jesse's suggestion and if it works well will integrate on Monday.
Comment 4 David Strupl 2001-12-03 15:26:27 UTC
PropertySupport 1.13.18.1 (release33 branch). Please note that I have
used suggestions from both of you. First I added setAccessible only if
regular invocation fails. Second I am not calling the invoke method
from under doPrivileged and thus I am not creating any security hole.
Could you guys make a code review for me to get this fix into
release330? Thanks a lot for a prompt reply.
Comment 5 David Strupl 2001-12-03 15:48:24 UTC
Making 3.3.0 candidate. Please note that there can be other security
exceptions when using customize bean - for example when the bean is a
java.awt.Window. But those should probably be filed separately.
Comment 6 Jan Zajicek 2001-12-04 10:55:41 UTC
Verified in build#200112040330 (release33).
Comment 7 David Strupl 2001-12-04 14:20:20 UTC
Fixed in release330. Target milestone 3.3.
Comment 8 Quality Engineering 2003-07-01 16:25:10 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.