Pierre Dinh-van
2004-Sep-17 14:58 UTC
[Samba] remote name change & machine account creation (Bug ?)
Hello, Before all, in advance, I'm sorry for my bad english. I'm trying to automate the join of new computers (running Windows XP Pro) to my Samba (3.0.7) domain by using a unique ghost image and a windows sysprep "script" that retrieve the real name of the machine and try to join the domain with this name. It works well while trying to join a w2k domain, but with my Samba domain, smbd tries to create a machine account on the OpenLDAP with the old name of the computer (the name which is on the ghost image, so the same name for all the computers...) in place of the name assigned by sysprep. After sniffing the network traffic with tcpdump, it seems that the new name of the client is really sent to the samba server, but it doesn't use it. I first thought it was a problem of nmbd, so I tried to set "name cache timeout = 0" in my smbd.conf, but it doesn't changed anything. (I tried it with 3.0.4, not with 3.0.7, but I don't want to run my prod server without name caching...) Finally, I looked in the samba source code, and I found a function named set_remote_machine_name() (in lib/substitute.c) which might be the reason of my problem... It's the first time I take a look into the samba source code, and I don't understand well how it works, but the param "perm" of this function seems to define if smbd must look (or not) for the realname of the computer. The only call of set_remote_machine_name() that I found which defines perm as True is in auth/auth_ntlmssp.c. set_remote_machine_name(auth_ntlmssp_state->ntlmssp_state->workstation, True); But I don't dare to change it as False because I don't understand what sort of problems it could generate... Can somebody confirm me that I'm looking in the right way ? Is there a solution to make it work at the time ? Thanks in advance -- Pierre Dinh-van
Pierre Dinh-van
2004-Sep-22 13:15 UTC
[Samba] Re: remote name change & machine account creation (Bug ?)
Le vendredi 17 Septembre 2004 16:58, vous avez ?crit?: [...]> Finally, I looked in the samba source code, and I found a function named > set_remote_machine_name() (in lib/substitute.c) which might be the reason > of my problem... > > It's the first time I take a look into the samba source code, and I don't > understand well how it works, but the param "perm" of this function seems > to define if smbd must look (or not) for the realname of the computer. > > The only call of set_remote_machine_name() that I found which defines perm > as True is in auth/auth_ntlmssp.c. > > set_remote_machine_name(auth_ntlmssp_state->ntlmssp_state->workstation, > True); > > But I don't dare to change it as False because I don't understand what sort > of problems it could generate...With no response of the list since my last mail, I tried to change this parameter to False on a test server, but it didn't solved my problem (described in my previous mail). I browsed (for hours) the source code at http://samba.org/doxygen/samba/, but I still can't find where my problem is coming from, and how I can solve it. If someone have an idea about a method I can try to locate the buggy function, I would appreciate a lot. Thanks in advance -- Pierre Dinh-van