[Samba] build my own server-side-copy client code using samba4 source code

Jeremy Allison jra at samba.org
Tue Oct 27 23:39:35 UTC 2015


On Mon, Oct 26, 2015 at 12:24:24PM -0500, Shuo Dong wrote:
> Hello all:
> 
> I am working on implementing server-side-copy client code.
> When I checked samba4 source code, I saw that smbtorture has some sort of
> function that does server-side-copy client function.
> 
> So, I followed the way that smbtorture does, and implemented my own
> server-side-copy client code (let's call it cifs_cp).
> 
> Basically, my cifs_cp code, calls the functions in the files of:
> source4/libcli/smb2/
> 
> .c files in source4/libcli/smb2/ has all the functions that I need to do
> connection, open/close file, get info, ioctl.
> 
> However, .c files in source4/libcli/smb2 itself, is relying on many other
> libs (talloc, tevent, cmdline, auth and so on).
> 
> The solution that I have is to modify one of the wscipt_build so that it
> added my cifs_cp rules.
> And I did:
> waf configure --nonshared-binary=cifs_cp
> waf build --targets=cifs_cp
> 
> So, this only build my cifs_cp and it dependency libs.
> The issue I have now is the my cifs_cp is too large (10 MB), and it is
> using to much functions or .c files that not necessary.
> 
> How can I reduce the dependency files/libs that my cifs_cp is relying on.
> And what I need is just the functions under source4/libcli/smb2 to do
> connect, open/close, getinto, ioctl. And maybe some basic authentication
> functions as well.

You'll have to look at the build files to work this out.
The client lib code depends on talloc, tevent, cmdline, auth
in order to do its basic functionality so you might have
a hard job trying to cut these out.



More information about the samba mailing list