Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-06 Thread Jules Gosnell


BTW,
I've refreshed and everything is now cool - thanks.
Jules

Jason Dillon wrote:
Just wondering, but why not use URLConnection.getURL().getFile()
instead of URLConnection.getPermssion() ?
--jason
_
View thread online: http://main.jboss.org/thread.jsp?forum=66thread=12217
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-06 Thread Jason Dillon

Yes, this seems very odd to me.  Still, why did this fail for you?  I was 
under the impression that URLConnection.getPermission() would return an 
AllPermission and not a FilePermission, which would have caused this hack not 
to be used.  If the _url field has been initialized to URLConnection.getURL() 
then this should have worked fine with the original.

Anyways, saw your note that it all works now.  Sorry if this caused you much 
trouble.

--jason


Quoting Jules Gosnell [EMAIL PROTECTED]:

 That would be a question for Greg - who left to go skiing this morning -
 tough life! :
 
 
 
 /*  */
 /**
  * Returns an File representing the given resource or NULL if this
  * is not possible.
  */
 public File getFile()
 throws IOException
 {
 // Try the permission hack
 if (checkConnection())
 {
 Permission perm = _connection.getPermission();
 if (perm instanceof java.io.FilePermission)
 return new File(perm.getName());
 }
 
 // Try the URL file arg
 try {return new File(_url.getFile());}
 catch(Exception e) {Code.ignore(e);}
 
 // Don't know the file
 return null;
 }
 
 
 
 Jules
 
 
 
 Jason Dillon wrote:
 
  Just wondering, but why not use URLConnection.getURL().getFile() instead of
 URLConnection.getPermssion() ?
 
  --jason
  _
  View thread online:
 http://main.jboss.org/thread.jsp?forum=66thread=12217
 
  ___
  Jboss-development mailing list
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/jboss-development
 




-
This mail sent through IMP: http://horde.org/imp/

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-05 Thread Scott M Stark

It is a simple method that returns the permission one would have to
add to a security policy to allow the connection to be made and used.
Since you support both input and output streams you need read and
write permissions:

new FilePermission(path, read,write);

The current implementation is suffering from delusions of persecution or
something so I fixed it. You may want to drop the OutputStream support
as this increases the permission requirements to write and you don't need
this for the modified timestamp check.


Scott Stark
Chief Technology Officer
JBoss Group, LLC

