[Samba] ldapsam, smbpasswd and posixAccount
Hi, 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 [r...@tiffy openldap]$ smbpasswd -a schalke New SMB password: Retype new SMB password: ldapsam_create_user: failed to create a new user [schalke] (dn = uid=schalke,ou=users,dc=tuxgeek,dc=de) 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? Cheers. Thorsten -- Eternity is a very long time, especially towards the end. — Stephen Hawking smime.p7s Description: S/MIME cryptographic signature -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Re: [Samba] ldapsam, smbpasswd and posixAccount
are you loading samba.schema in your slapd.conf? Thorsten Scherf wrote: Hi, 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 [r...@tiffy openldap]$ smbpasswd -a schalke New SMB password: Retype new SMB password: ldapsam_create_user: failed to create a new user [schalke] (dn = uid=schalke,ou=users,dc=tuxgeek,dc=de) 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? Cheers. Thorsten -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Re: [Samba] ldapsam, smbpasswd and posixAccount
On [Tue, 06.10.2009 12:13], Adam Williams wrote: are you loading samba.schema in your slapd.conf? yes. running smbpasswd -a works without any problem when the user doesn't already exists with posix-attrs in LDAP. Thorsten Scherf wrote: Hi, 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 [r...@tiffy openldap]$ smbpasswd -a schalke New SMB password: Retype new SMB password: ldapsam_create_user: failed to create a new user [schalke] (dn = uid=schalke,ou=users,dc=tuxgeek,dc=de) 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? Cheers. Thorsten smime.p7s Description: S/MIME cryptographic signature -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Re: [Samba] ldapsam, smbpasswd and posixAccount
try smbpasswd -x user, then smbpasswd -a user Thorsten Scherf wrote: On [Tue, 06.10.2009 12:13], Adam Williams wrote: are you loading samba.schema in your slapd.conf? yes. running smbpasswd -a works without any problem when the user doesn't already exists with posix-attrs in LDAP. Thorsten Scherf wrote: Hi, 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 [r...@tiffy openldap]$ smbpasswd -a schalke New SMB password: Retype new SMB password: ldapsam_create_user: failed to create a new user [schalke] (dn = uid=schalke,ou=users,dc=tuxgeek,dc=de) 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? Cheers. Thorsten -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Re: [Samba] ldapsam, smbpasswd and posixAccount
On Tuesday 06 October 2009 03:11:29 pm Thorsten Scherf wrote: On [Tue, 06.10.2009 12:13], Adam Williams wrote: are you loading samba.schema in your slapd.conf? yes. running smbpasswd -a works without any problem when the user doesn't already exists with posix-attrs in LDAP. I'm not sure that there's a mechanism to tell smbpasswd that the LDAP user already exists, but without Samba attributes. Since smbpasswd is probably just generating an LDIF and dumping it onto the server instead of using much logic, you'll probably either have to do smbpasswd -a first and then write your own changeType: MODIFY LDIF for POSIX, or use something (like LAM) that does both. Wes -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba