Re: BeanShell working in unsigned JWS env.
Mark Swanson <mark-e2GstmqqWGa5mcYau+xr2AC/[email protected]>
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Organization | Web Service Solutions, Inc. |
| Message-ID | <[email protected]> |
On April 30, 2004 7:00 pm, Shankar Unni wrote:
> Mark Swanson wrote:
>
> > In a way, you don't have to trust BeanShell because
> > you don't have to - it can only call public methods.
>
> That's wonderful, but your posted diffs enforce this unconditionally,
> rather than only in a "secure" environment. BeanShell is used for a lot
> more than "publicly safe scripting interfaces", so such a change is
> inappropriate.
I believe my changes are correct for any environment BeanShell is used in. If
you think differently, post a single example where you believe BeanShell
should be able to violate Java's protected and private access controls.
> BeanShell already has an interface called "setVisible(true)" which is
> supposed to enforce such visibility rules, and any change should be done in
> conjunction with that - if setVisible(false) has been called, *then* call
> only getMethods() etc., instead of getDeclaredMethods(). Then, in your JWS
> environment, you can call "setVisible(false)" and get secure reflective
> access.
I am a BeanShell newb, but I do not believe BeanShell has a "visible" control
attribute. I've grep'd all of the code for "-iH visible {}" and none of the
code around anything with "visible" in it has anything to do with reflection.
Also, I searched the documentation and bshcommands manual and found nothing
on 'visible'. Where did you find documentation on this?
Hmm, further searching the commands revealed setAccessibility. I'm guessing
that's what you meant. If yes, I would like to put to the list that
setAccessibility() should be removed because:
1. I think it is wrong in any case to violate something so (sacred?) as
protected/private.
2. In my experience it is never a good idea to bypass the public interface.
Can anyone give a single good reason why they think this is a good idea?
>
> Also, the XThis constructor change (package protected to public) is
> interesting: why did you do this? (I could use this change, too!).
XThis must have a public ctor or it will be invisible to interpreted bsh code.
One of the required *bsh files for starting up the JConsole uses it so it had
to be changed.
Cheers.
--
VoIP SIP:[email protected]
Free calendar client and server - works with Exchange/Outlook/Yahoo!
TV-Listing and Weather Schedules
http://www.ScheduleWorld.com/
http://www.ScheduleWorld.com/sw/ScheduleWorld.jnlp (JWS)
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click