473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Impersonation to less powerfull user and the executing app with link label leads to security exception,...

Hi,

the topic of this thread implies the question.
Why does this happen. What can i do against
it. App runs in admin context, then ii switch to
user standard user context and open a form
with linklabel. this leads to following exeption:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.Security.SecurityException: Der angeforderte Registrierungszugriff
ist unzulässig.
bei System.ThrowHelper.ThrowSecurityException(Exceptio nResource resource)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name)
bei System.Windows.Forms.LinkUtilities.GetIEColor(Stri ng name)
bei System.Windows.Forms.LinkUtilities.get_IELinkColor ()
bei System.Windows.Forms.LinkLabel.get_IELinkColor()
bei System.Windows.Forms.LinkLabel.get_LinkColor()
bei System.Windows.Forms.LinkLabel.OnPaint(PaintEventA rgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.WndProc(Message& m)
bei System.Windows.Forms.LinkLabel.WndProc(Message& msg)
bei System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
MyComputer

quickly translated: The requested registry access is not alowed.
The Zone where the error was thrown: MyComputer

Any ideas how to fix this,...

TIA

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Jun 27 '08 #1
4 1684
The user you are impersonating does not have access to the registry keys.
That's the easy part. The hard part is why you would go from admin to a
lesser account. It's like a right hander insisting on writing with her left
hand. The admin account can access the registry keys so you should read the
keys from the admin account instead of impersonating.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:#x**************@TK2MSFTNGP04.phx.gbl...
Hi,

the topic of this thread implies the question.
Why does this happen. What can i do against
it. App runs in admin context, then ii switch to
user standard user context and open a form
with linklabel. this leads to following exeption:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.Security.SecurityException: Der angeforderte Registrierungszugriff
ist unzulässig.
bei System.ThrowHelper.ThrowSecurityException(Exceptio nResource
resource)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
writable)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name)
bei System.Windows.Forms.LinkUtilities.GetIEColor(Stri ng name)
bei System.Windows.Forms.LinkUtilities.get_IELinkColor ()
bei System.Windows.Forms.LinkLabel.get_IELinkColor()
bei System.Windows.Forms.LinkLabel.get_LinkColor()
bei System.Windows.Forms.LinkLabel.OnPaint(PaintEventA rgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs
e, Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.WndProc(Message& m)
bei System.Windows.Forms.LinkLabel.WndProc(Message& msg)
bei System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
MyComputer

quickly translated: The requested registry access is not alowed.
The Zone where the error was thrown: MyComputer

Any ideas how to fix this,...

TIA

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Jun 27 '08 #2
Hi Alvin,
>The hard part is why you would go from admin to a
lesser account
there is a simple answer to this. I was checking the
applications behavior under less powerfull conext
usage, just to see how it will work under this
circumstances. Without switching the context and
by just running the app under standard user or power,
even admin user it works fine. The context switch
does affect this registry stuff. I will check with regmon
or procmon what the stuff is that my app cant read/write
to,...

The "real" reason for the context switch is the intention,
that you work with less powerfull account all time, but
you will need more power, eg. control some system stuff,
you will have the chance to do a quick context switch,...

Thanks for your reply,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filterschrieb
im Newsbeitrag news:B3**********************************@microsof t.com...
The user you are impersonating does not have access to the registry keys.
That's the easy part. The hard part is why you would go from admin to a
lesser account. It's like a right hander insisting on writing with her
left
hand. The admin account can access the registry keys so you should read
the
keys from the admin account instead of impersonating.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:#x**************@TK2MSFTNGP04.phx.gbl...
Hi,

the topic of this thread implies the question.
Why does this happen. What can i do against
it. App runs in admin context, then ii switch to
user standard user context and open a form
with linklabel. this leads to following exeption:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.Security.SecurityException: Der angeforderte
Registrierungszugriff
ist unzulässig.
bei System.ThrowHelper.ThrowSecurityException(Exceptio nResource
resource)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
writable)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name)
bei System.Windows.Forms.LinkUtilities.GetIEColor(Stri ng name)
bei System.Windows.Forms.LinkUtilities.get_IELinkColor ()
bei System.Windows.Forms.LinkLabel.get_IELinkColor()
bei System.Windows.Forms.LinkLabel.get_LinkColor()
bei System.Windows.Forms.LinkLabel.OnPaint(PaintEventA rgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs
e, Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.WndProc(Message& m)
bei System.Windows.Forms.LinkLabel.WndProc(Message& msg)
bei
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
MyComputer

quickly translated: The requested registry access is not alowed.
The Zone where the error was thrown: MyComputer

Any ideas how to fix this,...

TIA

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

Jun 27 '08 #3
Right, so that's why you should run with least privilege and then
impersonate a stronger account when you need to read to, remembering to
revert back when you are done.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:OU**************@TK2MSFTNGP04.phx.gbl...
Hi Alvin,
>>The hard part is why you would go from admin to a
lesser account

there is a simple answer to this. I was checking the
applications behavior under less powerfull conext
usage, just to see how it will work under this
circumstances. Without switching the context and
by just running the app under standard user or power,
even admin user it works fine. The context switch
does affect this registry stuff. I will check with regmon
or procmon what the stuff is that my app cant read/write
to,...

The "real" reason for the context switch is the intention,
that you work with less powerfull account all time, but
you will need more power, eg. control some system stuff,
you will have the chance to do a quick context switch,...

Thanks for your reply,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filter>
schrieb
im Newsbeitrag news:B3**********************************@microsof t.com...
>The user you are impersonating does not have access to the registry keys.
That's the easy part. The hard part is why you would go from admin to a
lesser account. It's like a right hander insisting on writing with her
left
>hand. The admin account can access the registry keys so you should read
the
>keys from the admin account instead of impersonating.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:#x**************@TK2MSFTNGP04.phx.gbl...
Hi,

the topic of this thread implies the question.
Why does this happen. What can i do against
it. App runs in admin context, then ii switch to
user standard user context and open a form
with linklabel. this leads to following exeption:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.Security.SecurityException: Der angeforderte
Registrierungszugriff
ist unzulässig.
bei System.ThrowHelper.ThrowSecurityException(Exceptio nResource
resource)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
writable)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name)
bei System.Windows.Forms.LinkUtilities.GetIEColor(Stri ng name)
bei System.Windows.Forms.LinkUtilities.get_IELinkColor ()
bei System.Windows.Forms.LinkLabel.get_IELinkColor()
bei System.Windows.Forms.LinkLabel.get_LinkColor()
bei System.Windows.Forms.LinkLabel.OnPaint(PaintEventA rgs e)
bei
System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs
e, Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.WndProc(Message& m)
bei System.Windows.Forms.LinkLabel.WndProc(Message& msg)
bei
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg,
IntPtr wparam, IntPtr lparam)
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
MyComputer

