IPA: Fix SELinux mapping order memory hierarchy

https://fedorahosted.org/sssd/ticket/2300

The list of SELinux mapping orders was allocated on tmp_ctx and parsed
into an array. The array itself was correctly allocated on mem_ctx but
its contents remained on tmp_ctx, leading to a use-after-free error.
This patch fixes the memory hierarchy so that both the array and its
contents are allocated on mem_ctx.
cmocka-unit-test-for-functions-getpwuid*-added

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Remove --with-distro-version

Remove support for "--with-distro-version" configure option as unused.

The option was added in August 2011 (d3da1c1). As of now nothing seems
to use it. Packaging checked: rpm, deb, pacman, ebuilds, FreeBSD ports.

Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
IFP: Fix a typo in the Makefile
IFP: Re-add the InfoPipe server

Related:
https://fedorahosted.org/sssd/ticket/2072

This commit only adds the responder and the needed plumbing. No DBus
related code is in yet.
IFP: Connect to the system bus

Related:
https://fedorahosted.org/sssd/ticket/2072

Adds the possibility for the InfoPipe responder to connect to the system bus.
At the moment, only a dummy method "Ping" is provided. The method only
accepts a single string parameter that has to be 'ping'.
AUTOFS: terminate array after the last entry

If LDAP entries have more then one attribute "automountKey"
automount map will be skipped and error message will be printed to log files
and sssd_be will crash.
    DEBUG(SSSDBG_MINOR_FAILURE, "Malformed entry, skipping\n");

The output array with automount maps will contain uninitialized pointers
because array was terminated after the expected count of entries and not
after the last successfully retrieved entry

Resolves:
https://fedorahosted.org/sssd/ticket/2288

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
IFP: do not create client socket

There is no need for client socket in IFP responder,
since it uses D-Bus for communication with clients.

Resolves:
https://fedorahosted.org/sssd/ticket/2290

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Makefile: Use alternative method to replace *bindir

https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Installation-Directory-Variables.html

Most of these variables have values that rely on prefix or exec_prefix. It is
deliberate that the directory output variables keep them unexpanded: typically
‘@sbindir@’ is replaced by ‘${exec_prefix}/sbin’, not ‘/usr/local/sbin’.
This behavior is mandated by the GNU Coding Standards.

Installation directory variables (sbindir, pkgdatadir ...) should be used
only in makefiles. Similarly, we should not rely on AC_CONFIG_FILES to replace
sbindir and friends in shell scripts and other files; instead, let make
manage their replacement.

Resolves:
https://fedorahosted.org/sssd/ticket/2293

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Possible null dereference in SELinux code

Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Remove dead code from ipa_get_selinux_recv

The 'else' branches in ipa_get_selinux_recv are never
executed (and even if they were, the result would be
the same as if the true branches were taken).

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
krb5_child: Remove unused krb5_context from set_changepw_options

Reviewed-by: Pavel Reichl <preichl@redhat.com>
Remove unused argument from resolv_gethostbyname_dns_parse

Reviewed-by: Pavel Reichl <preichl@redhat.com>
Fix warning zero-length gnu_printf format string

There is a warning if nsupdate does not support realm.
warning: zero-length gnu_printf format string [-Wformat-zero-length]

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
krb5_child: Fix use after free in debug message

debug_prg_name is used in debug_fn and it was allocated under
talloc context "kr". The variable "kr" was removed before the last debug
messages in function main. It is very little change that it will be overridden.
It is possible to see this issue with exported environment variable
TALLOC_FREE_FILL=255

Reviewed-by: Sumit Bose <sbose@redhat.com>
Implemented LDAP component of GPO-based access control
gpo smb implementation WIP
use libini_config to perform utf-8 conversion
Initialize libini_config with memory buffer (instead of file)
refactored into ad_gpo_cse_send/recv; added comments