summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2014-12-16Get -pedanticLuke Shumaker
2014-12-15be stricter everywhere (-D_FORTIFY_SOURCE=2)Luke Shumaker
2014-12-04get strict (-Wall -Werror -Wextra), clean upLuke Shumaker
2014-12-03use NSLCD_HANDLE{,_UID}() to generate more of the codeLuke Shumaker
2014-11-29common/inotify_helpers:inotify_print_event: output C-literal syntaxLuke Shumaker
2014-11-28closer to buildingLuke Shumaker
2014-11-28buildsystemLuke Shumaker
2014-11-28cleanup inotify helpersLuke Shumaker
2014-11-28fooLuke Shumaker
2014-06-06Clear proper buffer lengthArthur de Jong
This fixes 3d29861.
2014-05-17Clear buffers before free-ingArthur de Jong
This clears most buffers that may hold credentials at one point before free()ing the memory.
2014-03-10Interpret transferred integers as signed againArthur de Jong
This fixes an issue with unsigned values ending up in signed fields and missing sign extension. See: https://bugs.debian.org/739330
2013-10-14Use djb2 hash in dict moduleArthur de Jong
This slightly modifies the string hashing function to use the djb2 hash. This hash is supposed to be reasonably fast and have reasonably few collisions.
2013-09-15Also support poll() returning EAGAINArthur de Jong
2013-09-02Use clock_gettime() instead of gettimeofday()Arthur de Jong
This avoids problems with system clock changes (though there are some safeguards in place to avoid waiting too long on clock changes). Thanks to John Sullivan for pointing this out. We can't easily use CLOCK_MONOTONIC_RAW or CLOCK_MONOTONIC_COARSE even on platforms that define the clock because we can get runtime errors. CLOCK_MONOTONIC seems to work on all tested platforms that provide it.
2013-08-31Use normal timeout handling in tio_skipall()Arthur de Jong
Use the same mechanism in tio_skipall() as in tio_read(), except use a different timeout value.
2013-08-31Refactor tio_wait()Arthur de Jong
This changes the function to accept a file descriptor, an event and timeout parameter directly instead of a confusing flag.
2013-08-31Fix buffer overflow on interupted readArthur de Jong
The tio_read() function will read past its buffer and return garbadge to the calling function if the call to read() was interrupted by a signal. The likelyhood of read() being interupted is low because previously a call to poll() has determined that data is available to be read. Thanks to John Sullivan for pointing this out. See: https://bugzilla.redhat.com/show_bug.cgi?id=1003011
2013-08-30Use a timeout when skipping remaining result dataArthur de Jong
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
2013-08-28Fix for common spelling mistakeArthur de Jong
2013-03-09fix the description of the tio_time_remaining() functionArthur de Jong
2013-03-03update the trimming expressions code to follow the new coding styleArthur de Jong
2013-03-03allow trimming expressions with ${foo#bar} syntax in nslcdThorsten Glaser
2013-01-18restructure timeout calculation in tio to reduce the number of times ↵Arthur de Jong
gettimeofday() is called git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1923 ef36b2f9-881f-0410-afb5-c4e39611909c
2013-01-05log hex values when debugging the protocolArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1896 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-12-22update C coding style to a more commonly used styleArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-12-16switch protocol from host byte order to network byte order and switch use of ↵Arthur de Jong
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
2012-12-08update microseconds when setting deadline, not seconds (thanks Julien Cristau)Arthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1848 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-12-06make test even more verbose and set number of writes back at 10000 to avoid ↵Arthur de Jong
issues with systems with large buffers git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1846 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-11-11set FD_CLOEXEC in NSS and PAM modules to ensure that nslcd file descriptor ↵Arthur de Jong
is not leaked to child processes git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1821 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-10-19allow attribute options in attribute mapping expressionsArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1803 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-10-12use poll() instead of select() for checking file descriptor activity to also ↵Arthur de Jong
correctly work if more than FD_SETSIZE files are already open git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1783 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-10-12check if the file descriptor can be stored in the select() file descriptor setArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1781 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-05-09provide a compatibility definition of SUN_LEN() for systems that lack itArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1686 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-04-26split the functionality to read everything from the stream into a separate ↵Arthur de Jong
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
2012-03-14read any remaining available data from the stream when closing the ↵Arthur de Jong
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
2012-03-14ensure that we don't try to read more than SSIZE_MAX bytesArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1636 ef36b2f9-881f-0410-afb5-c4e39611909c
2012-01-17pass the correct size of named socket address (fixes FreeBSD issue, fixes r1295)Arthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1596 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-06-05handle expressions where the expander function returns NULL (handle it as an ↵Arthur de Jong
empty string) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1471 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-05-13switch variable expander function type name because _t suffix is reservedArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1458 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-03-31tv_usec in struct timeval must be lower than 1000000 (patch by SATOH Fumiyasu)Arthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1421 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-03-19small code improvementsArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1400 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-03-14fix a problem in the timeout paramater that was being passed to select() and ↵Arthur de Jong
could contain too many µsec (fixes Solaris runtime issue) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1393 ef36b2f9-881f-0410-afb5-c4e39611909c
2011-03-10update copyright headers to add missing yearsArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1384 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-12-26return connection reset when connection was closed by the other endArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1344 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-11-04pass the actual size of the address family and the path length to bind() and ↵Arthur de Jong
connect() for named sockets git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1295 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-10-15implement dict_getany() and set_pop() functions to be able to pick and ↵Arthur de Jong
remove entries git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1279 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-10-15make DICTs and SETs case-sensitiveArthur de Jong
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1278 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-08-14also don't expand variables in rest of ${var:+rest} expressions if var is ↵Arthur de Jong
not set or empty git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1169 ef36b2f9-881f-0410-afb5-c4e39611909c
2010-08-14do not expand variables in rest of ${var:-rest} expressions if var is not ↵Arthur de Jong
blank or empty git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1168 ef36b2f9-881f-0410-afb5-c4e39611909c