Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11619 > unrolled thread

Applet security override

Started bysimplicity <stella_pigeon@live.ca>
First post2012-01-27 08:53 -0800
Last post2012-01-30 19:42 -0500
Articles 3 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Applet security override simplicity <stella_pigeon@live.ca> - 2012-01-27 08:53 -0800
    Re: Applet security override Roedy Green <see_website@mindprod.com.invalid> - 2012-01-29 19:55 -0800
    Re: Applet security override Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 19:42 -0500

#11619 — Applet security override

Fromsimplicity <stella_pigeon@live.ca>
Date2012-01-27 08:53 -0800
SubjectApplet security override
Message-ID<b259627f-046c-4052-82a8-080e873028ab@ih8g2000pbc.googlegroups.com>
Hi

I am getting the exception caused by
java.security.AccessControlException: access denied
(java.lang.RuntimePermission loadLibrary.<dll-name>).

I know that this is to be expected as applets generally have no access
to resources outside of the browser. After digging for the possible
solutions I found (http://java.sun.com/developer/onlineTraining/
Programming/JDCBook/appA.html) that this may actually be possible by
granting such access in the policy file.

I edited java.policy.applet file - the one which is generated and sits
in the same location as CLASS files. The modified policy file looks as
follows:

grant {
  permission java.security.AllPermission;    // this was generated
  permission java.lang.RuntimePermission "loadLibrary.*";   // this is
added by me
}

Unfortunately, I still have the same exception. Any idea what I am
missing? Wrong policy file perhaps?

Is there another way of granting applet with access to local DLLs? I
think signed applet was another hint but could someone guide me how to
do this?

[toc] | [next] | [standalone]


#11632

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-01-29 19:55 -0800
Message-ID<hd4ci7hetdlddg3c7unj37lvg9bt006fpu@4ax.com>
In reply to#11619
On Fri, 27 Jan 2012 08:53:39 -0800 (PST), simplicity
<stella_pigeon@live.ca> wrote, quoted or indirectly quoted someone who
said :

>I edited java.policy.applet file - the one which is generated and sits
>in the same location as CLASS files. The modified policy file looks as
>follows:

There are several problems with that technique.

1. Your computer may have a dozen policy files.  You have to make sure
you edit the correct one.

2. You can't very well ask others to fiddle their policy files.  Most
users don't even know what a file or text editor is.

3. Others in corporate environments are not permitted to modify their
policy files. That is the sole responsibility of the IT department.

see http://mindprod.com/jgloss/policyfile.html
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
One of the most useful comments you can put in a program is 
"If you change this, remember to change ?XXX? too".
 

[toc] | [prev] | [next] | [standalone]


#11644

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 19:42 -0500
Message-ID<4f273902$0$291$14726298@news.sunsite.dk>
In reply to#11619
On 1/27/2012 11:53 AM, simplicity wrote:
> I am getting the exception caused by
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission loadLibrary.<dll-name>).
>
> I know that this is to be expected as applets generally have no access
> to resources outside of the browser. After digging for the possible
> solutions I found (http://java.sun.com/developer/onlineTraining/
> Programming/JDCBook/appA.html) that this may actually be possible by
> granting such access in the policy file.
>
> I edited java.policy.applet file - the one which is generated and sits
> in the same location as CLASS files. The modified policy file looks as
> follows:
>
> grant {
>    permission java.security.AllPermission;    // this was generated
>    permission java.lang.RuntimePermission "loadLibrary.*";   // this is
> added by me
> }
>
> Unfortunately, I still have the same exception. Any idea what I am
> missing? Wrong policy file perhaps?

It seems very unlikely that the browser plugin will look for
the policy in the same dir as your class file.

> Is there another way of granting applet with access to local DLLs? I
> think signed applet was another hint but could someone guide me how to
> do this?

I think you will be better off switching to Java Web Start.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web