Advice on source code sharing needed

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


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 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 ?


[*] 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: <>

More information about the samba-technical mailing list