Skip to content

Commit

Permalink
Merge pull request #3368 from metalefty/sysconfsubdir
Browse files Browse the repository at this point in the history
Allow to change config file (sub)directory
  • Loading branch information
metalefty authored Dec 29, 2024
2 parents 4c8c773 + 7db81f8 commit 4e378c9
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 36 deletions.
2 changes: 1 addition & 1 deletion common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include_HEADERS = \
xrdp_sockets.h

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,12 @@ AC_ARG_WITH([pamconfdir],
[], [with_pamconfdir="$sysconfdir/pam.d"])
AC_SUBST([pamconfdir], [$with_pamconfdir])

AC_ARG_WITH([sysconfsubdir],
[AS_HELP_STRING([--with-sysconfsubdir=DIR],
[Use subdirectory for config files (default: xrdp)]))],
[], [with_sysconfsubdir="xrdp"])
AC_SUBST([sysconfsubdir], [$with_sysconfsubdir])

PKG_INSTALLDIR

AC_CHECK_HEADERS([sys/prctl.h uchar.h])
Expand Down Expand Up @@ -704,6 +710,7 @@ echo " exec_prefix $exec_prefix"
echo " libdir $libdir"
echo " bindir $bindir"
echo " sysconfdir $sysconfdir"
echo " sysconfdir+subdir $sysconfdir/$sysconfsubdir"
echo " pamconfdir $pamconfdir"
echo " localstatedir $localstatedir"
echo " runstatedir $runstatedir"
Expand Down
1 change: 1 addition & 0 deletions docs/man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SUBST_VARS = sed \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@sysconfsubdir[@]|$(sysconfsubdir)|g' \
-e 's|@socketdir[@]|$(socketdir)|g' \
-e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \
-e 's|@xrdpdatadir[@]|$(datadir)/xrdp|g' \
Expand Down
2 changes: 1 addition & 1 deletion docs/man/sesman.ini.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ All entries in the \fB[SessionVariables]\fR section are set as
environment variables in the user's session.

.SH "FILES"
@sysconfdir@/xrdp/sesman.ini
@sysconfdir@/@sysconfsubdir@/sesman.ini

.SH "SEE ALSO"
.BR xrdp-sesman (8),
Expand Down
2 changes: 1 addition & 1 deletion docs/man/xrdp-chansrv.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ X11 display number. Must be specified.

.SH FILES
.TP
.I @sysconfdir@/xrdp/sesman.ini
.I @sysconfdir@/@sysconfsubdir@/sesman.ini
Contains some settings for this program.
.TP
.I @socketdir@/xrdp_chansrv_socket_*
Expand Down
2 changes: 1 addition & 1 deletion docs/man/xrdp-genkeymap.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The key map information is stored in the file named \fIoutfile\fP.

.SH "FILES"
.TP
.I @sysconfdir@/xrdp/km-XXXXXXXX.toml
.I @sysconfdir@/@sysconfsubdir@/km-XXXXXXXX.toml
Files containing the keyboard mapping for country and language \fIXXXXXXXX\fP.
\fIXXXXXXXX\fP is a 8 digit hexadecimal number, representing the \fIinput
locale identifier\fP.
Expand Down
6 changes: 3 additions & 3 deletions docs/man/xrdp-keygen.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ xrdp\-keygen \- xrdp RSA key generation utility

.SH DESCRIPTION
\fBxrdp\-keygen\fP generates the file
.I @sysconfdir@/xrdp/rsakeys.ini
.I @sysconfdir@/@sysconfsubdir@/rsakeys.ini
which contains the RSA key pair used to perform authentication to
remote clients. The public key is self-signed.

Expand All @@ -26,14 +26,14 @@ This program takes one of the following options:
Generate a new key pair.
The key data is stored in the file named \fIoutfile\fP.
.br
If \fBauto\fP is used as \fIoutfile\fP, the default file \fI@sysconfdir@/xrdp/rsakeys.ini\fP gets created if it does not yet exists.
If \fBauto\fP is used as \fIoutfile\fP, the default file \fI@sysconfdir@/@sysconfsubdir@/rsakeys.ini\fP gets created if it does not yet exists.
.TP
.B test
Generate a test key pair and print information to standard output.

