Page 1 of 1 1
Topic Options
#102078 - 2003-06-12 09:41 AM INGROUP - Which API Function Used?
RicardM Offline
Lurker

Registered: 2003-06-12
Posts: 4
Loc: UK
Does anyone know what API the INGROUP function uses to obtain the Users Group information.

I need to know to determine whether the problem is with Kixtart or with AD/XP.

Top
#102079 - 2003-06-12 02:17 PM Re: INGROUP - Which API Function Used?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Ricard,

Welcome to the board!

Have you visited our wonderful - KiXtart FAQ & How to's Forum?

As we look through this list, we find the following topic - Analysis of KiX-related files

What APIs doe KiXtart use for INGROUP? Isn't that Kind of a "loaded question?" [Wink]
KIX32.EXE
ADVAPI32 23 AdjustTokenPrivileges
ADVAPI32 24 AllocateAndInitializeSid
ADVAPI32 157 FreeSid
ADVAPI32 199 GetSidIdentifierAuthority
ADVAPI32 201 GetSidSubAuthority
ADVAPI32 202 GetSidSubAuthorityCount
ADVAPI32 208 GetTokenInformation
ADVAPI32 239 LookupAccountSidA
ADVAPI32 240 LookupAccountSidW
ADVAPI32 245 LookupPrivilegeValueA

KXRPC.EXE
NETAPI32 240 NetUserGetLocalGroups

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#102080 - 2003-06-12 05:00 PM Re: INGROUP - Which API Function Used?
RicardM Offline
Lurker

Registered: 2003-06-12
Posts: 4
Loc: UK
Kent,

thanks for pointer, I found the work round for the problem in the latest copy of the documentation which mentions the group cache and flushing it.

I know virtually nothing about AD APIs, my normal territory is eDirectory, but looking up the APIs you list it looks like the key one is GetTokenInfomation which I guess is being called with TOKEN_GROUPS. As mentioned in my subsequent post it looks like Kixtart only gets the actual text group name for a SID when it detects a new of SID, thus when a group is renamed in AD as the SID doesn't change a script will fail until the cache is flushed giving the impression AD has "sticky" names.

Since I am guessing that this is by design to minimise network traffic. I have pulled my post that suggested it was a flaw.

Just very confusing when the manual you are working from doesn't mention the feature and possible side effects, when you are having AD making life interesting at the same time.

thanks,
RichardM

[ 12. June 2003, 17:05: Message edited by: RicardM ]

Top
#102081 - 2003-06-12 05:06 PM Re: INGROUP - Which API Function Used?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I maybe confused here.. What is not being shown - groups, users, what? Sure it maybe INGROUP(),SIDTONAME(), etc.

Rather than speculating what you are trying to do..

Can you share a snip of your code to see what is really going on?

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#102082 - 2003-06-12 05:20 PM Re: INGROUP - Which API Function Used?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I personally think the key API is LookupAccountSID ... after having personally written a utility that does something very similar here (we called the program "GroupIt" - lol - this was before v4.0) ... i think the process is:

1) Kixtart enumerates the security token of the user that is logging in.

2) For each Group SID in the token, it performs a LookupAccountSID on the domain, which can be time consuming. Plus, depending on how your domain is configured (talking NT 4 and trusted domains) this call can actually be broadcast across trusted domains.

3) The domain returns the string version of the group name, which is used to check the string in INGROUP(). This name is also cached for future reference.

4) Next time, instead of doing an account lookup, the cached version of the group name string is used. Until of course the cache is flushed and any potentially renamed group names are cached.

I know that I'm not adding any value-add to this thread, would be nice to get the developers comments on this though ...

-Shawn

Top
#102083 - 2003-06-13 10:21 AM Re: INGROUP - Which API Function Used?
RicardM Offline
Lurker

Registered: 2003-06-12
Posts: 4
Loc: UK
Kent,
Sorry if this all became confusing. The problem arose because a department changed name. So we renamed the group in AD and updated the script to:

If INGROUP("newDepartment")
..
..
EndIf

Then found the script no longer worked, so we changed the script back to:

If INGROUP("oldDepartment")
..
..
EndIF

Which then worked. This is exactly what the current manual (p19) warns about and the need for the /F<date> option. Unfortunately the previous copies of the manual, we have make, no mention of this "feature".

This also coincided with a glitch in AD, now fixed, hence the confusion about whether the problem was Kix or AD.

Top
#102084 - 2003-06-13 11:26 AM Re: INGROUP - Which API Function Used?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
So the cache Token was the culprit?
Top
#102085 - 2003-06-13 02:16 PM Re: INGROUP - Which API Function Used?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Doc brings up a good point.. Did you give that go?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#102086 - 2003-06-17 03:43 AM Re: INGROUP - Which API Function Used?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
quote:
Unfortunately the previous copies of the manual, we have make, no mention of this "feature".
That is because those previous versions of KiXtart also did not contain the /f either. The token-cache was introduced in KiXtart 4.02. And, as far as I remember, the documentation for KiXtart 4.02+ also contained the explanation for the token cache and potential pitfalls, that might necessitate the use of the /F command-line switch.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.058 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org