Re: How to set Permissions on New File
From: Anthony Borla (ajborla_at_bigpond.com)
Date: 10/28/03
- Next message: Anthony Borla: "Re: How to set Permissions on New File"
- Previous message: Phil...: "Re: char to string ????"
- In reply to: Phil...: "Re: How to set Permissions on New File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 28 Oct 2003 22:21:56 GMT
Phil,
"Phil..." <rynes@ieee.org> wrote in message
news:rAxnb.51456$HS4.234306@attbi_s01...
> I thought JNI would not give the programm
> more permissions than that of the user that
> ran the program -- else anyone could rm -rf *
>
JNI simply allows you to tap into functionality not offered in Java. When
using JNI you bypass the JVM, and surrender control of you application to
'foreign' code, code which can pretty well do anything it wants *within
operating system constraints* !
The JVM and application execute within the context of a user account [or
similar], and are bound by the security and other restrictions imposed on
that account. So, to use your example, a JNI routine may possibly allow you
to perform the equivalent of a 'rm -rf', but unless the user account [or
similar] has the requisite permission(s), the attempt will fail with the
operating system 'trapping' the attempt, and somehow handling / logging it.
A JNI routine will, to be considered robust, handle such possibilities
predictably and gracefully allowing the application to handle the situation
as required.
It may help to think of an [Java] application's [not applet] execution
environment as a layered entity, somewhat like an onion. The application
executes under the supervision and control of the JVM but may, using
facilities like JNI, temporarily bypass that layer when necessary. When
doing so it will encounter the operating system layer, typically the
security a sub-system. In either case the application is bound by the
constraints imposed by that layer, constraints which would normally have
been imposed *before* application execution, and [probably] cannot be
altered without a restart.
I hope this helps.
Anthony Borla
- Next message: Anthony Borla: "Re: How to set Permissions on New File"
- Previous message: Phil...: "Re: char to string ????"
- In reply to: Phil...: "Re: How to set Permissions on New File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]