2 from waflib
import Utils
6 bld
.SAMBA_BINARY('nsstest',
12 if bld
.CONFIG_SET('HAVE_PTHREAD'):
13 bld
.SAMBA_BINARY('stress-nss-libwbclient',
14 source
='stress-nss-libwbclient.c',
15 deps
='wbclient pthread',
18 bld
.SAMBA_BINARY('b15464-testcase',
19 source
='b15464-testcase.c',
20 deps
='replace pthread dl',
24 # The nss_wrapper code relies strictly on the linux implementation and
25 # name, so compile but do not install a copy under this name.
26 bld
.SAMBA_PLUGIN('nss_wrapper_winbind',
27 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
28 source
='winbind_nss_linux.c',
30 realname
='libnss_wrapper_winbind.so.2',
34 # FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
35 # the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
37 if (Utils
.unversioned_sys_platform() == 'linux' or (host_os
.rfind('gnu') > -1)):
38 bld
.SAMBA_PLUGIN('nss_winbind',
39 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
40 source
='winbind_nss_linux.c',
42 realname
='libnss_winbind.so.2',
43 soname
='libnss_winbind.so.2',
46 bld
.SAMBA3_PLUGIN('nss_wins',
47 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
49 deps
='wbclient replace',
50 realname
='libnss_wins.so.2',
51 soname
='libnss_wins.so.2',
53 elif (host_os
.rfind('freebsd') > -1):
54 # FreeBSD winbind client is implemented as a wrapper around
56 bld
.SAMBA_PLUGIN('nss_winbind',
57 source
='winbind_nss_linux.c winbind_nss_freebsd.c',
59 realname
='nss_winbind.so.1',
62 bld
.SAMBA3_PLUGIN('nss_wins',
63 source
='wins.c wins_freebsd.c',
65 realname
='nss_wins.so.1',
68 elif (host_os
.rfind('netbsd') > -1):
69 # NetBSD winbind client is implemented as a wrapper
70 # around the Linux version. It needs getpwent_r() to
71 # indicate libc's use of the correct nsdispatch API.
73 if bld
.CONFIG_SET("HAVE_GETPWENT_R"):
74 bld
.SAMBA_PLUGIN('nss_winbind',
75 source
='winbind_nss_linux.c winbind_nss_netbsd.c',
77 realname
='libnss_winbind.so')
78 elif Utils
.unversioned_sys_platform() == 'sunos':
79 bld
.SAMBA_PLUGIN('nss_winbind',
80 source
='winbind_nss_solaris.c winbind_nss_linux.c',
82 realname
='nss_winbind.so.1',
84 elif (host_os
.rfind('hpux') > -1):
85 bld
.SAMBA_PLUGIN('nss_winbind',
86 source
='winbind_nss_linux.c',
88 realname
='libnss_winbind.so')
89 elif (host_os
.rfind('aix') > -1):
90 bld
.SAMBA_PLUGIN('nss_winbind',
91 source
='winbind_nss_aix.c',
95 if bld
.CONFIG_SET('WITH_PAM_MODULES') and bld
.CONFIG_SET('HAVE_PAM_START'):
96 bld
.SAMBA_PLUGIN('pamwinbind',
97 source
='pam_winbind.c',
98 deps
='talloc wbclient tiniparser pam samba_intl',
99 cflags
='-DLOCALEDIR=\"%s/locale\"' % bld
.env
.DATADIR
,
100 realname
='pam_winbind.so',
101 install_path
='${PAMMODULESDIR}'
104 if bld
.CONFIG_GET("USING_SYSTEM_KRB5"):
105 # If we build locator plugins for a
106 # system library we should use builtin
107 # linking of our own subsystems,
108 # while we may link to the system
110 winbind_krb5_require_builtin_deps
= True
112 # If we build locator plugins for our own heimdal
113 # version we don't want to do builtin linking.
114 # As we're already using private libraries
115 # it's not a problem...
116 winbind_krb5_require_builtin_deps
= False
118 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
119 bld
.SAMBA_PLUGIN('winbind_krb5_locator',
120 source
='krb5_plugin/winbind_krb5_locator.c',
121 deps
='wbclient krb5 com_err',
122 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
123 realname
='winbind_krb5_locator.so',
124 install_path
='${MODULESDIR}/krb5')
126 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
127 # libkrb5.so scans it's plugin directories for files
128 # and calls dlopen()/dlsym() on them. The actual path
129 # depends on MIT vs. Heimdal.
131 # The async_dns_krb5_locator don't use winbind,
132 # instead it uses almost all of samba directly,
133 # which means everything will be injected
134 # into all processes using the libkrb5.so.
136 # See https://bugzilla.samba.org/show_bug.cgi?id=14780
137 # why this is a bad idea.
139 # We install this plugin (and also the other krb5 plugins)
140 # under Samba's MODULESDIR, it's not available to
141 # libkrb5.so by default.
143 # Packagers should leave it that way and allow admins
144 # to create symlinks for the plugins they actually want
146 bld
.SAMBA_PLUGIN('async_dns_krb5_locator',
147 source
='krb5_plugin/async_dns_krb5_locator.c',
159 require_builtin_deps
=False,
160 realname
='async_dns_krb5_locator.so',
161 install_path
='${MODULESDIR}/krb5')
163 if bld
.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
164 bld
.SAMBA_PLUGIN('winbind_krb5_localauth',
165 source
='krb5_plugin/winbind_krb5_localauth.c',
166 deps
='wbclient krb5 com_err',
167 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
168 realname
='winbind_krb5_localauth.so',
169 install_path
='${MODULESDIR}/krb5')
171 bld
.SAMBA_SUBSYSTEM('WB_REQTRANS',
172 source
='wb_reqtrans.c',
173 deps
='talloc tevent LIBASYNC_REQ'
176 bld
.SAMBA_BINARY('wbinfo',
178 deps
='samba-util LIBCLI_AUTH popt cmdline wbclient LIBAFS_SETTOKEN'