Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > FileIOException, Need help please

Reply
Thread Tools

FileIOException, Need help please

 
 
Moe
Guest
Posts: n/a
 
      05-12-2005
I have a winForm control that contains an openFileDialog.
I am using this control in a webForm by enbedding it using an <object> tag.
I need to access some information about the file on the client.
I strongly named my control assembly .
I created a machine level permission set, and assigned FileDialog, FileIO
and User interface permission.
I created a code group under all_Code, associated my assembly's strong name
to that group and assigned the permission set i created previously.

I also added the following attributes to my assembly:
[assembly:AllowPartiallyTrustedCallers]
[assembly: FileDialogPermission(SecurityAction.RequestMinimum , Unrestricted
= true)]
[assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted =
true)]


I am having a file IO Exception while trying to retreive the FileName
property of the openFileDialog.

Any help will be very appreciate it.

Thanks!
 
Reply With Quote
 
 
 
 
Nicole Calinoiu
Guest
Posts: n/a
 
      05-13-2005
"Moe" <> wrote in message
news:3E8B6871-4DF4-4ABE-8E0F-...
>I have a winForm control that contains an openFileDialog.
> I am using this control in a webForm by enbedding it using an <object>
> tag.
> I need to access some information about the file on the client.
> I strongly named my control assembly .
> I created a machine level permission set, and assigned FileDialog, FileIO
> and User interface permission.
> I created a code group under all_Code, associated my assembly's strong
> name
> to that group and assigned the permission set i created previously.


Not a great idea. It would be better to add the new group under the
appropriate zone group (usually intranet) in order to minimize the potential
impact of a compromise of your signing key.


> I also added the following attributes to my assembly:
> [assembly:AllowPartiallyTrustedCallers]
> [assembly: FileDialogPermission(SecurityAction.RequestMinimum ,
> Unrestricted
> = true)]
> [assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
> true)]
> [assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted =
> true)]
>
>
> I am having a file IO Exception while trying to retreive the FileName
> property of the openFileDialog.


It really shouldn't be getting that far. Given that you've specified a
RequestMinimum for
unrestricted FileIOPermission, your assembly should not run at all if this
permission is denied. Are you sure that you're attempting to run the latest
version of the assembly?

That said, you'll still have a problem once you resolve the above issue
since the IE host won't resolve your assembly's strong name until after the
permissions grant is complete. For workarounds, see
http://blogs.msdn.com/shawnfa/archiv.../26/57026.aspx.



>
> Any help will be very appreciate it.
>
> Thanks!




 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      05-14-2005
Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,

i would also suggest to not use the filename that is returned from the fileopen
dialog but the FileStream..does not require that much permissions...

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> "Moe" <> wrote in message
> news:3E8B6871-4DF4-4ABE-8E0F-...
>
>> I have a winForm control that contains an openFileDialog.
>> I am using this control in a webForm by enbedding it using an
>> <object>
>> tag.
>> I need to access some information about the file on the client.
>> I strongly named my control assembly .
>> I created a machine level permission set, and assigned FileDialog,
>> FileIO
>> and User interface permission.
>> I created a code group under all_Code, associated my assembly's
>> strong
>> name
>> to that group and assigned the permission set i created previously.

> Not a great idea. It would be better to add the new group under the
> appropriate zone group (usually intranet) in order to minimize the
> potential impact of a compromise of your signing key.
>
>> I also added the following attributes to my assembly:
>> [assembly:AllowPartiallyTrustedCallers]
>> [assembly: FileDialogPermission(SecurityAction.RequestMinimum ,
>> Unrestricted
>> = true)]
>> [assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
>> true)]
>> [assembly: FileIOPermission(SecurityAction.RequestMinimum,
>> Unrestricted =
>> true)]
>> I am having a file IO Exception while trying to retreive the FileName
>> property of the openFileDialog.
>>

> It really shouldn't be getting that far. Given that you've specified
> a
> RequestMinimum for
> unrestricted FileIOPermission, your assembly should not run at all if
> this
> permission is denied. Are you sure that you're attempting to run the
> latest
> version of the assembly?
> That said, you'll still have a problem once you resolve the above
> issue since the IE host won't resolve your assembly's strong name
> until after the permissions grant is complete. For workarounds, see
> http://blogs.msdn.com/shawnfa/archiv.../26/57026.aspx.
>
>> Any help will be very appreciate it.
>>
>> Thanks!
>>




 
Reply With Quote
 
Nicole Calinoiu
Guest
Posts: n/a
 
      05-14-2005
That would only work if the goal is to open the file for reading, which
doesn't sound like the case here ("access some information about the file on
the client" from OP). My guess is that it's probably more likely that
FileDialogPermission can be dispensed with in this particular case rather
than FileIOPermission. However, the assembly may also contain other
functionality, so permissions that appear superfluous to us may actually be
required by other code...


