473,748 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Applet Security Issue & .hotjava/properties file

Hello,
I've been reading up on security in Java Applets and whilst I understand
the concept, I can't successfully get my applet to read a file on my local
machine.
I discovered from http://java.sun.com/sfaq/#read:
-----
Sun's appletviewer allows applets to read files that are named on the access
control list for reading. The access control list for reading is null by
default, in the JDK. You can allow applets to read directories or files by
naming them in the acl.read property in your ~/.hotjava/properties file.

For example, to allow any files in the directory home/me to be read by
applets loaded into the appletviewer, add this line to your
~/.hotjava/properties file.
acl.read=/home/me
-----
(I am using Windows XP, my user name is Paul and I am trying to read
'video.properti es' in my "My Documents\Java\ " folder)

In my ~/.hotjava/properties file I have tried many combinations of:

acl.read=\My Documents\java\ video.propertie s
acl.read=C:\Doc uments and Settings\Paul\M y Documents\java\ video.propertie s

Even after saving these changes, java still complains when I try to run the
applet using appletviewer at the command line:
java.security.A ccessControlExc eption: access
denied(java.uti l.PropertyPermi ssion video.propertie s read)

I did notice however, that if I temporarily delete the .hotjava/properties
file, this made no difference and java did not complain that it couldn't be
found.

All this has confused me and left me a bit disgruntled!

How can I allow the applet to read the file?

Thank-you for your help,