.SH FILES
.TP
.I @sysconfdir@/xrdp/rsakeys.ini
.I @sysconfdir@/@sysconfsubdir@/rsakeys.ini
RSA public and private key pair used to identify this XRDP server.

.SH SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion docs/man/xrdp-km.toml.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\fBxrdp-km.toml\fR \- \fBxrdp\fP key mapping file

.SH "DESCRIPTION"
Key mapping files are located at \fB@sysconfdir@/xrdp/km-XXXXXXXX.toml\fP
Key mapping files are located at \fB@sysconfdir@/@sysconfsubdir@/km-XXXXXXXX.toml\fP
where \fBXXXXXXXX\fP is the input locale identifier sent by the RDP client.

The key mapping files are used to translate RDP scan codes into one of
Expand Down
4 changes: 2 additions & 2 deletions docs/man/xrdp-sesman.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ to be used primarily for testing or for unusual configurations.
.P
.RS
If you use this option, be aware that you will have to have a
\fB@sysconfdir@/xrdp/sesman.ini\fR in place too, as a few elements of
\fB@sysconfdir@/@sysconfsubdir@/sesman.ini\fR in place too, as a few elements of
the system (notably \fBxrdp(8)\fR and \fBxrdp\-chansrv(8)\fR) will want
to read it.
.RE
Expand All @@ -64,7 +64,7 @@ not running \fBxrdp\-sesman\fR as a daemon.
.br
@bindir@/xrdp\-sesrun
.br
@sysconfdir@/xrdp/sesman.ini
@sysconfdir@/sysconfsubdir@/sesman.ini
.br
@localstatedir@/log/xrdp\-sesman.log
.br
Expand Down
2 changes: 1 addition & 1 deletion docs/man/xrdp-sesrun.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ first. The \fBgnome\-terminal\fR utility probably won't work here.
.br
@bindir@/xrdp\-sesrun
.br
@sysconfdir@/xrdp/sesman.ini
@sysconfdir@/@sysconfsubdir@/sesman.ini

.SH "AUTHORS"
Jay Sorg <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion docs/man/xrdp.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ to be used primarily for testing or for unusual configurations.
.SH "FILES"
@sbindir@/xrdp
.br
@sysconfdir@/xrdp/xrdp.ini
@sysconfdir@/@sysconfsubdir@/xrdp.ini
.br
@localstatedir@/log/xrdp.log
.br
Expand Down
4 changes: 2 additions & 2 deletions docs/man/xrdp.ini.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables compression of bu
.TP
\fBkey_file\fP=\fI/path/to/private_key\fP
Set location of TLS certificate and private key. They must be written in PEM format.
If not specified, defaults to \fB@sysconfdir@/xrdp/cert.pem\fP, \fB@sysconfdir@/xrdp/key.pem\fP.
If not specified, defaults to \fB@sysconfdir@/@sysconfsubdir@/cert.pem\fP, \fB@sysconfdir@/@sysconfsubdir@/key.pem\fP.

This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP.

Expand Down Expand Up @@ -440,7 +440,7 @@ password={base64}cGFzc3dvcmQhCg==
.fi

.SH "FILES"
@sysconfdir@/xrdp/xrdp.ini
@sysconfdir@/@sysconfsubdir@/xrdp.ini

.SH "SEE ALSO"
.BR xrdp (8),
Expand Down
1 change: 1 addition & 0 deletions genkeymap/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ EXTRA_DIST = \
readme.txt

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-I$(top_srcdir)/common

AM_CFLAGS = $(X_CFLAGS)
Expand Down
4 changes: 2 additions & 2 deletions genkeymap/genkeymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ usage(const char *programname, int status)
{
fprintf(stderr, "Usage: %s [ -k keycode_set] [-c comment] [-c comment...]"
" out_filename\n", programname);
fprintf(stderr, "Example: %s -r evdev -c \"en-US pc104 keyboard\""
" /etc/xrdp/km-00000409.toml\n", programname);
fprintf(stderr, "Example: %s -r evdev -c \"en-US pc104 keyboard\" ", programname);
fprintf(stderr, XRDP_CFG_PATH "/km-00000409.toml\n");
exit(status);
}

