Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Support minus character in attribute expressionsArthur de Jong2021-10-171-7/+7
| | | | | This requires the attribute name is contained within a ${var-name} expression.
* Various spelling fixesArthur de Jong2019-09-174-16/+16
|
* Mark case blocks without break statementArthur de Jong2018-02-171-1/+2
| | | | | This avoids a gcc warning in non-empty case blocks without a break statement by explicitly marking those blocks.
* Support substituting expresions of type ${var:offset:length}Giovanni Mascellani2016-06-031-0/+51
|
* Refactor out expression parsing to functionsArthur de Jong2016-05-241-68/+101
| | | | | This moves the parsing of the various ${var...} expressions to separate functions so they can be extended more easily.
* Use correct PIC arg for non-GCC compilersTim Rice2015-03-231-1/+1
|
* Fix formatting of size_t valuesPatrick McLean2015-03-141-2/+2
| | | | | | | | In several places the code used a %d format to print a size_t variable. On amd64 at least size_t is an unsigned long, so use %lu instead. An alternative would be to use %ud for size_t and %zd fo ssize_t but not all platforms seem to support that formatter.
* Clear proper buffer lengthArthur de Jong2014-06-061-2/+2
| | | | This fixes 3d29861.
* Clear buffers before free-ingArthur de Jong2014-05-171-1/+3
| | | | | This clears most buffers that may hold credentials at one point before free()ing the memory.
* Interpret transferred integers as signed againArthur de Jong2014-03-101-2/+2
| | | | | | | | This fixes an issue with unsigned values ending up in signed fields and missing sign extension. See: https://bugs.debian.org/739330
* Use djb2 hash in dict moduleArthur de Jong2013-10-141-4/+5
| | | | | | 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.
* Also support poll() returning EAGAINArthur de Jong2013-09-151-3/+3
|
* Use clock_gettime() instead of gettimeofday()Arthur de Jong2013-09-021-12/+21
| | | | | | | | | | | 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.
* Use normal timeout handling in tio_skipall()Arthur de Jong2013-08-312-14/+6
| | | | | Use the same mechanism in tio_skipall() as in tio_read(), except use a different timeout value.
* Refactor tio_wait()Arthur de Jong2013-08-311-21/+11
| | | | | This changes the function to accept a file descriptor, an event and timeout parameter directly instead of a confusing flag.
* Fix buffer overflow on interupted readArthur de Jong2013-08-311-2/+2
| | | | | | | | | | | | | 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
* Use a timeout when skipping remaining result dataArthur de Jong2013-08-302-4/+4
| | | | | | | | 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
* Fix for common spelling mistakeArthur de Jong2013-08-281-1/+1
|
* fix the description of the tio_time_remaining() functionArthur de Jong2013-03-091-2/+3
|
* update the trimming expressions code to follow the new ↵Arthur de Jong2013-03-031-44/+26
| | | | coding style
* allow trimming expressions with ${foo#bar} syntax in nslcdThorsten Glaser2013-03-031-0/+62
|
* restructure timeout calculation in tio to reduce the ↵Arthur de Jong2013-01-181-41/+30
| | | | | | number of times gettimeofday() is called git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1923 ef36b2f9-881f-0410-afb5-c4e39611909c
* log hex values when debugging the protocolArthur de Jong2013-01-051-3/+3
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1896 ef36b2f9-881f-0410-afb5-c4e39611909c
* update C coding style to a more commonly used styleArthur de Jong2012-12-2210-575/+601
| | | | 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-20/+26
| | | | | | 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
* update microseconds when setting deadline, not seconds ↵Arthur de Jong2012-12-081-1/+1
| | | | | | (thanks Julien Cristau) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1848 ef36b2f9-881f-0410-afb5-c4e39611909c
* make test even more verbose and set number of writes ↵Arthur de Jong2012-12-061-1/+1
| | | | | | back at 10000 to avoid 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
* set FD_CLOEXEC in NSS and PAM modules to ensure that ↵Arthur de Jong2012-11-111-0/+6
| | | | | | nslcd file descriptor 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
* allow attribute options in attribute mapping expressionsArthur de Jong2012-10-191-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1803 ef36b2f9-881f-0410-afb5-c4e39611909c
* use poll() instead of select() for checking file ↵Arthur de Jong2012-10-123-102/+50
| | | | | | descriptor activity to also 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
* check if the file descriptor can be stored in the ↵Arthur de Jong2012-10-121-0/+15
| | | | | | select() file descriptor set git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1781 ef36b2f9-881f-0410-afb5-c4e39611909c
* provide a compatibility definition of SUN_LEN() for ↵Arthur de Jong2012-05-091-1/+2
| | | | | | systems that lack it git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1686 ef36b2f9-881f-0410-afb5-c4e39611909c
* split the functionality to read everything from the ↵Arthur de Jong2012-04-262-12/+28
| | | | | | 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
* read any remaining available data from the stream when ↵Arthur de Jong2012-03-142-4/+35
| | | | | | 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
* ensure that we don't try to read more than SSIZE_MAX bytesArthur de Jong2012-03-141-2/+9
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1636 ef36b2f9-881f-0410-afb5-c4e39611909c
* pass the correct size of named socket address (fixes ↵Arthur de Jong2012-01-171-1/+1
| | | | | | FreeBSD issue, fixes r1295) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1596 ef36b2f9-881f-0410-afb5-c4e39611909c
* handle expressions where the expander function returns ↵Arthur de Jong2011-06-051-0/+4
| | | | | | NULL (handle it as an empty string) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1471 ef36b2f9-881f-0410-afb5-c4e39611909c
* switch variable expander function type name because _t ↵Arthur de Jong2011-05-132-7/+7
| | | | | | suffix is reserved git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1458 ef36b2f9-881f-0410-afb5-c4e39611909c
* tv_usec in struct timeval must be lower than 1000000 ↵Arthur de Jong2011-03-311-1/+1
| | | | | | (patch by SATOH Fumiyasu) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1421 ef36b2f9-881f-0410-afb5-c4e39611909c
* small code improvementsArthur de Jong2011-03-191-1/+2
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1400 ef36b2f9-881f-0410-afb5-c4e39611909c
* fix a problem in the timeout paramater that was being ↵Arthur de Jong2011-03-141-1/+1
| | | | | | passed to select() and 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
* update copyright headers to add missing yearsArthur de Jong2011-03-101-1/+1
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1384 ef36b2f9-881f-0410-afb5-c4e39611909c
* return connection reset when connection was closed by ↵Arthur de Jong2010-12-261-1/+6
| | | | | | the other end git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1344 ef36b2f9-881f-0410-afb5-c4e39611909c
* pass the actual size of the address family and the path ↵Arthur de Jong2010-11-041-1/+1
| | | | | | length to bind() and connect() for named sockets git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1295 ef36b2f9-881f-0410-afb5-c4e39611909c
* implement dict_getany() and set_pop() functions to be ↵Arthur de Jong2010-10-154-1/+35
| | | | | | able to pick and remove entries git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1279 ef36b2f9-881f-0410-afb5-c4e39611909c
* make DICTs and SETs case-sensitiveArthur de Jong2010-10-153-16/+14
| | | | git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1278 ef36b2f9-881f-0410-afb5-c4e39611909c
* also don't expand variables in rest of ${var:+rest} ↵Arthur de Jong2010-08-141-3/+12
| | | | | | expressions if var is not set or empty git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1169 ef36b2f9-881f-0410-afb5-c4e39611909c
* do not expand variables in rest of ${var:-rest} ↵Arthur de Jong2010-08-141-5/+18
| | | | | | expressions if var is not blank or empty git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1168 ef36b2f9-881f-0410-afb5-c4e39611909c
* make include guard names consistent throughout the ↵Arthur de Jong2010-06-145-15/+15
| | | | | | 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
* remove commented out memberOf and ipNetmaskNumber ↵Arthur de Jong2010-06-121-1/+0
| | | | | | attributes and small cleanups git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1138 ef36b2f9-881f-0410-afb5-c4e39611909c