Shuo Dong
2015-Oct-26 17:24 UTC
[Samba] build my own server-side-copy client code using samba4 source code
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. Thanks,
Jeremy Allison
2015-Oct-27 23:39 UTC
[Samba] build my own server-side-copy client code using samba4 source code
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.
Seemingly Similar Threads
- how to build smbtorture using static linked libraries
- how to build smbtorture using static linked libraries
- Building rpcclient statically linked?
- How to build Samba4 using static linked libraries
- Build some shared libraries, and building exact these libraries directly to binaries at the same time.