Re: compat mode with nss_ldap

From: Jacques A. Vidrine <nectar_at_FreeBSD.org>
Date: Thu, 24 Apr 2003 16:25:40 -0500
On Thu, Apr 24, 2003 at 01:24:13PM -0700, Gordon Tetlow wrote:
> I'm not sure if this is supposed to work, but if I try the following in
> my nsswitch.conf:
> 
> hosts: files dns
> passwd: compat
> passwd_compat: ldap
> group: compat
> group_compat: ldap
> 
> I get the following when running id <username>:
> 
> gtetlow_at_roark:~$ id <username>
> id: <username>: no such user

Ah yes, I need to define NSDB_PASSWD_COMPAT and NSDB_GROUP_COMPAT
databases in the nss_ldap module for this to work.  It is an oversight
on my part.  Try this patch and let me know how it works for you.

(I'll have to do similar with samba.)

Cheers,
-- 
Jacques A. Vidrine <nectar_at_celabo.org>          http://www.celabo.org/
NTT/Verio SME          .     FreeBSD UNIX     .       Heimdal Kerberos
jvidrine_at_verio.net     .  nectar_at_FreeBSD.org  .          nectar_at_kth.se


*** ports/net/nss_ldap/files/bsdnss.c	Thu Apr 17 09:28:01 2003
--- ports/net/nss_ldap/files/bsdnss.c	Thu Apr 24 16:23:17 2003
***************
*** 46,51 ****
--- 46,63 ----
  { NSDB_PASSWD, "endpwent",   __nss_compat_setpwent,   _nss_ldap_setpwent },
  { NSDB_PASSWD, "setpwent",   __nss_compat_endpwent,   _nss_ldap_endpwent },
  
+ { NSDB_GROUP_COMPAT, "getgrnam_r", __nss_compat_getgrnam_r, _nss_ldap_getgrnam_r },
+ { NSDB_GROUP_COMPAT, "getgrgid_r", __nss_compat_getgrgid_r, _nss_ldap_getgrgid_r },
+ { NSDB_GROUP_COMPAT, "getgrent_r", __nss_compat_getgrent_r, _nss_ldap_getgrent_r },
+ { NSDB_GROUP_COMPAT, "endgrent",   __nss_compat_setgrent,   _nss_ldap_setgrent },
+ { NSDB_GROUP_COMPAT, "setgrent",   __nss_compat_endgrent,   _nss_ldap_endgrent },
+ 
+ { NSDB_PASSWD_COMPAT, "getpwnam_r", __nss_compat_getpwnam_r, _nss_ldap_getpwnam_r },
+ { NSDB_PASSWD_COMPAT, "getpwuid_r", __nss_compat_getpwuid_r, _nss_ldap_getpwuid_r },
+ { NSDB_PASSWD_COMPAT, "getpwent_r", __nss_compat_getpwent_r, _nss_ldap_getpwent_r },
+ { NSDB_PASSWD_COMPAT, "endpwent",   __nss_compat_setpwent,   _nss_ldap_setpwent },
+ { NSDB_PASSWD_COMPAT, "setpwent",   __nss_compat_endpwent,   _nss_ldap_endpwent },
+ 
  };
  
  
Received on Thu Apr 24 2003 - 12:25:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:04 UTC