quickly translated: The requested registry access is not alowed.
The Zone where the error was thrown: MyComputer

Any ideas how to fix this,...

TIA

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

Jun 27 '08 #4
Hi Alvin,
>revert back when you are done
RevertToSelf();

or the mannaged version from ImpersonationContext,...

Thanks for remembering, but my application handles
all the "freing" stuff (Revert,Free Memory, Fre Handles, etc)
fully automatically,...it has its own resource management
extending the .NET FW GC Classes, because it uses heavilly
PInvoke unmanaged Heap Memory and Marshal-Class stuff.
So this must be handled and cleaned-up very efficientlly,...

Have a nice day,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filterschrieb
im Newsbeitrag news:B7**********************************@microsof t.com...
Right, so that's why you should run with least privilege and then
impersonate a stronger account when you need to read to, remembering to
revert back when you are done.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:OU**************@TK2MSFTNGP04.phx.gbl...
>Hi Alvin,
>>>The hard part is why you would go from admin to a
lesser account

there is a simple answer to this. I was checking the
applications behavior under less powerfull conext
usage, just to see how it will work under this
circumstances. Without switching the context and
by just running the app under standard user or power,
even admin user it works fine. The context switch
does affect this registry stuff. I will check with regmon
or procmon what the stuff is that my app cant read/write
to,...

