attempt_netbios_session_request: causes seg fault in 2.0.6

Sean Legassick seanlegassick at cyberjunkie.com
Tue Dec 21 19:38:13 GMT 1999


[[ I tried to submit this as a bug report but it was not wanted. I do
not have time to spend ages working out a correct patch when an
experienced Samba developer can fix this in minutes. Any takers? ]]

RedHat 6.1, Samba 2.0.6m built from tarball

Whilst running "smbpasswd -j DOMAIN":

The final if statement in attempt_netbios_session_request
(libsmb/clientgen.c:3253) has two logic flaws as far as I can see. 

A) "!nmb_name_equal(..." should be "nmb_name_equal(..." (incorrect
negation)

B) If this nmb_name_equal test causes the rest of the condition to be
skipped (which, because of the incorrect negation, was done incorrectly
in my case) then the DEBUG statement makes use of a cli_state* cli which
has been shut down (a couple of lines up). This causes cli_error to seg
fault at line 2691 trying to read from cli->inbuf.

Also:

C) After fixing (A) above - I decided not to dabble with a fix for (B) -
I found that after attempt_netbios_session_request has returned False to
modify_trust_password (rpc_client/cli_netlogon.c:509),
modify_trust_password also tries to emit a diagnostic using cli_state*
cli, which again has now been shut down. This again seg faults.

I don't know what the correct approach to emitting diagnostics when the
client state in your hand has been shut down is, which is why I don't
suggest fixes for (B) or (C).

Sean


-- 
Sean Legassick
seanlegassick at cyberjunkie.com
                                 homo sum: humani nihil a me alienum puto



More information about the samba-technical mailing list