Bug 3381 - Follow glibc convention for nss modules on Linux
Summary: Follow glibc convention for nss modules on Linux
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.9
Hardware: Other Linux
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-06 08:09 UTC by Bastien Nocera
Modified: 2006-02-21 07:49 UTC (History)
0 users

See Also:


Attachments
samba-correct-sonames.patch (1.92 KB, patch)
2006-01-06 08:10 UTC, Bastien Nocera
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bastien Nocera 2006-01-06 08:09:29 UTC
On Linux, the glibc provided nss modules use the name:
libnss_<module>-<glibc-version>.so
and the soname:
libnss_<module>.so.2
(.2 is hardcoded for "recent" glibcs, meaning glibcs that have existed in the past 5 years. the glibc doesn't export this number)

This also means that ldconfig will create the libnss_<module>-<glibc-version>.so to libnss_<module>.so.2 itself, and remove it when it's gone, avoiding dangling symlinks as can be seen in some packages.
Comment 1 Bastien Nocera 2006-01-06 08:10:16 UTC
Created attachment 1649 [details]
samba-correct-sonames.patch
Comment 2 Lars Müller 2006-02-16 14:45:09 UTC
Thanks Bastien.  I've fixed this last week without knowing your patch. :(  But the solution is mostly the same.  See Samba subversion revision 13417.
Comment 3 Bastien Nocera 2006-02-19 13:56:15 UTC
For my own benefit:
http://viewcvs.samba.org/cgi-bin/viewcvs.cgi?rev=13417&view=rev
Comment 4 Bastien Nocera 2006-02-21 05:13:07 UTC
Unless I'm missing something, this patch only changes the soname, and not the filenames.
The filename needs to be changed from:
libnss_<module>.so.2
to:
libnss_<module>-$SMB_VERSION_STRING.2

Should be enough to add this 2-liner in configure.in:
+ WINBIND_NSS="nsswitch/libnss_winbind-$SMB_VERSION_STRING.$SHLIBEXT"
+ WINBIND_WINS_NSS="nsswitch/libnss_wins-$SMB_VERSION_STRING.$SHLIBEXT"
as the patch I posted did.
Comment 5 Lars Müller 2006-02-21 07:32:20 UTC
The filename change (adding a version number) is not required.  I discussed this with two glibc developers.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2006-02-21 07:34:12 UTC
Lars is correct. IIRC ldconfig will create the symbolic links for 
you based on the soname of the file.
Comment 7 Bastien Nocera 2006-02-21 07:38:43 UTC
Maybe not needed, but the soname change isn't needed for this to work properly (only for the ldconfig symlinks to be cleaned up after removal) as the files are dlopen()'ed...
If you're going to be consistent, be consistent all the way, that includes versioning the files with samba's version.

Feel free to close this if you don't agree, at least I'll be able to do finger-pointing if somebody complains ;)
Comment 8 Lars Müller 2006-02-21 07:49:25 UTC
Consistent compared to what?  Compared to glibc or to other libnss providers like libnss_ldap?  Versioning the glibc libnss_* files was done to allow multiple installations at the same time.

If you can show me where we are inconsistent, then I'll rethink about this.

Else just finger-point at us.  It's good for our pagerank. ;)