Matt, > On Tue, Mar 27, 2001 at 09:46:30AM -0600, Steve Langasek wrote:
> Which parts of the Samba source does it use? Does it just include header > files, or does it compile and link with code there? > There is a module, libpam-smb, which sounds similar to your program, which > includes a small (216k) SMB library in the smbval/ directory. > It seems to me that if other programs are using portions of Samba's source > code > in order to compile, those portions should be made into a library. The > 'libsmb' subdirectory in the Samba source appears to already encapsulate the > modules that might be more broadly useful. You should file a wishlist bug > against the samba package and discuss this possibility with the maintainer, > but > judging by Samba's bug list, it may not do any good. > Maybe it is time for someone to write a small NetBios library capable of > supplying shared libraries, and meeting the demands of programs like yours. The key portions of Samba that pam_smbpass uses (yes, it does link against Samba code) are the pieces responsible for managing the smbpasswd file (passdb/ subdir) and for loading options from the smb.conf file (params/ subdir). There are also some encryption routines from libsmb/ that get used. Of course, by way of dependencies, this code also sucks in nearly all of the files in lib/ and ubiqx/, as well as the winbind client code (nsswitch/) and the tdb code. I would love to be able to build this module using only public Samba APIs, but as you can see, that's not likely to happen in the near future. :) (And I haven't even mentioned the monolithic include files Samba currently uses internally... sigh. :) Richard Sharpe is currently working an a libsmbclient, which will take the Samba source tree a step in the right direction, but pam_smbpass isn't even an SMB client -- the APIs it needs access to are those for getting at config files on the local server. So compiling against public APIs is not currently possible; keeping local copies of necessary source files is rather unmaintainable (been there, tried that); and dynamically pulling in the Samba source code, while it allows for some clever build processes, leaves something of a bad taste in my mouth. I'm investigating the fourth option of getting pam_smbpass included in the (upstream) Samba distro, but in the meantime I'd like to get pam_smbpass packaged if possible. Steve Langasek postmodern programmer