Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Extremely freaky Security Exception

Reply
Thread Tools

Extremely freaky Security Exception

 
 
William Sullivan
Guest
Posts: n/a
 
      08-17-2005
I have a page that (simply put) displays information from a SQL database.
I've split off the business logic and database access logic into different
classes. My database access class exposes static methods for loading typed
datasets with information from the database. I call methods in this class
three times when my page loads. The first two methods I call work fine; they
return the data I expect from the database. The last method fails with a
Security Exception. The extremely freaky part is that when I follow the
execution while debugging, the exception is thrown exactly when I call the
method. Execution never enters the method. A snippet of code looks like:

this.securityData = DBHelper.GetSecurityData();

this.roomData = DBHelper.GetRoomData(this.userID);

CabinetData foo = DBHelper.GetCabinetData(roomServer, roomDbName, dbType);

the three methods do pretty much the same thing--connect to the database,
run a query, fill a typed dataset with the results, and return it. The only
difference is that the first two are instance variables, the third (foo) is a
local variable to the method where the calls occur. The exception is thrown
after the third line is reached and before stepping into the method. I want
to make this clear--the method GetCabinetData never executes; the exception
is thrown at the point where execution would normally transfer from the
calling method into GetCabinetData. I'm stumped. TIA.
 
Reply With Quote
 
 
 
 
William Sullivan
Guest
Posts: n/a
 
      08-17-2005
I caught the security exception, and the RefusedSet is
" [snip]Flags=\"UnmanagedCode\"[snip]

I never requested to run unmanaged code. I don't run unmanaged code. What
the heck is going on?

"William Sullivan" wrote:

> I have a page that (simply put) displays information from a SQL database.
> I've split off the business logic and database access logic into different
> classes. My database access class exposes static methods for loading typed
> datasets with information from the database. I call methods in this class
> three times when my page loads. The first two methods I call work fine; they
> return the data I expect from the database. The last method fails with a
> Security Exception. The extremely freaky part is that when I follow the
> execution while debugging, the exception is thrown exactly when I call the
> method. Execution never enters the method. A snippet of code looks like:
>
> this.securityData = DBHelper.GetSecurityData();
>
> this.roomData = DBHelper.GetRoomData(this.userID);
>
> CabinetData foo = DBHelper.GetCabinetData(roomServer, roomDbName, dbType);
>
> the three methods do pretty much the same thing--connect to the database,
> run a query, fill a typed dataset with the results, and return it. The only
> difference is that the first two are instance variables, the third (foo) is a
> local variable to the method where the calls occur. The exception is thrown
> after the third line is reached and before stepping into the method. I want
> to make this clear--the method GetCabinetData never executes; the exception
> is thrown at the point where execution would normally transfer from the
> calling method into GetCabinetData. I'm stumped. TIA.

 
Reply With Quote
 
 
 
 
William Sullivan
Guest
Posts: n/a
 
      08-18-2005
Lesson: Never put anything in your code that you do not fully understand.
Even if FxCop tells you to.

[assembly:SecurityPermission(SecurityAction.Request Refuse,
UnmanagedCode=true)]

"William Sullivan" wrote:

> I have a page that (simply put) displays information from a SQL database.
> I've split off the business logic and database access logic into different
> classes. My database access class exposes static methods for loading typed
> datasets with information from the database. I call methods in this class
> three times when my page loads. The first two methods I call work fine; they
> return the data I expect from the database. The last method fails with a
> Security Exception. The extremely freaky part is that when I follow the
> execution while debugging, the exception is thrown exactly when I call the
> method. Execution never enters the method. A snippet of code looks like:
>
> this.securityData = DBHelper.GetSecurityData();
>
> this.roomData = DBHelper.GetRoomData(this.userID);
>
> CabinetData foo = DBHelper.GetCabinetData(roomServer, roomDbName, dbType);
>
> the three methods do pretty much the same thing--connect to the database,
> run a query, fill a typed dataset with the results, and return it. The only
> difference is that the first two are instance variables, the third (foo) is a
> local variable to the method where the calls occur. The exception is thrown
> after the third line is reached and before stepping into the method. I want
> to make this clear--the method GetCabinetData never executes; the exception
> is thrown at the point where execution would normally transfer from the
> calling method into GetCabinetData. I'm stumped. TIA.

 
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
workings of the freaky freaky sandbox Nick Grandy Ruby 0 05-03-2008 08:39 AM
DVD Verdict reviews: LIVE FREAKY! DIE FREAKY!, THE MAN, and more! DVD Verdict DVD Video 0 02-17-2006 09:03 AM
Re: OT Cool illusion....freaky! James MCSE 3 12-05-2005 10:02 AM
sessionsaver xpi has a mild freaky UI Splibbilla Firefox 0 07-10-2005 09:48 PM
MSN Messenger 6.1.0207 and some freaky stupid things... Rusty Shackleford Computer Support 0 12-27-2003 07:06 AM



Advertisments