I am running Lucid. I have setup openldap and samba a while ago, this problem existed since then and I still don't know how to fix it. I use webmin's LDAP client to create a "testuser" account, and get following error:
failed to save user : /usr/bin/pdbedit failed : pdb_set_user_sid_from_string: -21020 isn't a valid SID! init_sam_from_ldap: no sambaSID or sambaSID attribute found for this user atest ldapsam_getsampwnam: init_sam_from_ldap failed for user 'testuser'! ldapsam_add_sam_account: User 'testuser' already in the base, with samba attributes
I think SAMBA and OpenLDAP integration is not working corectly. Even with above error, "testuser" account is created. I can login with this account via SSH, but I can't login to Samba server on the same server. The last line of the error indicates some configuration is overlapped, but I don't know where and how to fix it.
Here is SAMBA setting section in LDAP users and groups configuration page of Webmin:
Samba version 3.4.7 LDAP protocol version 3
The error disappeared after I copied and pasted the sambaID for the samba server from "LDAP client -> LDAP Browser". So the input for "Domain SID for Samba3" looks something like:
Now samba user is created, but I still can't login to the samba server. The problem now is with password sync.