[Samba] ldapsam, smbpasswd and posixAccount

Thorsten Scherf tscherf at redhat.com
Tue Oct 6 10:19:43 MDT 2009


I have a setup with Samba (3.4) as PDC with ldapsam as backend. LDAP is
managed by Samba, no external helper scripts. When I add a new user with 
"smbpasswd -a foo" it works fine, user is created and the openldap is 
populated with samba and  posix attributes. 

Now, when I add a new user to the directory by running ldapadd against
a ldif file which contains only posix related attrs, I thought, running
smbpasswd -a would add the necessary samba attrs, but that's not the
case. I see this problem:

$ ldapadd -x -D "cn=Manager,dc=tuxgeek,dc=de" -f /tmp/posix.ldif -W
adding new entry "uid=schalke,ou=users,dc=tuxgeek,dc=de"

$ ldapsearch -xLLL uid=schalke
dn: uid=schalke,ou=users,dc=tuxgeek,dc=de
uid: schalke
objectClass: account
objectClass: posixAccount
cn: schalke
uidNumber: 10100
gidNumber: 10023
homeDirectory: /home/TUXGEEK/schalke
loginShell: /bin/bash

[root at tiffy openldap]$ smbpasswd -a schalke
New SMB password:
Retype new SMB password:
ldapsam_create_user: failed to create a new user [schalke] (dn =
Failed to add entry for user schalke.

This is from the log:
sambaAcctFlags objectClass
Oct  6 18:05:26 tiffy slapd[5819]: conn=12 op=7 RESULT tag=103 err=20
text=modify/add: uid: value #0 already exists

Could anybody shed some light on this?


"Eternity is a very long time, especially towards the end."
   — Stephen Hawking

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3855 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba/attachments/20091006/e47b8157/attachment.bin>

More information about the samba mailing list