Unable to use nsswitch.conf with Busybox

Jari Takkala Jari.Takkala at Q9.com
Thu May 17 14:01:15 UTC 2007


Hello,

I am having some trouble getting Busybox to authenticate against LDAP. I do not see Busybox calling glibc's getpwnam() when I do an ltrace, and consequently I don't see /etc/nsswitch.conf being opened. I only see an open and read of /etc/passwd.

This is Busybox 1.4.0 with glibc 2.5, the relevant config options are:

CONFIG_FEATURE_SHADOWPASSWDS=y
# CONFIG_USE_BB_SHADOW is not set
# CONFIG_USE_BB_PWD_GRP is not set

I passed the LDFLAG of -lnsl to Busybox, don't know if that is required but I have confirmed that the binary is linked to libnsl. Here is an strace of a login attempt.

read(0, "testuser\n", 4096)             = 9
open("/etc/passwd", O_RDONLY)           = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=221, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dae000
read(4, "root:x:0:0:root:/root:/bin/sh\nss"..., 1024) = 221
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0xb7dae000, 4096)                = 0
time(NULL)                              = 1179339627
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({3, 0}, {3, 0})               = 0
time(NULL)                              = 1179339630
write(1, "Login incorrect\n", 16)       = 16

How can I make Busybox use nsswitch.conf and look up entries in ldap? I have openssh compiled and working with it so I do not believe this is a configuration issue with the system.

Thanks!

Jari



More information about the busybox mailing list