SFTP SecurityException on Rackspace Cloud

0 votes
asked Feb 28, 2011 by Roberto Rossi (170 points)
edited Aug 7, 2012

I have the same problem, but the issue is not related to SocketPermission, which Rackspace Cloud grants. The problem is that the Rebex SFTP library demands FileIOPermission, even if I am using Streams and not file names in my API calls. Actually the Connect method fails because it requires FileIOPermission. Is it possible to have a version which does not require FileIOPermission?

Here's the stack trace: why do you try reading the Assembly location? Is that for licensing purposes? It just does not work.

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Assembly.get_Location() at cfDEPv.blAlGPZ.COzXmRZ() at cfDEPv.blAlGPZ.AiWkiLZ() at Rebex.Net.Sftp.beYqct() at Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters) at Rebex.Net.Sftp.Connect(String serverName) at Antea.ECG.NetworkProtocols.SFTP.Connect()
Applies to: Rebex SFTP

1 Answer

0 votes
answered Aug 7, 2012 by Lukas Pokorny (124,610 points)
edited Aug 7, 2012

In trial version, we are reading the assembly in order to validate the trial license key, which is embedded in it.

Since Rebex SFTP 2012 R1, this exception is no longer thrown - instead, another exception is raised that instructs the trial version user to ask for a non-embedded trial license key at support@rebex.net, which solves the issue.

Please note that this trial key checking code is only present in the trial version of our components. It's not in purchased versions.

...