Article View: borland.public.cppbuilder.nativeapi
Article #2144Re: Assistance with AccessCheck() requested
From: Bob Gonder
Date: Thu, 12 Apr 2007 15:49
Date: Thu, 12 Apr 2007 15:49
49 lines
2833 bytes
2833 bytes
Andrue Cope wrote:
>I think I've tried it with and without.
First thing I've noticed is that as soon as you hit
while(pAttribute != NULL)
All returns leave the Connection Bound, and values allocated.
TOKEN_READ|TOKEN_QUERY,
Note that TOKEN_READ includes TOKEN_QUERY
You call it clientToken, but it is a process token (TRUE == process)
if(!ConvertSidToStringSidW(ownerInfo->Owner, &ourSid))
{
delete[] ourSid;
Doesn't look right, should be LocalFree, or better yet, nothing
Also, you never use it nor LocalFree( ourSid ) it.
The links I gave last night mention (among other things)
// AccessCheck is sensitive about what is in the SD; set
// the group and owner.
SetSecurityDescriptorGroup(psdAdmin, psidAdmin, FALSE);
SetSecurityDescriptorOwner(psdAdmin, psidAdmin, FALSE);
dwAccessDesired = FM_ACCESS_READ;
// Initialize GenericMapping structure even though we
// won't be using generic rights.
GenericMapping.GenericRead = FM_ACCESS_READ;
GenericMapping.GenericWrite = FM_ACCESS_WRITE;
GenericMapping.GenericExecute = 0;
GenericMapping.GenericAll = FM_ACCESS_READ |
FM_ACCESS_WRITE;
if (!AccessCheck(psdAdmin, hToken, dwAccessDesired,
>If you want to play around with it (and I suppose it has educational
>value concerning LDAP <g>) I've uploaded a BCB6 project
>'AccessCheck.zip'. You'll need to change main() to use your login and
>domain details and you'll need to be running MS Exchange though unless
>you want to try for some other permission.
I don't think I have login and domain details, nor MS Exchange
(XPHome). No idea what to change to be meaningfull on my system.
Technical Details
Message-ID:
<5shs13l91e16l000sk5pkqq9j9fvfd9mg0@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<461cd310$1@newsgroups.borland.com> <remp1315lj4ontsa4qtu32e9rm0matb6rr@4ax.com> <461ceb64$1@newsgroups.borland.com> <vt8r1310fd4tgivoavro3ssdgadjomt8fr@4ax.com> <461deb89$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8e080841c8729530 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Assistance with AccessCheck() requested Date: Thu, 12 Apr 2007 08:49:05 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <5shs13l91e16l000sk5pkqq9j9fvfd9mg0@4ax.com> References: <461cd310$1@newsgroups.borland.com> <remp1315lj4ontsa4qtu32e9rm0matb6rr@4ax.com> <461ceb64$1@newsgroups.borland.com> <vt8r1310fd4tgivoavro3ssdgadjomt8fr@4ax.com> <461deb89$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.88.78 X-Trace: newsgroups.borland.com 1176392943 69.69.88.78 (12 Apr 2007 08:49:03 -0800) Lines: 52 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail