Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss/common.h
Commit message (Collapse)AuthorAgeFilesLines
* Various spelling fixesArthur de Jong2019-09-171-2/+2
|
* Also support platforms without TLSArthur de Jong2015-03-221-0/+7
| | | | | | | This disables the use of thread-local storage in the NSS module when it is not available in libc. This results in the get*ent() functions not being thread-safe. However, on most platforms they are not expected to be thread-safe anyway.
* Allow configuration of NSS and PAM namesArthur de Jong2015-01-191-2/+2
| | | | This introduces the --with-module-name configure option to allow building of NSS and PAM modules with different namespaces than ldap.
* Use a timeout when skipping remaining result dataArthur de Jong2013-08-301-3/+7
| | | | | | | | When the NSS modules closes the connection and skips any remaining result data, wait for up to 500 msec to read any available data. See: https://bugzilla.redhat.com/show_bug.cgi?id=1003011
* NSS: Return TRYAGAIN on zero-length bufferJakub Hrozek2013-03-191-1/+6
| | | | | | One of our customers was running into a situation where glibc provided a zero buffer, which is a condition that is retriable and the nss module should return NSS_STATUS_TRYAGAIN not NSS_STATUS_UNAVAIL.
* merge NSS_BYNAME and NSS_BYINT32 into NSS_BYGEN and ↵Arthur de Jong2012-12-231-11/+1
| | | | | | 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-91/+91
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch protocol from host byte order to network byte ↵Arthur de Jong2012-12-161-5/+0
| | | | | | order and switch use of uid_t and gid_t in the protocol to int32 git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1864 ef36b2f9-881f-0410-afb5-c4e39611909c
* refactor the read_result() functions into a common macro ↵Arthur de Jong2012-10-281-43/+4
| | | | | | 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
* on Solaris initialise the output valuesArthur de Jong2012-10-131-2/+15
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1790 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix code indentationArthur de Jong2012-10-131-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1789 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix indenting of codeArthur de Jong2012-09-031-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1748 ef36b2f9-881f-0410-afb5-c4e39611909c
* split the functionality to read everything from the ↵Arthur de Jong2012-04-261-2/+2
| | | | | | stream into a separate function and don't assume we use non-blocking IO (fix r1637) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1659 ef36b2f9-881f-0410-afb5-c4e39611909c
* put both tio_skip() and tio_close() within if (fixes ↵Arthur de Jong2012-03-161-1/+5
| | | | | | r1637) and clarify documentation of one part of the code git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1638 ef36b2f9-881f-0410-afb5-c4e39611909c
* read any remaining available data from the stream when ↵Arthur de Jong2012-03-141-2/+4
| | | | | | closing the connection in a normal way to prevent Broken pipe messages in nslcd git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1637 ef36b2f9-881f-0410-afb5-c4e39611909c
* small code improvementsArthur de Jong2011-03-191-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1400 ef36b2f9-881f-0410-afb5-c4e39611909c
* move LDAP_BE() definitionArthur de Jong2010-12-171-3/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1335 ef36b2f9-881f-0410-afb5-c4e39611909c
* remove debugging left-oversArthur de Jong2010-12-161-3/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1334 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to a common back-end with a common constructor ↵Arthur de Jong2010-12-161-0/+20
| | | | | | 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
* remove redundant backslashArthur de Jong2010-10-281-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1289 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch to using SETs to follow the netgroupsArthur de Jong2010-10-151-12/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1281 ef36b2f9-881f-0410-afb5-c4e39611909c
* generate Solaris NSS functions using same macros that ↵Arthur de Jong2010-10-101-37/+59
| | | | | | 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
* first attempt to split Solaris and Glibc code more and ↵Arthur de Jong2010-10-031-18/+15
| | | | | | 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-0/+14
| | | | | | 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-2/+2
| | | | | | 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
* have more compatibility code for NSS module and move ↵Arthur de Jong2010-06-171-1/+1
| | | | | | compatibility code to compat directory git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1146 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement a global symbol inside the NSS module to allow ↵Arthur de Jong2010-06-141-1/+9
| | | | | | applications to disable NSS lookups over LDAP and use it in nslcd to avoid deadlocks git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1141 ef36b2f9-881f-0410-afb5-c4e39611909c
* make include guard names consistent throughout the ↵Arthur de Jong2010-06-141-3/+3
| | | | | | source and avoid conflicts with system headers git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1140 ef36b2f9-881f-0410-afb5-c4e39611909c
* don't pass an empty parameter to a macroArthur de Jong2009-10-081-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1002 ef36b2f9-881f-0410-afb5-c4e39611909c
* refactor protocol reading and writing macros to the ↵Arthur de Jong2009-05-211-64/+11
| | | | | | 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
* merge r885 from trunkArthur de Jong2009-05-161-5/+12
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@886 ef36b2f9-881f-0410-afb5-c4e39611909c
* merge r882 from trunkArthur de Jong2009-05-091-6/+25
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@883 ef36b2f9-881f-0410-afb5-c4e39611909c
* merge r834 from trunkArthur de Jong2009-04-191-2/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@836 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix comment of return value of NSS_STATUS_TRYAGAINArthur de Jong2008-05-011-4/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@714 ef36b2f9-881f-0410-afb5-c4e39611909c
* do not set errno (and h_errno) if we got the last entry ↵Arthur de Jong2008-02-011-1/+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-5/+1
| | | | | | with the current protocol git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@597 ef36b2f9-881f-0410-afb5-c4e39611909c
* fail with a permanent error if resetting the stream ↵Arthur de Jong2008-02-011-0/+3
| | | | | | failed to prevent indefinite retries git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@596 ef36b2f9-881f-0410-afb5-c4e39611909c
* only start the NSLCD_ACTION_*_ALL requests with the ↵Arthur de Jong2008-01-031-15/+11
| | | | | | 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
* use the new tio_mark()/tio_reset() functions to support ↵Arthur de Jong2008-01-011-7/+16
| | | | | | retries of the getent() functions when NSS_STATUS_TRYAGAIN would be returned git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@548 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement our own stdio-like library that handles IO ↵Arthur de Jong2007-06-091-11/+12
| | | | | | 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-13/+12
| | | | | | 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
* add gcc attributes to some functions and parametersArthur de Jong2007-02-171-2/+5
| | | | 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-4/+4
| | | | | | 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
* remove trailing spacesArthur de Jong2006-12-171-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@172 ef36b2f9-881f-0410-afb5-c4e39611909c
* get rid of nslcd-client.{c,h} and move it to ↵Arthur de Jong2006-11-271-0/+39
| | | | | | 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 bug: the readfn() function was executed twiceArthur de Jong2006-11-191-1/+0
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@100 ef36b2f9-881f-0410-afb5-c4e39611909c
* do some refactoring in the generated code and add some ↵Arthur de Jong2006-11-171-17/+55
| | | | | | 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-3/+37
| | | | | | 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
* just close the stream in case of problems instead of ↵Arthur de Jong2006-11-141-1/+1
| | | | | | calling endent() git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@87 ef36b2f9-881f-0410-afb5-c4e39611909c