PC Review


Reply
Thread Tools Rate Thread

Security issue when creating thread in Smart Client

 
 
Dave
Guest
Posts: n/a
 
      7th Dec 2004
I have a C# application that I want to run as a "smart client", by executing
the exe through IE pointing to an intranet server. I need to increase
permissions to the application because it accesses a local SQL server, and
the Intranet zone by default doesn't have rights to do this
(SqlClientPermission).

So, I assigned FullTrust to the URL that points to my app through the .NET
configuration tool. Everything was working fine until I needed to have my
app access an unmanaged COM object. That object needs to run in an STA
thread, and the IExec process that starts my app is MTA. So, no problem - I
started an STA thread and have all my code run inside that.

Now I have a strange security problem. The application will run fine if I
run it directly by double-clicking on the exe in "My Computer", but when I
try to run it through the IE shortcut, I get a permission exception -
SqlClientPermission.

Code running in the STA thread is doesn't longer have the rights I assigned
in the .NET config tool. I verified this by requesting SQLClientPermission
in the calling thread, and then in the created thread. The calling thread
can get the permission fine. The created thread can't. I then tried having
the created thread impersonate the WindowsIdentity of the calling thread,
but it doesn't have rights to do that, either.

Anyone have any ideas?

- Dave


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
ShowDialog - Cross-thread operation not valid: Control'CheckAccountInfo' accessed from a thread other than the thread it was createdon. Tom C Microsoft C# .NET 9 20th Feb 2008 09:15 PM
Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on Joe Microsoft C# .NET 4 12th Mar 2007 10:59 AM
ClickOnce (smart client) for smart devices running CF 2.0 ? Jim Microsoft Dot NET Compact Framework 3 27th Jan 2006 02:50 AM
Thread A calls a delegate on Thread B but Thread A executes it!?!? Paul Tomlinson Microsoft C# .NET 4 3rd Feb 2005 11:09 PM
Shut down thread - thread closes form, form doesn't close because thread calls it etc... Robin Tucker Microsoft VB .NET 4 17th Oct 2003 12:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:27 PM.