libsmb and the cli_ routines and libsmbclient connection handling

Richard Sharpe sharpe at
Fri Jan 26 00:49:24 GMT 2001

At 09:51 AM 1/26/01 +1100, Tim Potter wrote:
>Richard Sharpe writes:
>> >I've basically hacked all the NT pipe specific stuff out of the
>> >cli_state structure and into a cli_pipe_state structure.  This
>> >structure also contains a pointer to a cli_state which can be
>> >shared amongst pipe users:
>> OK, what you describe is something like what I want to do, but it seems
>> like there is too much risk of breakage if I change the way things are done
>> at the moment.
>Yes.  There is a whole lot of NETLOGON stuff that relies on the
>existing cli_state stuff having all the right bits and pieces
>there.  It should just be a matter of converting it to use the
>new API but it's something that's going to need careful testing
>to make sure some other random bits of Samba don't break.

Well, the only things that are needed by later routines that I use are:


And there are 32 uses of cli->cnum scattered through mostly the libsmb code,
so it might not be as hard as I thought.

So, it might not be too hard to create a struct share_struct that has all
the needed stuff, plus a pointer to the cli_state that keeps the connection
and other stuff in it ... and then pass the right things later ...

Interestingly, there are two references to cli_send_tconX in DEBUG
statements in rpc_client/ntclienttrust.c, but there are no actual calls to
cli_send_tconX in that source file :-)

>> An alternative is to implement a parallel set of routines that do what I
>> want to do, but do not disturb the existing functionality.
>You might be able to do something with #define OLD_NTDOMAIN and
>NEW_NTDOMAIN to have both interfaces existing at the same time.
>I haven't looked to closely at it though.

Richard Sharpe, sharpe at
Samba (Team member,, Ethereal (Team member,
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba

More information about the samba-technical mailing list