How does one debug smbd?

eric steadle esteadle at
Wed Jul 18 22:41:42 GMT 2001

--- "Michael H. Warfield" <mhw at> wrote:

> 	Why not start up smbd separately and then run gdb on the object file
> and then attack to the PID you want to debug?

A splendid idea. When I tried it though, I can't seem to get breakpoints to
work - gdb complains that it can't load the symbols for the process. But that's
more of a gdb problem, not a Samba problem, so I won't be offended if we decide
not to discuss it here. Still, any ideas are welcome :)

> 	I think that's controlled from the "-D" option.  Don't use it
> and it shouldn't fork.  (?)

Actually, you are correct. "-D" controls daemon mode, except I didn't bother to
show you what happens when that line of code executes....

if (!is_daemon && !is_a_socket(0)) {
    DEBUG (...) ;
    is_daemon = true ; 

So if that test on is_a_socket(0) returns false (which it always seems to do
while I'm running in a debugger) then is_daemon will get set to true and I'm
back where I started. 

Like I said before, I'm not a daemon expert and I don't know how to control
processes under *nix. This is my first experience hacking a daemon and I'm

Maybe it would be better if I explained my real problem with net_sam_logon
(which is why I want to run this in a debugger). 

I'm experimenting with NT Network Authentication. Using Luke Leighton's book as
a guide and Samba as a reference, I've writting my own authentication program
which takes ONC-RPC logon requests and turns them into MS-RPC logon requests to
an NT-PDC. While I can successfully authenticate myself as a computer belonging
to the domain (NetServerAuthenticate2), I have been unable to get the
NetrLogonSamLogon call to generate a response. The PDC just ignores me - no
error response, no crash, nothing -- almost like it's waiting for more data or

But, the packet format looks good in my Netmon traces, and I'm convinced that I
compute the credentials that I need correctly. But it doesn't work and I don't
know why. 

So I wanted to take a look inside of the auth-code in Samba and try to figure
out what I missed. 

Any ideas or suggestions are most welcome. 


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

More information about the samba-technical mailing list