Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 13:56:23 -0500
From:      "Kutulu" <kutulu@kutulu.org>
To:        <wgrim@siue.edu>, "Wes Peters" <wes@softweyr.com>
Cc:        <freebsd-hackers@freebsd.org>
Subject:   Re: nsswitch help for you?
Message-ID:  <008c01c2b5b5$4f791ac0$29330f0a@lcapps.educate.com>
References:  <E18R5Ip-000KLt-00@cs.huji.ac.il>  <1040799271.3e095627bbce3@webmail1.isg.siue.edu> <1041722581.17746.75.camel@zaphod.softweyr.com> <1041875327.3e19c17f7c1f1@webmail1.isg.siue.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
From: <wgrim@siue.edu>
Sent: Monday, January 06, 2003 12:48 PM
> Oh, and you were right, the problem supposedly exists somewhere in the
glibc
> libraries.  I haven't taken a personal look yet, but supposedly dlopen()
causes
> problems when called if the calling program isn't statically linked to
libc.
> At least, I think I remember that synopsis correctly; it's been a while.
>
> Basically, the best I could get out of the synopsis is that the calling
program
> calls a dlopen(), but it gets confused as to what is statically linked and
what
> is not, and then it poops.

The other way around, actually.  A statically-linked program can't call
dlopen() successfully.  The result is always an error that the requested
operation isn't allowed.

This is a problem with the ELF format and dlopen() in general, not
specifically nsswitch or even FreeBSD.  As far as other, working nsswitch
implementations go:

Linux: The last I read about it (~6 months ago), glibc's deveopers basically
said "dlopen() works from a static app exactly well enough to support
nsswitch, that's it, period."  Obviously they've got some kind of hack in
glibc to make it work, but I have no idea how.  And before you go looking,
you need to be very careful there not to use the GPL'd code or any code
derived from it in FreeBSD's library.

Solaris: Sun basically tells you not to link binaries statically on Solaris,
period.  (The reason I saw quoted most often was, if a security hole is
patched in libc.so it won't filter through to statically linked binaries.)
I beleive trying to do so makes the linker complain about missing the
dlopen/dlsym/etc calls, which need to be pulled in from libdl, which implies
a non-statically-linked binary.  So they're already at the point FreeBSD is:
nsswitch could work if you mandated that static binaries didn't exit :)

(Caveat: It's been a while since I did any big UNIX develpment apart from
personal FreeBSD stuff, so possibly the situation has changed, but I
couldn't find any references to indicate that was the case.)

--Mike E


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?008c01c2b5b5$4f791ac0$29330f0a>