Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pam.d directory configurable #2552

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion instfiles/pam.d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif
endif
endif

pamddir = $(sysconfdir)/pam.d
pamddir = $(pamconfdir)

pamd_DATA = \
$(PAMFILE)
Expand Down
1 change: 1 addition & 0 deletions sesman/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sesman/tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 9 additions & 1 deletion sesman/verify_user_pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down