- Original Message - 
From: Jason Dillon [EMAIL PROTECTED]
To: Jules Gosnell [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, April 04, 2002 10:31 PM
Subject: Re: [JBoss-dev] (Jason) file protocol handler


 Oh... sorry.  Not sure what the thing todo here is.  We can either 
 generate a FilePermission which uses the underlying File.canRead(), 
 blah, blah, blah or we can simply omit this field and have the default 
 AllPermision be used.
 
 Probably easier in the short term todo the later... though I think that 
 might be wrong with respect to the security model... Scott?
 
 For now I will just comment out the method.
 
 --jason
 
 



___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-05 Thread Jason Dillon

Just wondering, but why not use URLConnection.getURL().getFile() instead of 
URLConnection.getPermssion() ?

--jason
_
View thread online: http://main.jboss.org/thread.jsp?forum=66thread=12217

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-05 Thread Jason Dillon

Thanks Scott... it was late and I don't think I was thinking so clearly 
after having my head in the ProxyCompiler for hours and hours.  We can 
probably use doOutput and doInput to indicate the perms?

--jason


Scott M Stark wrote:

It is a simple method that returns the permission one would have to
add to a security policy to allow the connection to be made and used.
Since you support both input and output streams you need read and
write permissions:

new FilePermission(path, read,write);

The current implementation is suffering from delusions of persecution or
something so I fixed it. You may want to drop the OutputStream support
as this increases the permission requirements to write and you don't need
this for the modified timestamp check.


Scott Stark
Chief Technology Officer
JBoss Group, LLC

- Original Message - 
From: Jason Dillon [EMAIL PROTECTED]
To: Jules Gosnell [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, April 04, 2002 10:31 PM
Subject: Re: [JBoss-dev] (Jason) file protocol handler


Oh... sorry.  Not sure what the thing todo here is.  We can either 
generate a FilePermission which uses the underlying File.canRead(), 
blah, blah, blah or we can simply omit this field and have the default 
AllPermision be used.

Probably easier in the short term todo the later... though I think that 
might be wrong with respect to the security model... Scott?

For now I will just comment out the method.

--jason





___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-05 Thread Jules Gosnell


That would be a question for Greg - who left to go skiing this morning
- tough life! :


 /* 
*/
 /**
 * Returns an File representing the given resource
or NULL if this
 * is not possible.
 */
 public File getFile()
 throws IOException
 {
 // Try the permission hack
 if (checkConnection())
 {

Permission perm = _connection.getPermission();

if (perm instanceof java.io.FilePermission)

return new File(perm.getName());
 }
 // Try the URL file arg
 try {return new File(_url.getFile());}
 catch(Exception e) {Code.ignore(e);}
 // Don't know the file
 return null;
 }


Jules


Jason Dillon wrote:
Just wondering, but why not use URLConnection.getURL().getFile()
instead of URLConnection.getPermssion() ?
--jason
_
View thread online: http://main.jboss.org/thread.jsp?forum=66thread=12217
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] (Jason) file protocol handler....

2002-04-04 Thread Jules Gosnell



Jason,

Thanks for this - it should fix reloading JSPs ...


However, Jetty deployment is now screwed !

In FileURLConnection.getPermission() where you say :

   public Permission getPermission() throws IOException {
  // should probably return a FilePermission here...
  // but I don't understand that crap, so just return the default
  return super.getPermission();
   }

You are absolutely right !!!

Jetty is using permission.getName() to get the file name - this is now
returning a string all permissions - whereas before it returned a
valid file name.

Jetty can no longer deploy anything.

I would look into this, but I have to go to work.

We could change Jetty, but this would just bite the next person to use
it.


What do you reckon ? Would it be easy to return a java.io.FilePermission
here - as expected.


Jules



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-04 Thread Jason Dillon

Oh... sorry.  Not sure what the thing todo here is.  We can either 
generate a FilePermission which uses the underlying File.canRead(), 
blah, blah, blah or we can simply omit this field and have the default 
AllPermision be used.

Probably easier in the short term todo the later... though I think that 
might be wrong with respect to the security model... Scott?

For now I will just comment out the method.

--jason


Jules Gosnell wrote:


Jason,

Thanks for this - it should fix reloading JSPs ...


However, Jetty deployment is now screwed !

In FileURLConnection.getPermission() where you say :

   public Permission getPermission() throws IOException {
  // should probably return a FilePermission here...
  // but I don't understand that crap, so just return the default
  return super.getPermission();
   }

You are absolutely right !!!

Jetty is using permission.getName() to get the file name - this is now
returning a string all permissions - whereas before it returned a
valid file name.

Jetty can no longer deploy anything.

I would look into this, but I have to go to work.

We could change Jetty, but this would just bite the next person to use
it.


What do you reckon ? Would it be easy to return a java.io.FilePermission
here - as expected.


Jules



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] (Jason) file protocol handler....

2002-04-04 Thread Jason Dillon

Oh... wait... I am smoking some bad crack... I totally misread this and 
then applied that misreading to a fix which does not help at all.  I 
have been in proxy-land for the last 5 hours and might be loosing my mind.

Let me quickly check what the default sun impl does and I try to 
duplicate that... though I am not sure what the exact permissions I 
should return or if I should use the File/Security manager to construct 
that information.

=(

--jason


Jules Gosnell wrote:


Jason,

Thanks for this - it should fix reloading JSPs ...


However, Jetty deployment is now screwed !

In FileURLConnection.getPermission() where you say :

   public Permission getPermission() throws IOException {
  // should probably return a FilePermission here...
  // but I don't understand that crap, so just return the default
  return super.getPermission();
   }

You are absolutely right !!!

Jetty is using permission.getName() to get the file name - this is now
returning a string all permissions - whereas before it returned a
valid file name.

Jetty can no longer deploy anything.

I would look into this, but I have to go to work.

We could change Jetty, but this would just bite the next person to use
it.


What do you reckon ? Would it be easy to return a java.io.FilePermission
here - as expected.


Jules



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development