Fwd: Generalising SMB1 libsmb code

Stefan (metze) Metzmacher metze at samba.org
Fri May 25 07:48:13 MDT 2012


Hi Luk,

sorry for the delay!

> For generalising the code (getting rid of cli_state) in source3/libsmb,
> I keep stumbling on the same function, where I could need some advice:
> 
> cli_smb_req_create calls smb1cli_req_create, so it would be logical to
> try to replace cli_smb_req_create with smb1cli_req_create, though the
> latter has additional arguments:
> 
> clear_flags: depends on cli->case_sensitive
> additional_flags2: depends on cli->dfsroot
> pid: 0xFEFF as before? How does it get the actual pid from that btw?
> uid: cli->smb1.uid

The pid is important for smb1, I'm not sure yet where to store it in
future...

> So how do I get the cli->case_sensitive, cli->dfsroot and cli->smb1.uid
> (or the flags and uid) when I don't have cli, but have smbXcli_conn and
> smbXcli_session?

The first might be that we use smbXcli_session also for smb1.

And replace cli->smb1.uid with cli->smb1.session.

I think for now hide the change in cli_state_get_uid() and
cli_state_set_uid().

Then we need a smbXcli_tcon, first it should only be a simple wrapper to
int value, later we can add more stuff, like per share flags,
which could indicate if it's a dfsroot and the share supports
FILE_CASE_SENSITIVE_SEARCH.

> In the meantime I have worked a bit from the other side (getting rid of
> cli_state and some other functions), pushed to
> git://anonscm.debian.org/users/luk/samba.git like before.

Most of them look good, but I'm not sure if the 'split' patches are
the correct way to do it, maybe put them at the end of the patch stream.

If you still need something to work on maybe have a look at
https://lists.samba.org/archive/samba-technical/2012-February/081871.html
and start with a smb_transport abstraction for bsd sockets.
Basically a wrapper arround read_smb_send/_recv and writev_send/_recv

Thanks!

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120525/95f8bfaf/attachment.pgp>


More information about the samba-technical mailing list