LDB questions

Kai Blin kai at samba.org
Tue Feb 12 23:57:53 GMT 2008

Hi folks,

I'm currently trying to figure out how to add new entries to an ldb database.

I have tried using gendb_add_ldif, but that only seems to work for the first 
record I add.

The code looks like:

	sid_string = dom_sid_string(mem_ctx, *sid);

	new_record = talloc_asprintf(mem_ctx, "dn: objectSid=%s\n"
			"uidNumber: %u\nobjectSid: %s\n", sid_string, uid,

	if ((ret = gendb_add_ldif(idmap_ctx->idmap_ldb, new_record)) < 0) {
		DEBUG(0, ("Adding a new record failed: %d\n", ret));

For the first uid I try to map to a SID this works, the next one fails. What 
am I doing wrong? Is there a better way to do this?


Kai Blin
WorldForge developer  http://www.worldforge.org/
Wine developer        http://wiki.winehq.org/KaiBlin
Samba team member     http://www.samba.org/samba/team/
Will code for cotton.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.samba.org/archive/samba-technical/attachments/20080213/453c694b/attachment.bin

More information about the samba-technical mailing list