From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15624 invoked by alias); 7 Apr 2003 22:59:23 -0000 Mailing-List: contact mauve-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sources.redhat.com Received: (qmail 15617 invoked from network); 7 Apr 2003 22:59:23 -0000 Received: from unknown (HELO delenn.fl.net.au) (202.181.0.28) by sources.redhat.com with SMTP; 7 Apr 2003 22:59:23 -0000 Received: from a3-p59.syd.fl.net.au (a3-p59.syd.fl.net.au [202.181.1.123]) by delenn.fl.net.au (Postfix) with ESMTP id 70B3418063D; Tue, 8 Apr 2003 08:58:35 +1000 (EST) From: "Raif S. Naffah" Reply-To: raif@fl.net.au To: Stephen Crawley , Brian Jones Subject: Re: classpath ./ChangeLog ./THANKYOU ./configure.in... Date: Mon, 07 Apr 2003 22:59:00 -0000 User-Agent: KMail/1.5.1 Cc: Stephen Crawley , classpath@gnu.org, Mauve References: <200304071608.h37G8siE021877@piglet.dstc.edu.au> In-Reply-To: <200304071608.h37G8siE021877@piglet.dstc.edu.au> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200304080852.47734.raif@fl.net.au> X-SW-Source: 2003-q2/txt/msg00008.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 hello Steve, On Tue, 8 Apr 2003 02:09 am, Stephen Crawley wrote: > > Stephen Crawley writes: > > > I can confirm that there really is a problem running some of the > > > Mauve security testlets under the latest Kissme, Classpath and > > > Mauve. It appears to be a Kissme class loading problem, rather > > > than the fault of the Classpath security implementation. I'm > > > trying to get to the bottom of it ... > > The "bottom of it" is that the problem was not in Kissme or Classpath > at all! good catch! mea culpa. > The problem was that the failing test cases' constructors were not > declared public. On Kissme, this (correctly IMO) caused the call to > 'Class.newInstance' to throw an InstantiationException... shouldnt this be an IllegalAccessException? as the docs states this=20 exception is thrown "...if the class or its nullary constructor is not=20 accessible." also, is it legal for a JVM to try altering the accessibility of a=20 non-public, but nullary ctor, before bailing out, and then and only=20 then throw an InstantiationException? the accessibility of a ctor can=20 be altered as follows: /** Instantiate a class with a 0-arguments ctor. */ private static Object makeNewInstance0(String className) { Class c =3D null; Constructor ctor =3D null; Object result =3D null; try { c =3D Class.forName(className); ctor =3D c.getConstructor(null); result =3D c.newInstance(); } catch (IllegalAccessException x) { System.out.println(" * no --IllegalAccessException;" +"will attempt altering Accessibility..."); boolean accessible =3D ctor.isAccessible(); if (accessible) System.out.println(" * no --unable to, " +"although it's accessible..."); else { try { ctor.setAccessible(true); result =3D ctor.newInstance(null); } catch (SecurityException y) { System.out.println(" * no --a SecurityManager " +"is forbidding us to..."); } catch (Exception y) { // should not happen y.printStackTrace(System.err); } } } catch (Exception x) { x.printStackTrace(System.err); } return result; } cheers; rsn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) Comment: Que du magnifique iD8DBQE+kgE++e1AKnsTRiERA6JpAKDHogUsoAjDsHjq7buP+ahhO0warQCg349t 3sxj20HEsX47Y/UPdfrJsng=3D =3DKNJD -----END PGP SIGNATURE-----