From owner-freebsd-hackers Mon Jan 6 10:56:32 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFCED37B401 for ; Mon, 6 Jan 2003 10:56:30 -0800 (PST) Received: from c001.snv.cp.net (h024.c001.snv.cp.net [209.228.32.139]) by mx1.FreeBSD.org (Postfix) with SMTP id 4BDC143E4A for ; Mon, 6 Jan 2003 10:56:25 -0800 (PST) (envelope-from kutulu@kutulu.org) Received: (cpmta 23515 invoked from network); 6 Jan 2003 10:56:24 -0800 Received: from 64.212.128.3 (HELO kutulu) by smtp.register-admin.com (209.228.32.139) with SMTP; 6 Jan 2003 10:56:24 -0800 X-Sent: 6 Jan 2003 18:56:24 GMT Message-ID: <008c01c2b5b5$4f791ac0$29330f0a@lcapps.educate.com> From: "Kutulu" To: , "Wes Peters" Cc: References: <1040799271.3e095627bbce3@webmail1.isg.siue.edu> <1041722581.17746.75.camel@zaphod.softweyr.com> <1041875327.3e19c17f7c1f1@webmail1.isg.siue.edu> Subject: Re: nsswitch help for you? Date: Mon, 6 Jan 2003 13:56:23 -0500 Organization: KutuluWare Software Services MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: 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