xrdp: add --license option to show third party license

This commit is contained in:
Koichiro IWAO 2023-03-19 03:53:01 +09:00
parent 68555abe74
commit 740bcfde47
3 changed files with 26 additions and 0 deletions

View File

@ -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)

View File

@ -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");

View File

@ -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;