The PKG_INSTALLDIR macro also enables --with-pkgconfigdir for easy
overrides.
PKG_INSTALLDIR is relatively new, it appeared in pkg-config 0.27. To
ensure we have a recent pkg.m4 copy, copy pkg.m4 to the m4 directory.
${pcfiledir} refers to the directory of the package-config file. For an
xrdp build in the source tree, the correct include location would be
${pcfiledir}/../common, not ${pcfiledir}/common
For xrdp build outside the source tree, there is no way to find the
source tree without help from the configure script.
While the '${pc_top_builddir}/${pcfiledir}' pattern is still widespread,
many packages (e.g. gstreamer) are switching to @abs_top_srcdir@ and
@abs_top_builddir@, which are always absolute and have knowledge about
the source tree location from the configure script.
Use @abs_top_srcdir@ for the headers. @abs_top_builddir@ is not needed,
as xrdp produces no externally consumable libraries or generated
headers.
If no domain is passed, self->session->client_info->domain is an empty
string that is incorrectly treated as if the domain were passed by the
client.
The regression was introduced in fc753a95, when an incorrect check for
non-empty domain was added. That check was removed in 67119ecc based on
coverity report, leaving no trace of the original intention.
Check domain both for '_' and '\0' as the initial character. In either
case, select the first session type section in xrdp.ini.
Include string.h for strcmp(). Don't define _XOPEN_SOURCE, it conflicts
with libc headers and hides putpwent(). Make input strings constant. Fix
functions to match their declarations.
strncat() will copy at most the specified number of characters and append
the null character on top of that. strlen() doesn't count the final null
character.