• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Security Checking  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am using following code in my my jsp file:
AccessController.checkPermission(new FilePermission("\\h01\dir1", "write"));
first i try it by sharing "\\h01\dir1" as readonly--->it thrown access control exception [thats ok]
but when i try it by sharing "\\h01\dir1" as full control ---> it again thrown access control exception [that should not happen]
i have only used the above line, nothing else [no stuff related to security manger]. Can any one tell me how to remove this issue.
Thank you,
Jawed Nazar Ali
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) is the share visible from the application server? If not, the Security Manager cannot find the directory and thus the check will fail.
2) is the application server configured to allow web applications to have write access (or any access at all for that matter) to the local filesystem outside the webapp directory? If not the Security Manager will of course report an error as access is blocked by the appserver if not the filesystem.
 
Jawed Nazar Ali
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
The share is visible from any system on network, infact the sharing is given to "everyuser".
and Jsp file can locat the share folder and it returns true if share exixts other wise false, but when i try file permission check it went out of expectations.
I have try the java.io.File.canWrite() it returns true in all cases.
Thanks for the help
Jawed Nazar Ali
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!