Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss/hosts.c
Commit message (Collapse)AuthorAgeFilesLines
* Various spelling fixesArthur de Jong2019-09-171-3/+3
|
* Allow configuration of NSS and PAM namesArthur de Jong2015-01-191-9/+9
| | | | This introduces the --with-module-name configure option to allow building of NSS and PAM modules with different namespaces than ldap.
* Fix uninitialised variableMark R Bannister2015-01-191-1/+1
| | | | | This fixes a bug in the NSS library when encountering IPv6 addresses in the hosts map.
* Use right h_errnop for retrying with larger bufferNalin Dahyabhai2014-03-021-1/+1
| | | | | | | The libc nsswitch code expects h_errno to be set to NETDB_INTERNAL when it needs to try again with a larger buffer. Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
* Fix crash when retrieving large networks entriesLukas Slebodnik2014-03-021-2/+0
| | | | | | | | | | | | | If NSS_STATUS_TRYAGAIN is returned from read_one_hostent or read_one_netent then fp will be closed and function tio_skipall will be called with NULL pointer. It could happend in functions: _nss_ldap_getnetbyname_r _nss_ldap_getnetbyaddr_r _nss_ldap_gethostbyname2_r _nss_ldap_gethostbyaddr_r Fixes r548 (aka afd5d9b).
* use the AX_TLS macro to find correct thread-local ↵Arthur de Jong2013-01-181-2/+2
| | | | | | storage class compiler directive git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1921 ef36b2f9-881f-0410-afb5-c4e39611909c
* merge NSS_BYNAME and NSS_BYINT32 into NSS_BYGEN and ↵Arthur de Jong2012-12-231-12/+12
| | | | | | rename to NSS_GETONE git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1876 ef36b2f9-881f-0410-afb5-c4e39611909c
* update C coding style to a more commonly used styleArthur de Jong2012-12-221-97/+107
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c
* refactor the read_result() functions into a common macro ↵Arthur de Jong2012-10-281-37/+1
| | | | | | and move all the Solaris-specific definitions to solnss.h git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1812 ef36b2f9-881f-0410-afb5-c4e39611909c
* combine read_hostent_erronempty() and ↵Arthur de Jong2012-10-281-67/+31
| | | | | | read_hostent_nextonempty() into a read_hostent() with a retry parameter git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1811 ef36b2f9-881f-0410-afb5-c4e39611909c
* introduce ent2str() functions for each database (except ↵Arthur de Jong2012-10-261-33/+46
| | | | | | ether and netgroup) and make buffer handling consistent (for Solaris) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1808 ef36b2f9-881f-0410-afb5-c4e39611909c
* return correct error for buffer too small (Solaris)Arthur de Jong2012-10-131-1/+4
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1792 ef36b2f9-881f-0410-afb5-c4e39611909c
* clear the *ent structs before writing fields to avoid ↵Arthur de Jong2012-09-151-0/+1
| | | | | | problems with extra fields (fixes password field weirdness on Solaris 10) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1767 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix host name lookups for Solaris (tested with Solaris 10)Arthur de Jong2012-09-141-75/+52
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1766 ef36b2f9-881f-0410-afb5-c4e39611909c
* on Solaris store the errno value in NSS_ARGS(args)->erangeArthur de Jong2012-09-031-7/+7
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1747 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to a common back-end with a common constructor ↵Arthur de Jong2010-12-161-24/+17
| | | | | | and destructor and put file pointer shared between {set,get,end}ent() calls in there git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1333 ef36b2f9-881f-0410-afb5-c4e39611909c
* have a more consistent naming convention for static ↵Arthur de Jong2010-12-131-13/+13
| | | | | | lookup functions git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1331 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix assignment in if statement (was broken in r1262)Arthur de Jong2010-12-131-4/+4
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1330 ef36b2f9-881f-0410-afb5-c4e39611909c
* also try to support older Solaris releases that do not ↵Arthur de Jong2010-10-111-4/+19
| | | | | | have the returnlen member of struct nss_XbyY_args git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1262 ef36b2f9-881f-0410-afb5-c4e39611909c
* generate Solaris NSS functions using same macros that ↵Arthur de Jong2010-10-101-156/+84
| | | | | | are used for Glibc, splitting functionality to make a string representation into a single function per NSS map git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1258 ef36b2f9-881f-0410-afb5-c4e39611909c
* re-introduce {set,get,end}**ent() file handle in Solaris ↵Arthur de Jong2010-10-081-0/+2
| | | | | | code path and some other miscellaneous small fixes git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1246 ef36b2f9-881f-0410-afb5-c4e39611909c
* merge changes from trunkArthur de Jong2010-10-041-1/+2
|\ | | | | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1242 ef36b2f9-881f-0410-afb5-c4e39611909c
| * improve consistency of code layoutArthur de Jong2010-10-041-1/+2
| | | | | | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1240 ef36b2f9-881f-0410-afb5-c4e39611909c
| * merge some of the changes for Solaris portability to ↵Arthur de Jong2010-10-041-7/+7
| | | | | | | | | | | | ease merging, adding --with-pam-seclib-dir, --with-pam-ldap-soname and --with-nss-flavour options and having some auto-detection for SONAMEs and NSS flavour git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1239 ef36b2f9-881f-0410-afb5-c4e39611909c
* | try to make use of UNUSED() consistentArthur de Jong2010-10-041-8/+8
| | | | | | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1241 ef36b2f9-881f-0410-afb5-c4e39611909c
* | first attempt to split Solaris and Glibc code more and ↵Arthur de Jong2010-10-031-150/+121
| | | | | | | | | | | | determine NSS flavour in configure script git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1236 ef36b2f9-881f-0410-afb5-c4e39611909c
* | import Solaris support developed by Ted C. Cheng of ↵Arthur de Jong2010-09-301-1/+241
|/ | | | | | Symas Corporation merged against SVN head (parts remain to be cleaned up) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1232 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to using nss_status_t throughout the code and ↵Arthur de Jong2010-09-241-11/+11
| | | | | | provide compatibility code to use whatever nss_status type is used on the system git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1214 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove some unused include statementsArthur de Jong2010-06-141-1/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1139 ef36b2f9-881f-0410-afb5-c4e39611909c
* refactor protocol reading and writing macros to the ↵Arthur de Jong2009-05-211-2/+2
| | | | | | common directory, use more logical names and in the PAM module no longer use NSS status codes git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@887 ef36b2f9-881f-0410-afb5-c4e39611909c
* do not set errno (and h_errno) if we got the last entry ↵Arthur de Jong2008-02-011-8/+0
| | | | | | from get*ent() (this apparently is needed by coreutils' id and groups commands) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@601 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove the nslcd2nss() function because it's not needed ↵Arthur de Jong2008-02-011-1/+1
| | | | | | with the current protocol git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@597 ef36b2f9-881f-0410-afb5-c4e39611909c
* only start the NSLCD_ACTION_*_ALL requests with the ↵Arthur de Jong2008-01-031-7/+3
| | | | | | first call to getent() instead of with setent() to avoid unneeded requests if compat is used (except with netgroups) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@556 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement our own stdio-like library that handles IO ↵Arthur de Jong2007-06-091-8/+8
| | | | | | with a simple configurable timeout mechanism with buffering git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@272 ef36b2f9-881f-0410-afb5-c4e39611909c
* code improvements by making type casts explicit, ↵Arthur de Jong2007-03-041-6/+7
| | | | | | flagging ignored return values, renames and flagging of parameters and some miscelanious improvements (thanks to gcc warnings, splint, rats and flawfinder) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@265 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix a few bugs found thanks to the new warningsArthur de Jong2007-02-171-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@251 ef36b2f9-881f-0410-afb5-c4e39611909c
* add gcc attributes to some functions and parametersArthur de Jong2007-02-171-1/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@250 ef36b2f9-881f-0410-afb5-c4e39611909c
* ensure that all NSS functions can be generated by the ↵Arthur de Jong2007-01-171-74/+68
| | | | | | marcos in common.h and spell out the read_..() function for every type git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@227 ef36b2f9-881f-0410-afb5-c4e39611909c
* change license from GNU Library General Public License ↵Arthur de Jong2007-01-091-7/+7
| | | | | | v.2 to GNU Lesser General Public License v.2.1 with permission from Luke Howard git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@215 ef36b2f9-881f-0410-afb5-c4e39611909c
* extract some more common macrosArthur de Jong2006-12-311-8/+3
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@208 ef36b2f9-881f-0410-afb5-c4e39611909c
* only set h_errno to error value on problems and change ↵Arthur de Jong2006-12-181-7/+23
| | | | | | the returned value in some cases git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@174 ef36b2f9-881f-0410-afb5-c4e39611909c
* get rid of nslcd-client.{c,h} and move it to ↵Arthur de Jong2006-11-271-1/+0
| | | | | | nss/common.{c,h}, this ensures that all code that is needed for the nss part is in the nss directory git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@127 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix problem with allocated array for storing addresses, ↵Arthur de Jong2006-11-241-17/+23
| | | | | | properly set h_errnop and check empty address (only addresses of other address family) in nss functions, not in read_hostent() git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@114 ef36b2f9-881f-0410-afb5-c4e39611909c
* do some refactoring in the generated code and add some ↵Arthur de Jong2006-11-171-10/+9
| | | | | | documentation on generated code in comments in common.h git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@96 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to a simpler and more compact framework to ↵Arthur de Jong2006-11-161-4/+4
| | | | | | generate methods (one reader function to deserialize a struct from the stream and auto-generated functions) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@92 ef36b2f9-881f-0410-afb5-c4e39611909c
* properly filter out empty returned address records and ↵Arthur de Jong2006-11-151-9/+33
| | | | | | return NOTFOUND for entries without addresses in our address family git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@90 ef36b2f9-881f-0410-afb5-c4e39611909c
* rename nss/exports.h to nss/prototypes.hArthur de Jong2006-11-101-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@82 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to using prototypes that are defined in glibc 2.3.6Arthur de Jong2006-11-101-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@81 ef36b2f9-881f-0410-afb5-c4e39611909c
* add test code for host database and add const to ↵Arthur de Jong2006-11-101-1/+1
| | | | | | function definition git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@78 ef36b2f9-881f-0410-afb5-c4e39611909c
* use better names for our thread-local file pointerArthur de Jong2006-11-101-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@77 ef36b2f9-881f-0410-afb5-c4e39611909c