• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Policy File

 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to hear some of you about the policy file configuration. Without complicating my testing on RMI, I currently grant all permission to accessing to remote resources.
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering the same thing......anyone?
Joe
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taken explicitly from The Java Tutorial:
Here is a general policy file that allows downloaded code, from any code base, to do two things:
Connect to or accept connections on unprivileged ports (ports greater than 1024) on any host
Connect to port 80 (the port for HTTP)
Here is the code for the general policy file:
grant {
permission java.net.SocketPermission "*:1024-65535",
"connect,accept";
permission java.net.SocketPermission "*:80", "connect";
};
If you make your code available for downloading via HTTP URLs, you should use the preceding policy file when you run this example. However, if you use file URLs instead, you can use the following policy file. Note that in Windows-style file names, the backslash character needs to be represented by two backslash characters in the policy file.
grant {
permission java.net.SocketPermission "*:1024-65535",
"connect,accept";
permission java.io.FilePermission
"c:\\home\\ann\\public_html\\classes\\-", "read";
permission java.io.FilePermission
"c:\\home\\jones\\public_html\\classes\\-", "read";
};
 
Cleland Early
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the instructions, you can't require the examiner to edit any files. Under those restrictions, I'm not sure how you could use the second example you provide. Whatever you send with your submission needs to work no matter which platform the examiner uses or where the examiner installs the files.
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They will be using unix i think.
Joe
 
Cleland Early
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Solaris, more than likely, but I don't think you can make any assumptions about the platform in your code or in any related files.


This whole policy file deal strikes me as extremely counter-intuitive. Let me get this: you create a policy file on the client end to grant access to resources stored on the server.
 
aleks nikolic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You use the following symbol : ${/}
to represent system independent file separators .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic