[PATCH] s4:drs Create connection object (nTDSConnection)

tridge at samba.org tridge at samba.org
Mon Nov 16 23:40:54 MST 2009


Hi Cristian,

 > I added this function on a separate branch here, I'll update the other
 > places where this new function should be used. but how am I going to find
 > every occurrence of adding a DN to an ldb_message? I believe this "git grep"
 > isn't enough because there may be other DN variable names out there without
 > "dn" on it. but I'll change as much as I can and I'll send this separate
 > patch.

It's not essential that you find them all, but it would be nice to at
least find the more obvious ones. I actually don't think there are
very many of them. There are less than 90 calls to
ldb_msg_add_string() and it is fairly clear from a git grep that most
of them are not for a DN.

Each developer tends to have different habits, but when I am looking
for something like this I tend to do the git grep in emacs, and use
the "next hit" key to take me between them. It usually only takes a
few minutes to find the ones that need fixing.

Don't worry too much if you don't find them all, and if one of them
looks too tricky to change then its OK to leave it out of course.

 > now it returns void. if the function returns an error code, I don't know
 > what to do with it in the caller function (kccsrv_simple_update). I don't
 > think I can abort it, and a DEBUG message is already displayed for every
 > error on kccsrv_create_connection.

That's reasonable for now. We don't really have a good way of handling
internal db errors well beyond DEBUG() messages.

 > 5) Why are you adding an invocationId ?
 > 
 > 
 > I don't see this attribute on Windows too, but if I don't do it, when adding
 > the ldb_message I see this error:
 > 
 > Failed to find our own NTDS Settings invocationId in the ldb!
 > 
 > ldb: replmd_add: unable to find invocationId

Interesting! I think you should investigate this and find out why. The
fix is definately not to add an invocationId. It probably means there
is an existing bug in a different function in the code that your patch
happens to reveal. You should either use gdb or DEBUG() lines to work
out what in samdb_ntds_invocation_id() is failing. There are 4
possible calls to "goto failed" in that function that could be causing
the error. You need to work out which one it is, and then work out why
it is happening.

 > the current patch is attached. I'm also pushing my changes to the online
 > repository hosted at git://repo.or.cz/Samba/cd1.git. for now, the code is on
 > a branch called 'cd1',

Thanks for the git repo, that is much easier to work with than patches.

 > I'm struggling to move the code to the 'master' branch, git is
 > still something new to me...

learning git is a bit of a journey :-)

Don't worry about what branch it is on for now. I can look on the cd1
branch without problems.

Cheers, Tridge


More information about the samba-technical mailing list