Expand Down
3 changes: 2 additions & 1 deletion instfiles/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CLEANFILES= \
SUBST_VARS = sed \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@sysconfsubdir[@]|$(sysconfsubdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g'

subst_verbose = $(subst_verbose_@AM_V@)
Expand All @@ -26,7 +27,7 @@ SUFFIXES = .in
#
# files for all platforms
#
startscriptdir=$(sysconfdir)/xrdp
startscriptdir=$(sysconfdir)/$(sysconfsubdir)

dist_startscript_DATA = \
km-00000405.toml \
Expand Down
2 changes: 1 addition & 1 deletion instfiles/pulse/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulsedir = $(sysconfdir)/xrdp/pulse
pulsedir = $(sysconfdir)/$(sysconfsubdir)/pulse
dist_pulse_DATA = default.pa
4 changes: 2 additions & 2 deletions keygen/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EXTRA_DIST = openssl.conf

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand All @@ -15,7 +15,7 @@ xrdp_keygen_SOURCES = keygen.c
xrdp_keygen_LDADD = \
$(top_builddir)/common/libcommon.la

xrdpsysconfdir = $(sysconfdir)/xrdp
xrdpsysconfdir = $(sysconfdir)/$(sysconfsubdir)

install-data-hook:
umask 077 && \
Expand Down
2 changes: 1 addition & 1 deletion keygen/keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ key_gen(const char *path_and_file_name)
static int
key_gen_auto(void)
{
return key_gen("/etc/xrdp/rsakeys.ini");
return key_gen(XRDP_CFG_PATH "/rsakeys.ini");
}

/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion libxrdp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EXTRA_DIST = \
xrdp_surface.c

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
2 changes: 1 addition & 1 deletion mc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
2 changes: 1 addition & 1 deletion neutrinordp/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
4 changes: 2 additions & 2 deletions sesman/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EXTRA_DIST = \
Doxyfile

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down Expand Up @@ -40,7 +40,7 @@ xrdp_sesman_LDADD = \
$(top_builddir)/libipm/libipm.la \
$(top_builddir)/common/libcommon.la

sesmansysconfdir=$(sysconfdir)/xrdp
sesmansysconfdir=$(sysconfdir)/$(sysconfsubdir)

SUBST_VARS = sed \
-e 's|@sesmansysconfdir[@]|$(sesmansysconfdir)|g'
Expand Down
2 changes: 1 addition & 1 deletion sesman/chansrv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EXTRA_DIST = \
wave-format-server.txt

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
2 changes: 1 addition & 1 deletion sesman/libsesman/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

AM_CPPFLAGS = \
-DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \
-I$(top_srcdir)/libipm \
-I$(top_srcdir)/common
Expand Down
2 changes: 1 addition & 1 deletion sesman/sesexec/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \
-DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \
Expand Down
2 changes: 1 addition & 1 deletion sesman/tools/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \
-I$(top_srcdir)/sesman/libsesman \
-I$(top_srcdir)/common \
Expand Down
3 changes: 2 additions & 1 deletion tools/chkpriv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ xrdp_droppriv_LDADD = \

SUBST_VARS = sed \
-e 's|@pkglibexecdir[@]|$(pkglibexecdir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g'
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@sysconfsubdir[@]|$(sysconfsubdir)|g'

subst_verbose = $(subst_verbose_@AM_V@)
subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@)
Expand Down
2 changes: 1 addition & 1 deletion tools/chkpriv/xrdp-chkpriv.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# mode

# Change these if they do not match your installation
CONF_DIR=@sysconfdir@/xrdp
CONF_DIR=@sysconfdir@/@sysconfsubdir@
XRDP_INI="$CONF_DIR"/xrdp.ini
SESMAN_INI="$CONF_DIR"/sesman.ini
RSAKEYS_INI="$CONF_DIR"/rsakeys.ini
Expand Down
2 changes: 1 addition & 1 deletion vnc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down
4 changes: 2 additions & 2 deletions xrdp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EXTRA_DIST = \
xrdpwin.c

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down Expand Up @@ -92,7 +92,7 @@ xrdp_LDADD = \
$(IMLIB2_LIBS) \
$(XRDP_EXTRA_LIBS)

xrdpsysconfdir=$(sysconfdir)/xrdp
xrdpsysconfdir=$(sysconfdir)/$(sysconfsubdir)

if MACOS
lib_extension = dylib
Expand Down
2 changes: 1 addition & 1 deletion xup/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
Expand Down

0 comments on commit 4e378c9

Please sign in to comment.