Hello,
i think the problem is somewhere else.
The "add machine script" is supposed to create only UNIX (POSIX) account.
Either in /etc/passwd or in LDAP (using smbldap-useradd -w). Samba then
calls smbpasswd -a -m to create the samba account (either in smbpasswd,
tdbsam or LDAP), but before it checks, if the UNIX account exists. And
that is the place where your setup fails.
It took me a lot of time to hunt this bug in my system, because even -i
switch didn't help me. The problem is that by default user accounts
are created in LDAP tree ou=people,dc=example and computer accounts
are in tree ou=computer,dc=example. When you search the samba accounts
using pdbedit, they will look OK, but unix doesn't see them and so does
smbpasswd -a. What UNIX considers to be account is determined in
/etc/libnss-ldap.conf and we have this in it
nss_base_passwd ou=people,dc=example?sub
nss_base_shadow ou=people,dc=example?sub
nss_base_group ou=group,dc=example?one
So nothing in ou=computer,dc=example is considered to be a UNIX account
and won't work as expected. You have to adjust either libnss-ldap.conf
or smbldap.conf and restructure your LDAP data to get computer and user
accounts into the same subtree of LDAP. Then it works.
I think this should put into documentation.
Regards
Vladislav Kurz