[Samba] Problems with smbldap-tools 0.8.2 and Samba 3

Áncor González Sosa ancorglez2 at softhome.net
Wed Jan 14 21:09:24 GMT 2004


I'm having problems using smbldap-tools 0.8.2 from idealix,
I'm using the following entry in my smb.conf file:
add machine script = smbldap-useradd.pl -w -g 553 %u

Then, while I try to add a workstation to my domain, the script
adds a posixAccount, and then I get this error:

  ------
[2004/01/14 18:15:49, 1] passdb/pdb_ldap.c:ldapsam_modify_entry(1173)
  ldapsam_modify_entry: Failed to add user 
dn=uid=nodo03$,ou=Computers,dc=guaydil,dc=prv with: Already exists

[2004/01/14 18:15:49, 0] passdb/pdb_ldap.c:ldapsam_add_sam_account(1575)
  ldapsam_add_sam_account: failed to modify/add user with uid = nodo03$ 
(dn = uid=nodo03$,ou=Computers,dc=guaydil,dc=prv)
[2004/01/14 18:15:49, 0] pc_server/srv_samr_nt.c:_samr_create_user(2330)
  could not add user/computer nodo03$ to passdb.  Check permissions?
  ------

This is the problematic (I think) piece of smbldap-useradd.pl

  ###### Here the posixAccount is added ########
  if (!add_posix_machine ($userName, $userUidNumber, $userGidNumber)) {
        die "$0: error while adding posix account\n";
  }

  if (!$with_smbpasswd) {

    ### The script "executes" this branch, so nothing is done. It expects
    ### Samba to add the sambaSAMAccount, but I think that Samba fails to
    ### do it because already exists the posixAccount (with the same uid)

        # (jtournier)
        # Objectclass sambaSAMAccount is now added directly by samba when
joigning the domain (for samba3)
        #if (!add_samba_machine_mkntpwd($userName, $userUidNumber)) {
        #  die "$0: error while adding samba account\n";
        #}
  } else {

        ##### The script never executes this branch

        if (!add_samba_machine($userName)) {
          die "$0: error while adding samba account\n";
        }

After the error, I have this (pretty useless) object in my LDAP tree
(NODO03 is the machine name):

dn: uid=nodo03$,ou=Computers,dc=guaydil,dc=prv
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
cn: nodo03$
sn: nodo03$
uid: nodo03$
uidNumber: 1002
gidNumber: 553
homeDirectory: /dev/null
loginShell: /bin/false
description: Computer
structuralObjectClass: inetOrgPerson
entryUUID: b343498a-db14-1027-8c44-bf8a7f8d59ff
creatorsName: cn=Manager,dc=guaydil,dc=prv
createTimestamp: 20040114193632Z
entryCSN: 2004011419:36:32Z#0x0001#0#0000
modifiersName: cn=Manager,dc=guaydil,dc=prv
modifyTimestamp: 20040114193632Z


If I try to manually add the account "as Samba would do it", I get
the same error that can be read in the Samba logs:

servidor:~# smbpasswd -a -m nodo03$
ldapsam_modify_entry: Failed to add user dn=
uid=nodo03$,ou=Computers,dc=guaydil,dc=prv with: Already exists

ldapsam_add_sam_account: failed to modify/add user with uid = nodo03$ (dn =
uid=nodo03$,ou=Computers,dc=guaydil,dc=prv)
Failed to add entry for user nodo03$.
Failed to modify password entry for user nodo03$

Any idea?



More information about the samba mailing list