NSS Modules
Hi guys ... I thought I'd give you a heads-up that I'm porting libnss-mysql to the NSS API that FreeBSD 5.1 has adopted in case anyone has input, suggestions, wants to test, etc.. I'm also curious about including it eventually .. via ports or something perhaps? Is anyone else developing NSS modules for FreeBSD? I believe I've figured out the API .. I've got a rudimentary test working, so ... Actually, I do have one question .. As I support more operating systems, I've wondered about how to autoconf the different APIs .. right now if I see nss.h I know it's one OS, and if I see nsswitch.h I know it's the other (Linux vs. Solaris) .. but that doesn't hold true with FreeBSD added to the mix. Any recommendations on what I could do to create an API define that holds the current O/S in a clean and reliable fashion? Thanks! -=| Ben http://libnss-mysql.sourceforge.net ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: NSS Modules
I'd like to support Sun's cc, however .. so I'm betting that isn't defined (I will check) ... I figured that would be available under gcc but assumed it wasn't "portable enough" ... And yes, one API would be nice. Each OS has their own :-\ Thanks! -=| Ben > You should be able to do: > > #if defined(__FreeBSD__) > > to test if you're on FreeBSD. This is built as part of the > freebsd-spec in gcc so it will be defined at least if you're using our > system (stock) compiler. > > Ideally, though, the API would be the same. :-) > ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: NSS Modules
> have a look at : > http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/51768 > (sorry I dirt your code :)) > It's *really* dirty :) but it works :-) It's actually a pretty good hack :-) I actually forgot that I'd run across this port earlier. It doesn't link on my system (removed -Bgroup to get it to work) and the configuration file in config.h ended up being "NONE/etc/libnss-mysql.cfg" .. so that's a bit broken.. and I'm also getting some warnings inside _nss_mysql_is_same_sockaddr but I was able to log in as cinergi. I'm curious how it worked tho .. I thought the function calls had to be something like: _nss_mysql_getpwnam_r (void *retval, void *mdata, va_list ap) and not _nss_mysql_getpwnam_r (const char *name, struct passwd *result, char *buffer, size_t buflen, int *errnop) I don't think I fully understand ns_mtab ... I see your mtab array .. which is different than how I conceived it.. anyway I'll let someone clarify. I'll still get this to compile cleanly without patches etc etc ... with your help that shouldn't take too long. Thanks! -=| Ben ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: NSS Modules
> You can still test for whether or not it is defined. > > #if defined(__FreeBSD__) > /* Do freebsd-specific stuff */ > #else > /* Other systems? */ > #endif *nod* I was just worried about the tests required for Solaris using either gcc or sun's cc .. looks like #if defined(sun) does the trick for either. And for Linux #if defined(linux) Is the API that FreeBSD adopted a "standard" BSD API? IE should I check for BSD instead of __FreeBSD__ ? IIRC this comes from the NetBSD implementation .. which perhaps I need to go install and test out as well :-) Sorry this got a little off topic ... Thanks! -=| Ben ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: NSS Modules
I've completed the port (not to be confused with FreeBSD ports) of libnss-mysql to FreeBSD. It seems to work well on my system. I've gone ahead and released libnss-mysql 1.0 which includes said port. Let me know how it goes. If someone wants to create a FreeBSD ports/package of it, that would be great! As I do with the linux RPM, I modify the link to statically compile libraries not in /lib (IE mysqlclient) to a) avoid boot issues and b) avoid requiring the mysql client library http://sourceforge.net/project/showfiles.php?group_id=56073&release_id=171128 -=| Ben ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"