From 740bcfde4763e596f42f703c604efcf2e366e760 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Sun, 19 Mar 2023 03:53:01 +0900 Subject: [PATCH] xrdp: add --license option to show third party license --- xrdp/Makefile.am | 1 + xrdp/xrdp.c | 24 ++++++++++++++++++++++++ xrdp/xrdp_types.h | 1 + 3 files changed, 26 insertions(+) diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am index cae8dc91..432fdf2d 100644 --- a/xrdp/Makefile.am +++ b/xrdp/Makefile.am @@ -14,6 +14,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/libxrdp \ + -I$(top_srcdir)/third_party \ -I$(top_srcdir)/third_party/tomlc99 \ $(IMLIB2_CFLAGS) diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index f8df8057..f8f22347 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -27,6 +27,7 @@ #include "xrdp.h" #include "log.h" #include "xrdp_configure_options.h" +#include "copying_third_party.h" #include "string_calls.h" #if !defined(PACKAGE_VERSION) @@ -35,6 +36,17 @@ static struct xrdp_listen *g_listen = 0; + +/*****************************************************************************/ +static void +print_license(void) +{ + g_writeln("Third Party Code Additional Copyright Notices and License Terms"); + g_writeln("%s", ""); + g_writeln("Following third-party code are used in xrdp %s:", PACKAGE_VERSION); + g_writeln("%s", ""); + g_writeln("%s", copying_third_party); +} /*****************************************************************************/ static void print_version(void) @@ -68,6 +80,7 @@ print_help(void) g_writeln(" -f, --fork fork on new connection"); g_writeln(" -c, --config specify new path to xrdp.ini"); g_writeln(" --dump-config display config on stdout on startup"); + g_writeln(" --license show additional license information"); } /*****************************************************************************/ @@ -208,6 +221,10 @@ xrdp_process_params(int argc, char **argv, { startup_params->dump_config = 1; } + else if (nocase_matches(option, "--license", NULL)) + { + startup_params->license = 1; + } else if (nocase_matches(option, "-c", "--config", NULL)) { index++; @@ -336,6 +353,13 @@ main(int argc, char **argv) g_exit(0); } + if (startup_params.license) + { + print_license(); + g_deinit(); + g_exit(0); + } + if (xrdp_sanity_check() != 0) { g_writeln("Fatal error occurred, exiting"); diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index a1ced8c2..2e0ae478 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -679,6 +679,7 @@ struct xrdp_startup_params int version; int fork; int dump_config; + int license; int tcp_send_buffer_bytes; int tcp_recv_buffer_bytes; int tcp_nodelay;