Security problem iwth ObjRef

Tech-Archive recommends: Fix windows errors by optimizing your registry



My client application received the exception below. This was returned from my server application.

Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed.

I know exactly what line of code caused this but I do not know why or exactly what it means. Here is the overview.

I have a server that creates one SAO and clients that can create several CAOs. The CAO needs to be sponsored, so I have a class
in the client that derives from MarshalByRefObject and implements ISponsor as below.
public class SponsordCAOSponsor: MarshalByRefObject, ISponsor
{
public override object InitializeLifetimeService ()
{
return null;
}
public TimeSpan Renewal (ILease lease)
{
// do work and return appropriate TimeSpan
}
}

I register this class as the sponsor of the CAO just after the CAO is created and marshaled. The problem was that Renewal was
never being called. I decided to check things out by having the server code call Renewal just to see if it was callable and
actually got called in the correct context. The result was the exception above. I changed the call to Renewal to a call on a
different method in the class and it completed and completed on the client as expected.

FYI. I believe (because I have managed to get server to client event notification working) that I have correctly setup 2 way
channels so that the server code can access the client side created sponsor.

Any explanation of the exception or ideas as to why Renewal is not being called when the lease is ready to expire would be most
appreciated.

Thanks
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
.



Relevant Pages

  • return from server only works for built-in types
    ... But when I call _r.GetStatisticsthe client fails with the exception shown ... GetStatistics fails when client and server is on different networks. ... Win32 Version: 2.0.50727.832 ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)
  • This is going straight to the pool room
    ... or not the client has privilege to do what they're trying to do, ... The server environment is this: ... 3GL User action Routines that Tier3 will execute on your behalf during the ... Routine Name: USER_INIT ...
    (comp.os.vms)
  • [Full-Disclosure] R: Full-Disclosure Digest, Vol 3, Issue 42
    ... Full-Disclosure Digest, Vol 3, Issue 42 ... SD Server 4.0.70 Directory Traversal Bug ... Arkeia Network Backup Client Remote Access ...
    (Full-Disclosure)
  • Re: What doesnt lend itself to OO?
    ... > rather than client code. ... no way to do that without also touching the object with clock semantics ... will not encapsulate both clock semantics and network semantics. ... The server can do whatever it wants ...
    (comp.object)