Robin Hack
270d6f94db
nwrap: Add nwrap_add_hname() and nwrap_add_hname_alias().
...
Functions adds a hostname or an alias to the hash table.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Robin Hack
442fc3fcd2
nwrap: Add function nwrap_add_ai
...
This adds an ip to the hash table.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Robin Hack
15c14536d0
nwrap: Add a hash table to the nwrap structure
...
The hash table will hold hostnames and ips internally. The new
environment variable which is introduced is NSS_WRAPPER_MAX_HOSTENTS. It
sets the maximum count of hostent (hostnames and ips) structs which the
hash table can hold.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Robin Hack
f3da6e4905
nwrap: Simplify file loading.
...
Lines are stored into vectors now.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Robin Hack
ff65d01333
nwrap: Add nwrap vector memory management functions
...
Nwrap vectors are just more inteligent arrays.
They can look like very simple version of
vectors from C++.
TESTS: Add nwrap_vector tests.
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
6706ee4856
nwrap: Check for setspent and getspnam functions
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
22f159f45f
src: Add configure check for shadow.h
...
This is the first part to fix FreeBSD.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
088887bda9
nwrap: Add support for getspnam()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
608fa2063a
nwrap: Add (set|get|end)spent functions
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
e971a44299
nwrap: Add nss_wrapper_shadow_enabled() function
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
4be5853b4c
nwrap: Add shadow file parser
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
2a5335217e
nwrap: Remove unused struct member in nwrap_main
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
90585c46eb
nwrap: Implement nwrap_files_initgroups()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
80abc70bc9
nwrap: Remove unneeded memcpy in getgrouplist()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Andreas Schneider
a104389de2
nwrap: Avoid a string comparsion in getgrouplist()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:27 +01:00
Robin Hack
1c346a07ff
nwrap: Use ssize_t for aliases_count
...
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:26 +01:00
Robin Hack
02b5410466
nwrap: Prevent compilation failure on machine without IPv4
...
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:26 +01:00
Robin Hack
90dbe7beb8
nwrap: Replace free() calls by SAFE_FREE macro where possible.
...
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:26 +01:00
Andreas Schneider
ea741de64a
nwrap: Fix the handle loops for older gcc versions.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-01-11 12:25:26 +01:00
Andreas Schneider
c298542fe2
nwrap: Make sure addr is initialized.
...
CID #72755
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-09 12:24:03 +02:00
Andreas Schneider
2bbd403f39
nwrap: Use DNS_NAME_MAX cause it is not available on BSD.
...
Also HOST_NAME_MAX is only for the value returned by gethostname(). It
is normally limited to 64 chars on Linux.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-09 12:24:03 +02:00
Andreas Schneider
895b32b2e3
nwrap: Don't overflow the in_addr if convert IPv6.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-09 12:24:03 +02:00
Andreas Schneider
94c87d1347
nwrap: Fix resolving hostnames with a trailing dot.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-09 12:24:03 +02:00
Andreas Schneider
6979082779
nwrap: Fall back to RTLD_NEXT if we can't find libc.
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-09 12:24:03 +02:00
Volker Lendecke
159d1dde3a
nss_wrapper: Fix some "discarding const" warnings
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-21 12:42:10 +02:00
Volker Lendecke
9a936f9698
nss_wrapper: Align indentation with the rest of Samba
...
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-21 12:42:10 +02:00
Andreas Schneider
5bb410f853
lib: Change nss_wrapper to preloadable version.
...
This imports nss_wrapper version 1.0.2.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Jeremy Allison
1c714850d5
Clean up some const and other compiler warnings.
...
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
2011-05-05 00:59:40 +02:00
Volker Lendecke
b0aba17538
nss_wrapper: Fix a segfault when libnss_winbind.so is not loadable
...
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Feb 26 13:19:01 CET 2011 on sn-devel-104
2011-02-26 13:19:01 +01:00
Volker Lendecke
22d8d277c6
nss_wrapper: Make nwrap_module_init a bit more readable
2011-02-26 12:00:48 +01:00
Andreas Schneider
b46eccfb19
nss_wrapper: Fixed a possible NULL pointer problem.
2010-06-28 10:18:12 +02:00
Andrew Tridgell
4c4d0a029d
build: fixed nss_wrapper on solaris
...
solaris has different getpwnam_r syntax
2010-03-24 15:50:50 +11:00
Brad Hards
7863bb1511
Spelling fixes for nss_wrapper.
...
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:33 +01:00
Günther Deschner
7e8b3d8c06
nss_wrapper: add my copyright.
...
Guenther
2009-06-08 10:26:39 +02:00
Günther Deschner
0bf56f5cb3
nss_wrapper: rename nwrap_cache_{re,un}load as per metzes request.
...
Guenther
2009-06-06 02:00:36 +02:00
Günther Deschner
68a1ef2197
nss_wrapper: add support for loading nss_winbind.so via WINBIND_SO_PATH env.
...
Guenther
2009-06-06 01:01:25 +02:00
Günther Deschner
a845cb5ed3
nss_wrapper: fill in module nwrap_backend.
...
Guenther
2009-06-06 00:59:51 +02:00
Günther Deschner
2e78bc7b53
nss_wrapper: add missing return in nwrap_module_init().
...
Guenther
2009-06-05 23:10:58 +02:00
Günther Deschner
f3aa2a2b73
nss_wrapper: add skeleton for module nwrap_backend.
...
Guenther
2009-06-05 23:04:14 +02:00
Günther Deschner
6985f3995f
nss_wrapper: add capability to load nss modules.
...
Guenther
2009-06-05 23:04:10 +02:00
Günther Deschner
47b5a55239
nss_wrapper: add struct nwrap_backend.
...
Guenther
2009-06-05 23:01:05 +02:00
Stefan Metzmacher
c110e664af
nss_wrapper: fix segfault in nwrap_gr_copy_r()
...
metze
2009-06-05 15:52:20 +02:00
Günther Deschner
930ea7c8a8
nss_wrapper: remove getgrouplist from nwrap_ops table.
...
Guenther
2009-06-04 21:23:39 +02:00
Stefan Metzmacher
9dad0536d6
nss_wrapper: call the nwrap_files_*() from nwrap_files_*_r()
...
We should not call the public functions, as this could lead
to a recursive loop when we have multiple nwrap backends
in future.
This also fixes the build if --enable-nss-wrapper was not
given to ./configure.
metze
2009-06-04 17:18:12 +02:00
Günther Deschner
011a505800
nss_wrapper: prefix function pointer names in struct nwrap_ops.
...
Guenther
2009-06-02 14:52:53 +02:00
Günther Deschner
8684911bda
nss_wrapper: resort calls to move public calls to the end.
...
Guenther
2009-06-02 13:11:57 +02:00
Günther Deschner
81e820c1aa
nss_wrapper: add nwrap_ops function pointer table.
...
Guenther
2009-06-02 13:11:49 +02:00
Günther Deschner
9a7a97856a
nss_wrapper: make sure to return after calling real_{set,end}{gr,pw}ent.
...
Guenther
2009-06-02 13:11:42 +02:00
Günther Deschner
94f2ef4f72
nss_wrapper: fix typo while checking for getgrid_r support.
...
Metze, this has been in here for a long time, please check.
Guenther
2009-06-02 13:11:33 +02:00
Günther Deschner
241db90c31
nss_wrapper: try to fix the build of nss_wrapper on solaris.
...
Guenther
2009-05-30 23:08:12 +02:00
Günther Deschner
8db4917290
nss_wrapper: add support for getgrouplist.
...
Guenther
2009-05-30 00:06:00 +02:00
Günther Deschner
136b2a3eb2
nss_wrapper: fix nss_wrapper build for solaris.
...
Guenther
2009-05-28 11:53:51 +02:00
Günther Deschner
37e4c92b38
nss_wrapper: remove re-structuring leftovers (unused variables).
...
Guenther
2009-05-28 11:53:51 +02:00
Günther Deschner
ec9a091705
nss_wrapper: restructure nwrap calls.
...
Guenther
2009-05-28 10:32:21 +02:00
Jelmer Vernooij
94855cd692
Move common libraries from root to lib/.
2008-09-17 14:11:12 +02:00