Advice on source code sharing needed

Noel Power nopower at suse.com
Tue Oct 22 03:18:59 MDT 2013


Hi

I am working on a patch for pam_winbind.c and I need to use a function
to trim whitespace from a string, rather than roll my own I'd like to
use the existing 'trim_string' implementation available from
lib/util/util.c. My initial attempt to link util.o when building
pam_winbind.so revealed the need to pull in a pile of extra object files
so it seems to reuse trim_string requires some source code re-arranging.
I am looking for advice on how to achieve this, please bear in mind I am
new to samba and don't have a great overview of the source structure. Is
there an existing suitable (low dependency in terms of linking) object
file that might be a good home for trim_string (and possibly other
'common' functions in the future). My current approach is to just split
out the functionality (currently just trim_string) into a new source
file, attached is a patch (just for illustration purposes[*]) that
hopefully more clearly shows my intention. Thoughts ?

thanks,
Noel

[*] although for illustration purposes if this approach is actually
reasonable then please review more strictly(it's based on 3.6-stable but
of course I will do same for master)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-source-file-to-share-basic-trivial-dependency-ut.patch
Type: text/x-diff
Size: 6858 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131022/2168a4d0/attachment.patch>


More information about the samba-technical mailing list