<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Tahoma">Hi<br>
<br>
Thanks for the patch, but no, it doesn't fix the problem. <br>
Going home now, but I'll be available tomorrow if you have any
more ideas for me to try out :-)<br>
<br>
Thanks, Noel Grandin<br>
</font><br>
Tor Lillqvist wrote:
<blockquote
cite="mid:4E5DFC7402000028000A62C2@novprvoes0310.provo.novell.com"
type="cite">
<blockquote type="cite">
<pre wrap="">This appears to be a windows weirdity related to the fact that my account
name and my machine name is the same.
Under this situation, the LookupAccountName API call will return the wrong
answer.
</pre>
</blockquote>
<pre wrap="">
Well, "wrong" or "right" is a matter of opinion here, I guess... The documentation doesn't exactly mention this for LookupAccountName(),, true, but on the other hand, I guess that in general member computers also are "accounts" in the domain, or something, so it makes sense from that point of view...
Anyway, great catch!
Does this help?
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index ea59027..f5da4d9 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -464,8 +466,11 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
// Set the count variables to the buffer sizes and retrieve the SID.
cbSid = dwSidBufferSize;
cchDomainName = dwDomainBufferSize;
+ WCHAR wszComputerName[MAX_COMPUTERNAME_LENGTH+1];
+ DWORD nComputerNameSize = MAX_COMPUTERNAME_LENGTH + 1;
+ GetComputerNameW( wszComputerName, &nComputerNameSize );
if (LookupAccountNameW(
- NULL, // Computer name. NULL for the local computer
+ wszComputerName,
wszAccName,
pSid, // Pointer to the SID buffer. Use NULL to get the size needed,
&cbSid, // Size of the SID buffer needed.
--tml
</pre>
</blockquote>
<br><br><br><hr><font size="-2" color=808080>Disclaimer: <a href="http://www.peralex.com/disclaimer.html">http://www.peralex.com/disclaimer.html</a><br><br>
</body>
</html>