Paul
Jul 17 '05 #1
8 11458
Depending on how you want to eventually use the applet, it may be a better
idea to sign it (for development purposes, you can use a test certificate
so you won't have to pay for it).

The second thing I notice is that you say you are using Windows XP, and
then talk about the ~/.hotjava/properties file. What is ~? In Unix, it
stands for the home directory. The next question on the same FAQ page
tells you how to do it in Windows - it is apparently NOT off your home
directory.

On Wed, 16 Jul 2003 20:02:23 +0000, Paul wrote:
Hello,
I've been reading up on security in Java Applets and whilst I understand
the concept, I can't successfully get my applet to read a file on my local
machine.
I discovered from http://java.sun.com/sfaq/#read:
-----
Sun's appletviewer allows applets to read files that are named on the access
control list for reading. The access control list for reading is null by
default, in the JDK. You can allow applets to read directories or files by
naming them in the acl.read property in your ~/.hotjava/properties file.

For example, to allow any files in the directory home/me to be read by
applets loaded into the appletviewer, add this line to your
~/.hotjava/properties file.
acl.read=/home/me
-----
(I am using Windows XP, my user name is Paul and I am trying to read
'video.properti es' in my "My Documents\Java\ " folder)

In my ~/.hotjava/properties file I have tried many combinations of:

acl.read=\My Documents\java\ video.propertie s
acl.read=C:\Doc uments and Settings\Paul\M y Documents\java\ video.propertie s

Even after saving these changes, java still complains when I try to run the
applet using appletviewer at the command line:
java.security.A ccessControlExc eption: access
denied(java.uti l.PropertyPermi ssion video.propertie s read)

I did notice however, that if I temporarily delete the .hotjava/properties
file, this made no difference and java did not complain that it couldn't be
found.

All this has confused me and left me a bit disgruntled!

How can I allow the applet to read the file?

Thank-you for your help,

Paul


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #2
I will look into using a test certificate whilst developing - thanks

The part of the FAQ you are referring to is:
If you install a web browser on your F:\ drive on your PC, and create a
top-level directory named .hotjava, then your properties file is found in
F:\.hotjava\pro perties.

This description isn't making a lot of sense to me, can anyone decipher it
for me?

Thank-you,

Paul

"Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
news:pa******** *************** *****@kkeane.co m...
Depending on how you want to eventually use the applet, it may be a better
idea to sign it (for development purposes, you can use a test certificate
so you won't have to pay for it).

The second thing I notice is that you say you are using Windows XP, and
then talk about the ~/.hotjava/properties file. What is ~? In Unix, it
stands for the home directory. The next question on the same FAQ page
tells you how to do it in Windows - it is apparently NOT off your home
directory.

On Wed, 16 Jul 2003 20:02:23 +0000, Paul wrote:
Hello,
I've been reading up on security in Java Applets and whilst I understand the concept, I can't successfully get my applet to read a file on my local machine.
I discovered from http://java.sun.com/sfaq/#read:
-----
Sun's appletviewer allows applets to read files that are named on the access control list for reading. The access control list for reading is null by
default, in the JDK. You can allow applets to read directories or files by naming them in the acl.read property in your ~/.hotjava/properties file.

For example, to allow any files in the directory home/me to be read by
applets loaded into the appletviewer, add this line to your
~/.hotjava/properties file.
acl.read=/home/me
-----
(I am using Windows XP, my user name is Paul and I am trying to read
'video.properti es' in my "My Documents\Java\ " folder)

In my ~/.hotjava/properties file I have tried many combinations of:

acl.read=\My Documents\java\ video.propertie s
acl.read=C:\Doc uments and Settings\Paul\M y Documents\java\ video.propertie s
Even after saving these changes, java still complains when I try to run the applet using appletviewer at the command line:
java.security.A ccessControlExc eption: access
denied(java.uti l.PropertyPermi ssion video.propertie s read)

I did notice however, that if I temporarily delete the ..hotjava/properties file, this made no difference and java did not complain that it couldn't be found.

All this has confused me and left me a bit disgruntled!

How can I allow the applet to read the file?

Thank-you for your help,

Paul


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #3
In all honesty, I had problems with it, too (that's why I didn't directly
refer to it), but it seemed to me that the .hotjava directory needs to be
off the root directory of the drive that holds your JVM binaries.

On Thu, 17 Jul 2003 02:42:03 +0000, Paul wrote:
I will look into using a test certificate whilst developing - thanks

The part of the FAQ you are referring to is: If you install a web
browser on your F:\ drive on your PC, and create a top-level directory
named .hotjava, then your properties file is found in
F:\.hotjava\pro perties.

This description isn't making a lot of sense to me, can anyone decipher
it for me?

Thank-you,

Paul

"Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
news:pa******** *************** *****@kkeane.co m...
Depending on how you want to eventually use the applet, it may be a
better idea to sign it (for development purposes, you can use a test
certificate so you won't have to pay for it).

The second thing I notice is that you say you are using Windows XP, and
then talk about the ~/.hotjava/properties file. What is ~? In Unix, it
stands for the home directory. The next question on the same FAQ page
tells you how to do it in Windows - it is apparently NOT off your home
directory.

On Wed, 16 Jul 2003 20:02:23 +0000, Paul wrote:
> Hello,
> I've been reading up on security in Java Applets and whilst I understand > the concept, I can't successfully get my applet to read a file on my local > machine.
> I discovered from http://java.sun.com/sfaq/#read:
> -----
> Sun's appletviewer allows applets to read files that are named on the access > control list for reading. The access control list for reading is null
> by default, in the JDK. You can allow applets to read directories or
> files by > naming them in the acl.read property in your ~/.hotjava/properties
> file.
>
> For example, to allow any files in the directory home/me to be read
> by applets loaded into the appletviewer, add this line to your
> ~/.hotjava/properties file.
> acl.read=/home/me
> -----
> (I am using Windows XP, my user name is Paul and I am trying to
> read
> 'video.properti es' in my "My Documents\Java\ " folder)
>
> In my ~/.hotjava/properties file I have tried many combinations of:
>
> acl.read=\My Documents\java\ video.propertie s acl.read=C:\Doc uments
> and Settings\Paul\M y Documents\java\ video.propertie s >
> Even after saving these changes, java still complains when I try to
> run the > applet using appletviewer at the command line:
> java.security.A ccessControlExc eption: access
> denied(java.uti l.PropertyPermi ssion video.propertie s read)
>
> I did notice however, that if I temporarily delete the .hotjava/properties > file, this made no difference and java did not complain that it
> couldn't be > found.
>
> All this has confused me and left me a bit disgruntled!
>
> How can I allow the applet to read the file?
>
> Thank-you for your help,
>
> Paul


--
Keep American Families united! Support H.R. 539 and H.R. 832 For more
information, see http://www.kkeane.com/lobbyspousal-faq.shtml


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #4
I've tried everything, it still doesn't work - this is driving me insane!

All I want to do is allow my applet to read a file, this is ridiculous.

What now should I do?

I also tried signing my applet but the sun tutorial on this involves buying
a certificate from verisign for an unbelievable amount of money!

ARGH.

Thanks,

Paul

"Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
news:pa******** *************** *****@kkeane.co m...
In all honesty, I had problems with it, too (that's why I didn't directly
refer to it), but it seemed to me that the .hotjava directory needs to be
off the root directory of the drive that holds your JVM binaries.

On Thu, 17 Jul 2003 02:42:03 +0000, Paul wrote:
I will look into using a test certificate whilst developing - thanks

The part of the FAQ you are referring to is: If you install a web
browser on your F:\ drive on your PC, and create a top-level directory
named .hotjava, then your properties file is found in
F:\.hotjava\pro perties.

This description isn't making a lot of sense to me, can anyone decipher
it for me?

Thank-you,

Paul

"Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
news:pa******** *************** *****@kkeane.co m...
Depending on how you want to eventually use the applet, it may be a
better idea to sign it (for development purposes, you can use a test
certificate so you won't have to pay for it).

The second thing I notice is that you say you are using Windows XP, and
then talk about the ~/.hotjava/properties file. What is ~? In Unix, it
stands for the home directory. The next question on the same FAQ page
tells you how to do it in Windows - it is apparently NOT off your home
directory.

On Wed, 16 Jul 2003 20:02:23 +0000, Paul wrote:

> Hello,
> I've been reading up on security in Java Applets and whilst I

understand
> the concept, I can't successfully get my applet to read a file on my

local
> machine.
> I discovered from http://java.sun.com/sfaq/#read:
> -----
> Sun's appletviewer allows applets to read files that are named on the

access
> control list for reading. The access control list for reading is null
> by default, in the JDK. You can allow applets to read directories or
> files

by
> naming them in the acl.read property in your ~/.hotjava/properties
> file.
>
> For example, to allow any files in the directory home/me to be read
> by applets loaded into the appletviewer, add this line to your
> ~/.hotjava/properties file.
> acl.read=/home/me
> -----
> (I am using Windows XP, my user name is Paul and I am trying to
> read
> 'video.properti es' in my "My Documents\Java\ " folder)
>
> In my ~/.hotjava/properties file I have tried many combinations of:
>
> acl.read=\My Documents\java\ video.propertie s acl.read=C:\Doc uments
> and Settings\Paul\M y

Documents\java\ video.propertie s
>
> Even after saving these changes, java still complains when I try to
> run

the
> applet using appletviewer at the command line:
> java.security.A ccessControlExc eption: access
> denied(java.uti l.PropertyPermi ssion video.propertie s read)
>
> I did notice however, that if I temporarily delete the

.hotjava/properties
> file, this made no difference and java did not complain that it
> couldn't

be
> found.
>
> All this has confused me and left me a bit disgruntled!
>
> How can I allow the applet to read the file?
>
> Thank-you for your help,
>
> Paul

--
Keep American Families united! Support H.R. 539 and H.R. 832 For more
information, see http://www.kkeane.com/lobbyspousal-faq.shtml


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #5
For the signing, check out the -selfcert option. See
http://forum.java.sun.com/thread.jsp...essage=1298211
and http://www.iit.edu/~kulkabh1/signing_jar_file.txt

Note that, for security reasons, you won't be able to actually deploy the
applet this way, it is strictly only for testing purposes.

As for the hotjava properties file: I think the answer is at
http://www.ocs.mq.edu.au/UserDoc/hot...e/viewers.html

I haven't tried that, though.

On Fri, 18 Jul 2003 01:10:11 +0000, Paul wrote:
I've tried everything, it still doesn't work - this is driving me
insane!

All I want to do is allow my applet to read a file, this is ridiculous.

What now should I do?

I also tried signing my applet but the sun tutorial on this involves
buying a certificate from verisign for an unbelievable amount of money!

ARGH.

Thanks,

Paul

"Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
news:pa******** *************** *****@kkeane.co m...
In all honesty, I had problems with it, too (that's why I didn't
directly refer to it), but it seemed to me that the .hotjava directory
needs to be off the root directory of the drive that holds your JVM
binaries.

On Thu, 17 Jul 2003 02:42:03 +0000, Paul wrote:
> I will look into using a test certificate whilst developing - thanks
>
> The part of the FAQ you are referring to is: If you install a web
> browser on your F:\ drive on your PC, and create a top-level
> directory named .hotjava, then your properties file is found in
> F:\.hotjava\pro perties.
>
> This description isn't making a lot of sense to me, can anyone
> decipher it for me?
>
> Thank-you,
>
> Paul
>
> "Ingo Pakleppa" <in************ *@kkeane.com> wrote in message
> news:pa******** *************** *****@kkeane.co m...
>> Depending on how you want to eventually use the applet, it may be a
>> better idea to sign it (for development purposes, you can use a test
>> certificate so you won't have to pay for it).
>>
>> The second thing I notice is that you say you are using Windows XP,
>> and then talk about the ~/.hotjava/properties file. What is ~? In
>> Unix, it stands for the home directory. The next question on the
>> same FAQ page tells you how to do it in Windows - it is apparently
>> NOT off your home directory.
>>
>> On Wed, 16 Jul 2003 20:02:23 +0000, Paul wrote:
>>
>> > Hello,
>> > I've been reading up on security in Java Applets and whilst I
> understand
>> > the concept, I can't successfully get my applet to read a file on
>> > my
> local
>> > machine.
>> > I discovered from http://java.sun.com/sfaq/#read:
>> > -----
>> > Sun's appletviewer allows applets to read files that are named on
>> > the
> access
>> > control list for reading. The access control list for reading is
>> > null by default, in the JDK. You can allow applets to read
>> > directories or files
> by
>> > naming them in the acl.read property in your ~/.hotjava/properties
>> > file.
>> >
>> > For example, to allow any files in the directory home/me to be
>> > read by applets loaded into the appletviewer, add this line to
>> > your ~/.hotjava/properties file.
>> > acl.read=/home/me
>> > -----
>> > (I am using Windows XP, my user name is Paul and I am trying
>> > to read
>> > 'video.properti es' in my "My Documents\Java\ " folder)
>> >
>> > In my ~/.hotjava/properties file I have tried many combinations
>> > of:
>> >
>> > acl.read=\My Documents\java\ video.propertie s acl.read=C:\Doc uments
>> > and Settings\Paul\M y
> Documents\java\ video.propertie s
>> >
>> > Even after saving these changes, java still complains when I try
>> > to run
> the
>> > applet using appletviewer at the command line:
>> > java.security.A ccessControlExc eption: access
>> > denied(java.uti l.PropertyPermi ssion video.propertie s read)
>> >
>> > I did notice however, that if I temporarily delete the
> .hotjava/properties
>> > file, this made no difference and java did not complain that it
>> > couldn't
> be
>> > found.
>> >
>> > All this has confused me and left me a bit disgruntled!
>> >
>> > How can I allow the applet to read the file?
>> >
>> > Thank-you for your help,
>> >
>> > Paul
>>
>> --
>> Keep American Families united! Support H.R. 539 and H.R. 832 For
>> more information, see http://www.kkeane.com/lobbyspousal-faq.shtml
>>
>>

--
Keep American Families united! Support H.R. 539 and H.R. 832 For more
information, see http://www.kkeane.com/lobbyspousal-faq.shtml


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #6

"Paul" <pl****@dontema ilmedirectly.co m> wrote in message
news:TN******** ***********@twi ster.austin.rr. com...
I've tried everything, it still doesn't work - this is driving me insane!

All I want to do is allow my applet to read a file, this is ridiculous.

What now should I do?

I also tried signing my applet but the sun tutorial on this involves buying a certificate from verisign for an unbelievable amount of money!

ARGH.


Welcome to the realization that applets are not nearly as useful as anyone
imagined they would be. This is why Sun repositioned Java from a browser
technology to a server technology about 5 years ago.

Jul 17 '05 #7
"Paul" <pl****@dontema ilmedirectly.co m> wrote in message news:<TN******* ************@tw ister.austin.rr .com>...
I've tried everything, it still doesn't work - this is driving me insane!

All I want to do is allow my applet to read a file, this is ridiculous.

What now should I do?


Here is a solution to all your problems:

http://groups.google.com/groups?q=in...inet.fi&rnum=1

was posted a long time ago and works like a charm. We should thank the
poster.
Jul 17 '05 #8
On Fri, 18 Jul 2003 01:10:11 GMT, "Paul" <pl****@dontema ilmedirectly.co m>
two-finger typed:
I've tried everything, it still doesn't work - this is driving me insane!

All I want to do is allow my applet to read a file, this is ridiculous.

What now should I do?

I also tried signing my applet but the sun tutorial on this involves buying
a certificate from verisign for an unbelievable amount of money!

ARGH.
Thanks,
Paul


Indeed.
The idea behind Applets is that they are secure. Therefore an Applet cannot
access files on the machine that the browser runs, without the user giving
permission to your Applet to read (one) local file(s).
For that you need a certificate, so that the user can identify you without
a doubt, so he is able to trust you to do the right thing (i.e. not scan
his computer for a porn collection, or something).

No way around it.

Cheers.
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3218
by: doh..... | last post by:
I'm working on a windows 98 machine with the latest sun sdk. In summary there are two problems I get with appletviewer 1. The applet tries to open a socket to the wrong port 2. The proxy is ignored. Using appletviewer, I am loading an applet from my local hard disk and trying to connect to an external IP.
4
5428
by: Lorenzo | last post by:
hi you all, first of all apologies for having cross-posted this message but really i did not know where to post it. please let me know what ng you consider the most suitable for the described issue. i wrote a program made by a client and a server that communicate via RMI premise 1) everything has been developed and executed on WinXP Professional and the following jre
1
5100
by: roda | last post by:
Hi, I have created an applet code. The code is normally working fin without IIS. I have IIS 5.0 installed on my Windows 2000 Server. My web site hom directory is "C:\Inetpub\wwwroot". I already coppied the files to th correct folder. In the address box of Internet Explorer, I type "http://localhost/myfile.html". myfile.html is to run my applet. Bu when I go to the page I got the error message saying that "Connectio refused: connect".
5
13647
by: Rowland | last post by:
Hi, I know this question has prob. been asked a million times, but I couldn't find it in the FAQ, so here goes : I'm trying to write a Java applet to call a dll that resides on the web server (running IIS 6). I've written a little test applet that should call a helloWorld function in the dll, but when I use System.loadLibrary, it gives me this security warning :
2
5427
by: Nick Wedd | last post by:
Here is a test page http://www.maproom.org/maps/historical/droysens/1886/testj.html which uses a Java applet to take a .DjVu format file and display the image which it encodes. The page is simple html, you can view its source. When I started using this applet, it worked on my system with Mozila/Netscape, Mozilla/Firebird, Mozilla/Firefox, and Internet Explorer, all running on my WindowsXP system. I was warned that the applet worked...
0
5663
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ChatDispatch.java
2
1744
by: ace84 | last post by:
I created an applet that i want to post on my site. I wrote it and compiled it and it works fine on my computer. But when I upload it to my server, I keep getting this error and I am not sure what I need to do to fix it. Can anyone help me?!?! Java Plug-in 1.6.0_10-ea Using JRE version 1.6.0_10-ea Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\Me java.security.AccessControlException: access denied...
14
2997
jhardman
by: jhardman | last post by:
I am having a hard time opening a text file from an applet. I remembered after an attempt or two that there were obvious security issues here, so I switched the code to pull a text file off the internet, and there is obviously some naming or reference issue that I can't get my head around. Here is my code: import java.awt.*; import java.awt.Font; import java.awt.Graphics; import java.awt.FontMetrics; import java.io.*; import java.net.*;...
7
2575
by: tempest | last post by:
Hi all. This is a rather long posting but I have some questions concerning the usage of character entities in XML documents and PCI security compliance. The company I work for is using a third party ecommerce service for hosting its online store. A few months ago this third party commerce site began using PGP file encryption on XML files (e.g. web orders) transferred to us as part of the ongoing PCI security compliance.
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.