[cvsnt] NetGetAnyDCName vs NetGetDCName

Mathieu Veurman MVeurman at seagull.nl
Thu Feb 5 12:24:08 GMT 2004


Hi all,

Our office in Ireland cannot login to the repository in Holland. We use
the pserver protocol over a VPN connection and server 2.0.12. The
problem is that the Irish users are members of domain seagullirl and in
Holland (where the server is) we are part of the domain seagull.

So for Irish users to connect, they will have to add 'seagullirl\' to
their user name eg: :pserver:seagullirl\john at cvs1.seagull.nl:c:\repo.

The problem is that the server reports for them: no such user. I've
tracked the problem down to the use of the NetGetAnyDCName function in
win32.c. The first parameter is NULL, which specifies the server to
execute the request. NULL means to use the local computer. The MSDN
documentation on this function states:
  
"... If 'servername' specifies a workstation that is a member of a
domain, or a server that is a member of a domain, the domainname must be
in the same domain as 'servername'.
If 'servername' specifies a domain controller, the domainname must be
one of the domains trusted by the domain for which the server is a
controller...."

Our CVS server is NO domain controller, so the first rule applies: the
domainname specified must be in the same domain as the server is. But
that is not the case, since our server is part of the 'seagull' domain,
and the domain specified is 'seagullirl'. Seagullirl is a trusted
domain, but trusted domains are only checked if the server specified is
a domain controller. So the result is that no dc is returned, and later
on the function NetUserGetInfo will fail and report that the specified
user doesn't exist.

If I substitute NetGetAnyDCName by NetGetDCName the PDC of the
seagullirl domain is returned and all runs well. It looks like
NetGetAnyDCName was added in version 1.56 of win32.c without any clear
description why. What's the drawback to replace NetGetAnyDCName by
NetGetDCName? If there is one, why not make a combination of both? If
the first one fails the second one still has the possibility to come up
with a valid dc.

Regards,

Mathieu Veurman

Mathieu Veurman
Development Team Leader, Palo Alto
<mailto: mveurman at seagull.nl>

Seagull Software
Korte Parallelweg 1, 3311 JN  Dordrecht, The Netherlands
Tel.   +31 78 6322800, Fax  +31 78 6138134

http://www.seagullsoftware.com/





More information about the cvsnt mailing list