Make .xz compressed dist targets too
build: Prepend to LDFLAGS instead of replacing its contents
[BB#112] build: fix build with autoconf >= 2.69

Use AC_CONFIG_HEADERS instead of obsolete AM_CONFIG_HEADER.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 3cc59ec3be6c9398fdb0cd7e20b626f2f423b4a7)

Conflicts:

	configure.ac
[BB#115] Drop supplementary groups

Supplementary groups are inherited from the calling process. Drop all
supplementary groups if the "Group" configuration directive is set to
change to a different user. Otherwise the process may have more rights
than expected.

Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit c8b8247f70607073af241f4aba682f09ccb3e76d)
log: remove extra newline characters in log messages.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit d652681e8a53a767843ab55a3636d77e183e53f9)
[BB#109] Fix crash (infinite loop) when writing to log file fails.

Fall back to syslog logging in that case.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 4bbd6e8626475222b0aa37dde62d12d77667accb)
sock/child: remove global variable addrlen.

This changes listen_sock() to not return the
addrlen of the used address from getaddrinfo call
to the caller, stored in global addrlen in child.c.

This was only used to be able to allocate enough space for the
arguments to the later accept call depending on whether
IPv4 or IPv6 is used.

This removes the need to pass this info by always allocating
sizeof(struct sockaddr_storage) instead, which is enough
to carry both sockaddr_in and sockaddr_in6.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 7eea1638bc881c4466367102919fe393b4ceb724)
sock: add addr argument to listen_sock()

instead of using config.ipAddr internally.
This is in preparation to make it possible
to call it for multiple addresses.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 2bd919f01e8303aa1efdf39af89132a6ab9388cb)
child: add addr argument to child_listening_sock().

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 070d6215340379cbea7cc404ff4bb450a0ddea8b)
child: use a list of listen_fds instead of one single listenfd.

This prepares listenting on multiple sockets, which will be ussed to
fix listening on the wildcard (listen on both ipv6 and ipv4) and
help add the support for multiple Listen statements in the config

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 2ebfd456eff002cfba45aa88dad4b2a0cb9edc1a)
sock: move listen() into the getaddrinfo result loop in listen_sock()

This also reverses the exit logic of the loop.
It prepares listening on multiple addresses.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit fa26ad4d566f2c3a34f1c6e7158a9268267f2582)
sock: in listen_sock(), add debug message when socket() call failed.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 5392e9829c186b5d09f135c7f379f18f0738745a)
sock: in listen_sock(), detect and log failure to call setsockopt()

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit b41d140984604e31f94e680257bfedc9893eb181)
sock: in listen_sock(), add a log message for when bind() has failed

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 947e255d191d18087059f385193e791ba651bc92)
sock: log each result of getaddrinfo() in listen_sock()

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit a7898a2c989b615142a80634fc37d433273698b9)
sock: in listen_sock(), move variable for setsockopt() into scope

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 157879d4f67c2af4495a7f0a8d145de6bac98dc2)
sock: factor listening on one socket out of the gai-result-loop in listen_sock()

for clarity of the code

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit d7f67768ebb6a9b3fe19effc8c89de5fa832d946)
sock: set IPV6_V6ONLY on the socket before binding an IPv6 address

so that we can bind wildcard for both IPv4 and IPv6.

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 0698e4d18006df53e5ca76a722e7d38bf9a227bf)
sock: update introductory comment for listen_sock()

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 22587d3d41222ba3e4ca3cd755a8662ca7ff7479)
sock: add a starting debug message to  listen_sock()

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit e40b91974aae069aef5c2d2d1e12b4618289646d)