"Dominick Baier [DevelopMentor]" <>
wrote in message news:.. .
> Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
>
> i would also suggest to not use the filename that is returned from the
> fileopen dialog but the FileStream..does not require that much
> permissions...
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> "Moe" <> wrote in message
>> news:3E8B6871-4DF4-4ABE-8E0F-...
>>
>>> I have a winForm control that contains an openFileDialog.
>>> I am using this control in a webForm by enbedding it using an
>>> <object>
>>> tag.
>>> I need to access some information about the file on the client.
>>> I strongly named my control assembly .
>>> I created a machine level permission set, and assigned FileDialog,
>>> FileIO
>>> and User interface permission.
>>> I created a code group under all_Code, associated my assembly's
>>> strong
>>> name
>>> to that group and assigned the permission set i created previously.

>> Not a great idea. It would be better to add the new group under the
>> appropriate zone group (usually intranet) in order to minimize the
>> potential impact of a compromise of your signing key.
>>
>>> I also added the following attributes to my assembly:
>>> [assembly:AllowPartiallyTrustedCallers]
>>> [assembly: FileDialogPermission(SecurityAction.RequestMinimum ,
>>> Unrestricted
>>> = true)]
>>> [assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
>>> true)]
>>> [assembly: FileIOPermission(SecurityAction.RequestMinimum,
>>> Unrestricted =
>>> true)]
>>> I am having a file IO Exception while trying to retreive the FileName
>>> property of the openFileDialog.
>>>

>> It really shouldn't be getting that far. Given that you've specified
>> a
>> RequestMinimum for
>> unrestricted FileIOPermission, your assembly should not run at all if
>> this
>> permission is denied. Are you sure that you're attempting to run the
>> latest
>> version of the assembly?
>> That said, you'll still have a problem once you resolve the above
>> issue since the IE host won't resolve your assembly's strong name
>> until after the permissions grant is complete. For workarounds, see
>> http://blogs.msdn.com/shawnfa/archiv.../26/57026.aspx.
>>
>>> Any help will be very appreciate it.
>>>
>>> Thanks!
>>>

>
>
>



 
Reply With Quote
 
Moe
Guest
Posts: n/a
 
      05-14-2005
Thank you guys for your help.
I apreciate it

"Nicole Calinoiu" wrote:

> That would only work if the goal is to open the file for reading, which
> doesn't sound like the case here ("access some information about the file on
> the client" from OP). My guess is that it's probably more likely that
> FileDialogPermission can be dispensed with in this particular case rather
> than FileIOPermission. However, the assembly may also contain other
> functionality, so permissions that appear superfluous to us may actually be
> required by other code...
>
>
> "Dominick Baier [DevelopMentor]" <>
> wrote in message news:.. .
> > Hello Nicole Calinoiu" calinoiu REMOVETHIS AT gmail DOT com,
> >
> > i would also suggest to not use the filename that is returned from the
> > fileopen dialog but the FileStream..does not require that much
> > permissions...
> >
> > ---------------------------------------
> > Dominick Baier - DevelopMentor
> > http://www.leastprivilege.com
> >
> >> "Moe" <> wrote in message
> >> news:3E8B6871-4DF4-4ABE-8E0F-...
> >>
> >>> I have a winForm control that contains an openFileDialog.
> >>> I am using this control in a webForm by enbedding it using an
> >>> <object>
> >>> tag.
> >>> I need to access some information about the file on the client.
> >>> I strongly named my control assembly .
> >>> I created a machine level permission set, and assigned FileDialog,
> >>> FileIO
> >>> and User interface permission.
> >>> I created a code group under all_Code, associated my assembly's
> >>> strong
> >>> name
> >>> to that group and assigned the permission set i created previously.
> >> Not a great idea. It would be better to add the new group under the
> >> appropriate zone group (usually intranet) in order to minimize the
> >> potential impact of a compromise of your signing key.
> >>
> >>> I also added the following attributes to my assembly:
> >>> [assembly:AllowPartiallyTrustedCallers]
> >>> [assembly: FileDialogPermission(SecurityAction.RequestMinimum ,
> >>> Unrestricted
> >>> = true)]
> >>> [assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
> >>> true)]
> >>> [assembly: FileIOPermission(SecurityAction.RequestMinimum,
> >>> Unrestricted =
> >>> true)]
> >>> I am having a file IO Exception while trying to retreive the FileName
> >>> property of the openFileDialog.
> >>>
> >> It really shouldn't be getting that far. Given that you've specified
> >> a
> >> RequestMinimum for
> >> unrestricted FileIOPermission, your assembly should not run at all if
> >> this
> >> permission is denied. Are you sure that you're attempting to run the
> >> latest
> >> version of the assembly?
> >> That said, you'll still have a problem once you resolve the above
> >> issue since the IE host won't resolve your assembly's strong name
> >> until after the permissions grant is complete. For workarounds, see
> >> http://blogs.msdn.com/shawnfa/archiv.../26/57026.aspx.
> >>
> >>> Any help will be very appreciate it.
> >>>
> >>> Thanks!
> >>>

> >
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please please please help this guy with his open source java app casioculture@gmail.com Java 4 05-05-2005 08:24 AM
Please need help with cisco router, please can anyone help smokin@aol.com Computer Support 2 10-31-2004 06:34 AM
Computer problems please please please help Nick Computer Support 0 06-04-2004 08:49 PM
HELP! HELP! PLEASE, PLEASE, PLEASE tpg comcntr Computer Support 11 02-15-2004 06:22 PM
please help... ...me learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57