Make pam.d directory configurable

This commit is contained in:
Yifan J 2023-02-21 09:50:46 +08:00
parent 11a8823a3a
commit 8be6bc137e
5 changed files with 19 additions and 2 deletions

View File

@ -558,6 +558,12 @@ if test "x$enable_strict_locations" != "xyes"; then
localstatedir="/var";
fi
AC_ARG_WITH([pamconfdir],
[AS_HELP_STRING([--with-pamconfdir=DIR],
[Use directory for pam.d config (default: /etc/pam.d)])],
[], [with_pamconfdir="$sysconfdir/pam.d"])
AC_SUBST([pamconfdir], [$with_pamconfdir])
PKG_INSTALLDIR
AC_CHECK_HEADERS([sys/prctl.h])
@ -638,6 +644,7 @@ echo " exec_prefix $exec_prefix"
echo " libdir $libdir"
echo " bindir $bindir"
echo " sysconfdir $sysconfdir"
echo " pamconfdir $pamconfdir"
echo " localstatedir $localstatedir"
echo " runstatedir $runstatedir"
echo " socketdir $socketdir"

View File

@ -26,7 +26,7 @@ endif
endif
endif
pamddir = $(sysconfdir)/pam.d
pamddir = $(pamconfdir)
pamd_DATA = \
$(PAMFILE)

View File

@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_SOCKET_PATH=\"${socketdir}\" \
-DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \
-DSESMAN_RUNTIME_PATH=\"${sesmanruntimedir}\" \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libipm

View File

@ -5,6 +5,7 @@ AM_CPPFLAGS = \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_SOCKET_PATH=\"${socketdir}\" \
-DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \
-DXRDP_AUTHMOD_SRC=\"../${AUTHMOD_SRC}\" \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libipm \

View File

@ -204,7 +204,15 @@ get_service_name(char *service_name)
service_name[0] = 0;
if (g_file_exist("/etc/pam.d/xrdp-sesman") ||
g_file_exist(XRDP_SYSCONF_PATH "/pam.d/xrdp-sesman"))
#ifdef __LINUX_PAM__
/* /usr/lib/pam.d is hardcoded into Linux-PAM */
g_file_exist("/usr/lib/pam.d/xrdp-sesman") ||
#endif
#ifdef OPENPAM_VERSION
/* /usr/local/etc/pam.d is hardcoded into OpenPAM */
g_file_exist("/usr/local/etc/pam.d/xrdp-sesman") ||
#endif
g_file_exist(XRDP_PAMCONF_PATH "/xrdp-sesman"))
{
g_strncpy(service_name, "xrdp-sesman", 255);
}