Once you’ve determined that it is a SYSTEM thread, you must see who they are
impersonating. Here’s the code I use:
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
BOOLEAN EffectiveOnly, CopyOnOpen;
PTOKEN_SOURCE lpTokenSource;
PACCESS_TOKEN lpToken;
//
// Is this thread impersonating anyone?
//
lpToken = PsReferenceImpersonationToken( Irp->Tail.Overlay.Thread,
&CopyOnOpen, &EffectiveOnly, &ImpersonationLevel );
if( lpToken != NULL )
{
status = SeQueryInformationToken( lpToken, TokenSource, &lpTokenSource
);
// lpTokenSource is the real (network) user…
PsDereferenceImpersonationToken(lpToken);
}
HTH,
Ken
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alex Korthny
Sent: Sunday, September 19, 2004 2:50 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Discovering user token for file access via network
Hello,
My filter driver intercepts IRP_MJ_CREATE requests and need to retrieve user
token for user which tries to access file. If I retrieve token for current
thread( or current process, if current thread have no token ), it seems to
work well, but sometimes, in case of network access, I have wrong
token(usually SYSTEM ).
I tried to use SeQuerySubjectContextToken, but in the case I have always the
same token - currently logged in local user, which is not correct for
network case.
Now I’m looking for reliable solution for the problem that will work on all
platforms starting from Win NT - to Win2k3.
Thanks,
Alex.
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com