how to enable nss-wrapper in samba 4.3.9

Fengwei feng.wei at h3c.com
Fri Dec 16 01:31:11 UTC 2016


Hi all,
Thanks for your attetion to my question.I have another quetion about the samba.
If a user account has got through the LDAP authentication for samba,samba will use the function getpwnam() to obtain user information.The function
getpwnam() is in CNU C Library and the Name Service Switch(NSS) configuration file, /etc/nsswitch.conf is used by this function to determine the sources from which to obtain name-service information in a range of categories, and in what order. I set the /etc/nsswitch.conf file as follows:
         passwd:         compat ldap
         group:          compat ldap
         shadow:         compat ldap

         hosts:          files dns
         networks:       files

         protocols:      db files
         services:       db files
         ethers:         db files
         rpc:            db files

         netgroup:       nis
As a result, if the user account has the same name as in LDAP,samba will get the user information from the local file, /etc/passwd. How can samba get the user information from ldap but not to change the the order of the services in the passwd database? I don't want to change the contents of the /etc/nsswich.conf file because this file may have an effect on other applications.
          Thanks

-----邮件原件-----
发件人: Andreas Schneider [mailto:asn at samba.org]
发送时间: 2016年12月14日 14:47
收件人: samba-technical at lists.samba.org
抄送: shaojianxiong 13052 (RD); fengwei 11322 (RD)
主题: Re: how to enable nss-wrapper in samba 4.3.9

On Wednesday, 14 December 2016 00:46:24 CET Fengwei wrote:
> Hi all:
>          Thanks for your attention. I have a question about
> nss_wrapper library.
 I want to get user and group information from my own passwd and
> group files in samba 4.3.9. So I use the package
> 'nss_wrapper'.Firstly,I install the nss_wrapper library;Secondly, I
> use the function setenv() to set LD_PRELOAD=libnss_wrapper.so,
> NSS_WRAPPER_PASSWD = passwd and NSS_WRAPPER_GROUP=group in smbd, but
> it doesn't work. I want to ask how to enable nss-wrapper and get user
> and group information from my own passwd and group files in samba 4.3.9? Thanks.

Hi,

nss_wrapper is not really meant for production, it is a testing tool :-).
However you need to preload nss_wrapper before you start smbd. Doing it in smbd is wrong and too late.


See 'man ld.so'



        Andreas


--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org


-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!


More information about the samba-technical mailing list