Article View: borland.public.cppbuilder.nativeapi
Article #7673user impersonation
From: Costin
Date: Thu, 06 Jan 2005 22:36
Date: Thu, 06 Jan 2005 22:36
19 lines
1953 bytes
1953 bytes
What I'm trying to do is reading the registry of a remote machine using different user credentials. For that I'm using the Win API functions: LogonUser and ImpersonateLoggedOnUser (for user impersonation) than RegConnectRegistry. If I supply a wrong user name/password, meaning the user name/password being valid but the user does not have enough rights to access the remote registry, I'll get ACCESS DENIED. Then all subsequent attempts to access the remote registry will fail with ACCESS DENIED even if I supply the right user/pass combination. This persists until the app is restarted and the right user/pass are provided in the first place. In conclusion: 1. LogonUser & ImpersonateLoggedOnUser both succeed (valid user/pass) 2. RegConnectRegistry fails with ACCESS DENIED (user does not have enough rights) 3. This will still happend even if I supply the user/pass of a user with enough rights. Questions: 1. Why is this happening? 2. How can it be avoided?
Technical Details
Message-ID:
<41ddbfd3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c4e8c83fb5b37558,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Costin" <decbis@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: user impersonation Date: Fri, 7 Jan 2005 00:36:37 +0200 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 82.208.182.224 Message-ID: <41ddbfd3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1105051603 82.208.182.224 (6 Jan 2005 14:46:43 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail