| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
One some systems _SC_OPEN_MAX can be *very* large.
Closes https://github.com/arthurdejong/nss-pam-ldapd/issues/53
|
|
|
|
|
| |
This could leave file descriptor 3 open from the parent process starting
nslcd.
|
|
|
|
|
|
|
| |
This only restores the signal mask after signal handlers are in place
and the daemon has completely daemonised to avoid a race condition in
the start-up phase of nslcd where a signal could be sent to nslcd
causing it to quit or fail to write information to the parent process.
|
|
|
|
| |
FreeBSD doesn't have ENODATA so we use ENOATTR instead.
|
|
|
|
|
|
|
|
| |
This fixes a problem with a buffer that could end up padded with
garbage.
This also clarifies the code a bit and adds extra logging for errors
that could occur during daemonising.
|
|
|
|
|
| |
This also clears errno in the main function to ensure that no incorrect
errno value is logged on errors.
|
|
|
|
|
| |
This tries to avoid child processes ending up with a copy of the pipe
file descriptor that is used to signal readiness of the daemon.
|
|
This introduces a new daemonize module that provides functions for
closing all file descriptors, redirecting stdin/stdout/stderr to
/dev/null and a function for backgrounding an application while only
exiting the original process after the daemon process has indicated
readiness.
This is used to exit the original process only after the listening
socket has been set up and the worker threads have been started.
|