The "real" reason for the context switch is the intention,
that you work with less powerfull account all time, but
you will need more power, eg. control some system stuff,
you will have the chance to do a quick context switch,...

Thanks for your reply,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filter>
schrieb
im Newsbeitrag news:B3**********************************@microsof t.com...
>>The user you are impersonating does not have access to the registry
keys.
That's the easy part. The hard part is why you would go from admin to a
lesser account. It's like a right hander insisting on writing with her
left
>>hand. The admin account can access the registry keys so you should read
the
>>keys from the admin account instead of impersonating.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Kerem Gümrükcü" <ka*******@hotmail.comwrote in message
news:#x**************@TK2MSFTNGP04.phx.gbl...
Hi,

the topic of this thread implies the question.
Why does this happen. What can i do against
it. App runs in admin context, then ii switch to
user standard user context and open a form
with linklabel. this leads to following exeption:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.Security.SecurityException: Der angeforderte
Registrierungszugriff
>ist unzulässig.
bei System.ThrowHelper.ThrowSecurityException(Exceptio nResource
resource)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
writable)
bei Microsoft.Win32.RegistryKey.OpenSubKey(String name)
bei System.Windows.Forms.LinkUtilities.GetIEColor(Stri ng name)
bei System.Windows.Forms.LinkUtilities.get_IELinkColor ()
bei System.Windows.Forms.LinkLabel.get_IELinkColor()
bei System.Windows.Forms.LinkLabel.get_LinkColor()
bei System.Windows.Forms.LinkLabel.OnPaint(PaintEventA rgs e)
bei
System.Windows.Forms.Control.PaintWithErrorHandli ng(PaintEventArgs
e, Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.WndProc(Message& m)
bei System.Windows.Forms.LinkLabel.WndProc(Message& msg)
bei
System.Windows.Forms.Control.ControlNativeWindow. OnMessage(Message&
>m)
bei
System.Windows.Forms.Control.ControlNativeWindow. WndProc(Message&
m)
> bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg,
IntPtr wparam, IntPtr lparam)
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
MyComputer

quickly translated: The requested registry access is not alowed.
The Zone where the error was thrown: MyComputer

Any ideas how to fix this,...

TIA

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."


Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris | last post by:
Hello all, Here is my problem. I have a windows service (C#) that is supposed to move files from/to the local drive to/from a UNC share (\\domainserver\share). The service is running on a Win3k...
6
by: Grei | last post by:
how can i impersonate from win2000 to WinXP? MSDN gives example how to implemet impersonation from XP to XP, but not from win2000 to XP, and it doesn't say what to do with win2000!!! any ideas?...
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
3
by: Granger Godbold | last post by:
I've found a solution to this that I think I like, but I thought it wise to put it out for all to see so people could punch holes in it as they wished. (Is there a better way?) I want a page in...
10
by: Markus P | last post by:
Hi! I am trying to write an asp.net app (page/class) which is going to make several calls to distibuted objects (com+/serviced componentes) which in turns talks to other distributed computers....
3
by: Jim McGivney | last post by:
In an aspx page I have a datagrid populated by an oledbDataAdaptor and dataset from a Microsoft Access database. When the line <identity impersonate="true" /> is placed in the web.config , I am...
1
by: Matthias Wohlmann | last post by:
Hi, I've got an ASP.NET Web-Application written in C#. In IIS 6.0 (Windows Server 2003) I have set the application to allow anonymous access, but instead of the default user I use an own...
8
by: Marco Mechelli | last post by:
Hello, i'm facing with the following problem while using the Job API during an impersonation. I have a main process that needs to do the following: 1. Creates a new Job Object that will be...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.