posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

(cherry picked from commit 89e435f3559c53084498e9baad22172b64429362)

Conflicts:
	NEWS
posix_spawn_faction_addopen: Add missing string.h include directive

This is needed to avoid a PLT call on s390.

(cherry picked from commit 35a5e3e338ae17f3d42c60a708763c5d498fb840)
Mention CVE-2014-4043 in NEWS

(cherry picked from commit d03efb2f979defd473955a455d66b949961d26b2)

Conflicts:
	NEWS
Fix unbound stack use in NIS NSS module

(cherry picked from commit 315eb1d86aea489cd6325fd1c2521dcfb4fc0e1c)

Conflicts:
	NEWS
Fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

(cherry picked from commit d668061994a7486a3ba9c7d5e7882d85a2883707)

Conflicts:
	NEWS
Deduplicate resolv/nss_dns/dns-host.c

In resolv/nss_dns/dns-host.c one of code path duplicated code after
that. We merge these paths.

(cherry picked from commit ab7ac0f2cf8731fe4c3f3aea6088a7c0127b5725)
Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

Instead of trying to guess whether the second buffer needs to be freed
set a flag at the place it is allocated

(cherry picked from commit ab09bf616ad527b249aca5f2a4956fd526f0712f)
Fix invalid file descriptor reuse while sending DNS query (BZ #15946)

(cherry picked from commit f9d2d03254a58d92635a311a42253eeed5a40a47)

Conflicts:
	NEWS
Fix memory leak in regexp compiler (BZ #17069)

(cherry picked from commit 4d43ef1e7434d7d419afbcd754931cb0c794763c)

Conflicts:
	posix/Makefile
Fix another memory leak in regexp compiler (BZ #17069)

(cherry picked from commit aa6ec754f3b4b1df81d186480c534b6486a1e6ee)

Conflicts:
	NEWS
[BZ #16046] dl_iterate_phdr static executable test

(cherry picked from commit 257ce7127e2f64a6a959b146786cd43de0e42b5f)
Provide correct buffer length to netgroup queries in nscd (BZ #16695)

The buffer to query netgroup entries is allocated sufficient space for
the netgroup entries and the key to be appended at the end, but it
sends in an incorrect available length to the NSS netgroup query
functions, resulting in overflow of the buffer in some special cases.
The fix here is to factor in the key length when sending the available
buffer and buffer length to the query functions.

(cherry picked from commit c44496df2f090a56d3bf75df930592dac6bba46f)

Conflicts:
	NEWS
Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)

The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL
(with errno as ERANGE) when the supplied buffer does not have
sufficient space for the result.  This is wrong, because the canonical
way to indicate insufficient buffer is to set the errno to ERANGE and
the status to NSS_STATUS_TRYAGAIN, as is used by all other modules.

This fixes nscd behaviour when the nss_ldap module returns
NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to
fit into the supplied buffer.

(cherry picked from commit c3ec475c5dd16499aa040908e11d382c3ded9692)

Conflicts:
	NEWS
setlocale: Use the heap for the copy of the locale argument

This avoids alloca calls with potentially large arguments.

(cherry picked from commit d183645616b0533b3acee28f1a95570bffbdf50f)
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

(cherry picked from commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3)

Addiational backporting fixes:
  Added tst-setlocale3-ENV to localedata/Makefile

Conflicts:
	NEWS
	localedata/Makefile
manual: Update the locale documentation

(cherry picked from commit 585367266923156ac6fb789939a923641ba5aaf4)

Conflicts:
	manual/locale.texi
S/390: Revert the jmp_buf/ucontext_t ABI change

Backport of commit 2f438e20ab591641760e97458d5d1569942eced5
NEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal.

(cherry picked from commit 95ee7fb13ba99ba265b49531c57e1cb8db629bc6)

Typo fix as in commit 45ef66289acbab17278a73512f9b2a9d8a7ca79d and
NEW enty adjusted to reflect revert occuring in 2.19.1 and 2.20.

Conflicts:
	NEWS
__gconv_translit_find: Disable function [BZ #17187]

This functionality has never worked correctly, and the implementation
contained a security vulnerability (CVE-2014-5119).

(cherry picked from commit a1a6a401ab0a3c9f15fb7eaebbdcee24192254e8)
(cherry picked from commit f9df71e895d3552d557e783fdb9d133328195645)

Conflicts:
	NEWS
CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]

These changes are based on the fix for BZ #14134 in commit
6e230d11837f3ae7b375ea69d7905f0d18eb79e5.

(cherry picked from commit 41488498b6d9440ee66ab033808cce8323bba7ac)

Conflicts:
	NEWS
	iconvdata/Makefile