I tried to delete an entry from my secrets.tdb with tdbtool but that didn't work. Here's what it looks like (with all the secret and here not relevant stuff removed). root@lt2 /etc/samba> tdbtool tdb> open secrets.tdb tdb> dump key 57 bytes SECRETS/LDAP_BIND_PW/cn=samba,ou=dsa,dc=vangasteren,dc=nl data 24 bytes [000] ... key 15 bytes SECRETS/SID/LT2 data 68 bytes [000] ... key 17 bytes SECRETS/SID/THUIS data 68 bytes [000] ... tdb> delete SECRETS/LDAP_BIND_PW/cn=samba,ou=dsa,dc=vangasteren,dc=nl delete failed Root has rw access rights to the file, so that is not the issue. P.S. I use samba-3.0.10-1.fc3 but that version is not in the list above.
I have just stumbled over this bug and found this bugzilla entry... I have the issue with all commands that are not traverse commands but act on one key. I have fixed in v4-0-test v3-3-test v3-2-test v3-0-test Cheers - Michael
marking bug as fixed. please reopen if the problem persists. Michael
Oops, I think I was overly enthusiastic about my commit. Matters are not as simple.
The tdb keys are stored in different formats: Some are stored as strings with trailing zeros, some are stored without trailing zeros. tdbtool takes the strings as the are provided. Non-printable characters can be specified as hex numbers in the form of \<digit> or \<digit><digit>. The LDAP_BIND_PW key is stored with trailing zero, so you will be able to delete it with the folowing ommand: tdb> delete SECRETS/LDAP_BIND_PW/cn=samba,ou=dsa,dc=vangasteren,dc=nl\0 i.e. by appending "\0" at the end. So it is not a bug in tdbtool but a (somewhat undocumented) method of usage. Marking the bug as resolved/invalid. Please reopen if problems pertain. Cheers - Michael