[Samba] Samba 4.1 Member Server and Winbind

Peter Ross Peter.Ross at alumni.tu-berlin.de
Thu Apr 23 18:26:33 MDT 2015


Greetings Andrey Repin!

On Fri, 24 Apr 2015, Andrey Repin wrote:

>> problem solved but part of the mystery remains:
>
>> It has to do with the root shell!!
>
> Oh? I'm no expert, but I could probably explain it.
> If you're using statically linked shell (busybox comes to mind), you are
> locked to whatever libs have been linked in at the compile time.

So far I understand. But:

# /bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), 
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.1 
(1001512), stripped
# file /bin/csh
/bin/csh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), 
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.1 
(1001512), stripped

The name is clearly nss_* (not libnss*) when I go into the sources of

lib/libc/net/nsdispatch.c

static void
nss_load_module(const char *source, nss_module_register_fn reg_fn)
{
..
    mod.name = strdup(source);
..
         if (!is_dynamic())
                 goto fin;
         else {
                 if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name,
                     NSS_MODULE_INTERFACE_VERSION) >= (int)sizeof(buf))
                         goto fin;
                 mod.handle = libc_dlopen(buf, RTLD_LOCAL|RTLD_LAZY);

Not to mention there is a kind of NOOP when I have it cached (nscd running 
- I do not have that, and there are plenty of "don't do that" remarks out 
there)

"ldconfig -r" does not show the nss_winbind.so.1

but that isn't all magic under FreeBSD's nsswitch.conf:

I found
    https://2007.asiabsdcon.org/papers/P06-paper.pdf

Nsswitch development: nss-modules and libc separation
and caching daemon extensions

by Michael Bushkov(bushman at freebsd.org)

Anyway, with /bin/sh (dynamically linked) NSS (and libc) finds the nn_* 
library while csh (dynamically) does not, an d it's not shown by "ldconfig 
-r" where it is getting it from.

Regards
Peter










More information about the samba mailing list