Skip to content

Commit

Permalink
Merge branch 'neutrinolabs:devel' into xrdp_pcsc1
Browse files Browse the repository at this point in the history
  • Loading branch information
last1284 committed Sep 6, 2023
2 parents 09c966e + 98f45ba commit 0df64fb
Show file tree
Hide file tree
Showing 40 changed files with 922 additions and 147 deletions.
104 changes: 104 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: "🕷️ Bug report"
description: Report errors or unexpected behavior
labels:
- "bug"
body:
- type: input
attributes:
label: xrdp version
placeholder: 0.9.20
validations:
required: true
- type: textarea
attributes:
label: Detailed xrdp version, build options
description: Copy & paste the result of `xrdp --version`. DO NOT remove `~~~` but paste the result between two `~~~`.
value: |
~~~
PASTE HERE
~~~
- type: input
attributes:
label: Operating system & version
placeholder: "Ubuntu 22.04 / AlmaLinux 9 / FreeBSD 13.2 / etc"
description: Tell us about your operating system. See PRETTY_NAME
in /etc/os-release if you don't know.

Note we are currently unable to provide direct support for Red Hat
Enterprise Linux. Either reproduce the issue on CentOS/Alma/Rocky
OS, or contact Red Hat directly for support.
validations:
required: true
- type: dropdown
attributes:
label: Installation method
description: How was xrdp installed from?
options:
- dnf / apt / zypper / pkg / etc
- Homebrew / MacPorts
- git clone & make install
- Doesn't matter
- other
validations:
required: true
- type: input
attributes:
label: Which backend do you use?
description: Tell us about xrdp backend and version you're using. Typically, it would be either Xvnc or xorgxrdp or rarely NeutrionRDP / FreeRDP.
placeholder: Xvnc (tigervnc-1.12.0-13.el9_2)
- type: input
attributes:
label: What desktop environment do you use?
description: Tell us about your desktop (e.g. GNOME / KDE / Xfce / xterm). If you're certain the bug you about to report is not desktop specific, fill "any" here.
placeholder: GNOME
- type: input
attributes:
label: Environment xrdp running on
description: Tell us whether xrdp is running on a VM, or if on a physical machine what graphics cards are installed.
- type: input
attributes:
label: What's your client?
description: If you issue occurs with specific clients, tell us the client app name, app version client os version and platform.
placeholder: Microsoft's official client from Mac App Store, running on macOS Ventura.
- type: dropdown
attributes:
label: Area(s) with issue?
description: What things had an issue? Check all that apply.
multiple: true
options:
- Audio redirection
- Authentication
- Crashes such as segfault
- Clipboard
- Compatiblity aginst clients
- Compile error
- File transfer / drive redirection
- Graphic glitches
- Keyboard / Mouse
- Network
- Performance
- Session manager (sesman)
- Smartcard
- Other
- type: textarea
attributes:
label: Steps to reproduce
placeholder: Having detailed steps helps us reproduce the bug.
validations:
required: true
- type: textarea
attributes:
label: ✔️ Expected Behavior
placeholder: What were you expecting?
validations:
required: false
- type: textarea
attributes:
label: ❌ Actual Behavior
placeholder: What happened instead?
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: Links? References? Anything that will give us more context about the issue you are encountering! We recommend attaching `xrdp.log`, `xrdp-sesman.log`, `xrdp/xorg.conf` or screenshots to clarify context.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contact_links:
- name: Questions
about: If you are new to xrdp and want to ask community for help, raise it as Q&A in discussion.
url: https://github.com/neutrinolabs/xrdp/discussions/new?category=q-a

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
CC: gcc
# This is required to use a version of cppcheck other than that
# supplied with the operating system
CPPCHECK_VER: "2.10"
CPPCHECK_VER: "2.11"
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
steps:
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
Expand All @@ -181,7 +181,7 @@ jobs:
with:
path: ~/cppcheck.local
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh $CPPCHECK_VER
- run: ./bootstrap
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
Expand Down
145 changes: 145 additions & 0 deletions common/string_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif
#include <signal.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
Expand Down Expand Up @@ -1143,3 +1144,147 @@ g_charstr_to_bitmask(const char *str, const struct bitmask_char bitdefs[],
return bitmask;
}

/*****************************************************************************/
/*
* Looks for a simple mapping of signal number to name
*/
static const char *
find_sig_name(int signum)
{
typedef struct
{
int num;
const char *name;
} sig_to_name_type;

// Map a string 'zzz' to { SIGzzz, "zzz"} for making
// typo-free sig_to_name_type objects
# define DEFSIG(sig) { SIG ## sig, # sig }

// Entries in this array are taken from
// The Single UNIX ® Specification, Version 2 (1997)
// plus additions from specific operating systems.
//
// The SUS requires these to be positive integer constants with a
// macro definition. Note that SIGRTMIN and SIGRTMAX on Linux are
// NOT constants, so have to be handled separately.
static const sig_to_name_type sigmap[] =
{
// Names from SUS v2, in the order they are listed in that document
// that *should* be defined everywhere
//
// Commented out definitions below are NOT used everywhere
DEFSIG(ABRT), DEFSIG(ALRM), DEFSIG(FPE), DEFSIG(HUP),
DEFSIG(ILL), DEFSIG(INT), DEFSIG(KILL), DEFSIG(PIPE),
DEFSIG(QUIT), DEFSIG(SEGV), DEFSIG(TERM), DEFSIG(USR1),
DEFSIG(USR2), DEFSIG(CHLD), DEFSIG(CONT), DEFSIG(STOP),
DEFSIG(TSTP), DEFSIG(TTIN), DEFSIG(TTOU), DEFSIG(BUS),
/* DEFSIG(POLL), */ /* DEFSIG(PROF), */ DEFSIG(SYS), DEFSIG(TRAP),
DEFSIG(URG), DEFSIG(VTALRM), DEFSIG(XCPU), DEFSIG(XFSZ),

// SIGPOLL and SIGPROF are marked as obselescent in 1003.1-2017,
// Also SIGPOLL isn't in *BSD operating systems which use SIGIO
#ifdef SIGPOLL
DEFSIG(POLL),
#endif
#ifdef SIGPROF
DEFSIG(PROF),
#endif

// BSD signals (from FreeBSD/OpenBSD sys/signal.h and
// Darwin/Illumos signal.h)
#ifdef SIGEMT
DEFSIG(EMT),
#endif
#ifdef SIGIO
DEFSIG(IO),
#endif
#ifdef SIGWINCH
DEFSIG(WINCH),
#endif
#ifdef SIGINFO
DEFSIG(INFO),
#endif
#ifdef SIGTHR
DEFSIG(THR),
#endif
#ifdef SIGLIBRT
DEFSIG(LIBRT),
#endif
#ifdef SIGPWR
DEFSIG(PWR),
#endif
#ifdef SIGWAITING
DEFSIG(WAITING),
#endif
#ifdef SIGLWP
DEFSIG(LWP),
#endif

// Linux additions to *BSD (signal(7))
#ifdef SIGLOST
DEFSIG(LOST),
#endif
#ifdef SIGSTKFLT
DEFSIG(STKFLT),
#endif

// Terminator
{0, NULL}
#undef DEFSIG
};

const sig_to_name_type *p;

for (p = &sigmap[0] ; p->name != NULL ; ++p)
{
if (p->num == signum)
{
return p->name;
}
}

// These aren't constants on Linux
#ifdef SIGRTMIN
if (signum == SIGRTMIN)
{
return "RTMIN";
}
#endif
#ifdef SIGRTMAX
if (signum == SIGRTMAX)
{
return "RTMAX";
}
#endif

return NULL;
}

/*****************************************************************************/
char *
g_sig2text(int signum, char sigstr[])
{
if (signum >= 0)
{
const char *name = find_sig_name(signum);

if (name != NULL)
{
g_snprintf(sigstr, MAXSTRSIGLEN, "SIG%s", name);
return sigstr;
}

#if defined(SIGRTMIN) && defined(SIGRTMAX)
if (signum > SIGRTMIN && signum < SIGRTMAX)
{
g_snprintf(sigstr, MAXSTRSIGLEN, "SIGRTMIN+%d", signum - SIGRTMIN);
return sigstr;
}
#endif
}

// If all else fails...
g_snprintf(sigstr, MAXSTRSIGLEN, "SIG#%d", signum);
return sigstr;
}
34 changes: 34 additions & 0 deletions common/string_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ struct bitmask_char

#define BITMASK_CHAR_END_OF_LIST { 0, '\0' }

enum
{
// See g_sig2text()
// Must be able to hold "SIG#%d" for INT_MIN
//
// ((sizeof(int) * 5 + 1) / 2) provides a very slight overestimate of
// the bytes requires to store a decimal expansion of 'int':-
// sizeof INT_MAX display bytes ((sizeof(int) * 5 + 1)
// (int) needed / 2)
// ------ ------- ------------- ---------------------------
// 1 127 3 3
// 2 32767 5 5
// 3 8388607 7 8
// 4 2147483637 10 10
// 8 9*(10**18) 19 20
// 16 2*(10**38) 39 40
// 32 6*(10**76) 77 80
MAXSTRSIGLEN = (3 + 1 + 1 + ((sizeof(int) * 5 + 1) / 2) + 1)
};

/**
* Processes a format string for general info
*
Expand Down Expand Up @@ -266,6 +286,7 @@ int g_strncmp_d(const char *c1, const char *c2, const char delim, int len);
int g_strcasecmp(const char *c1, const char *c2);
int g_strncasecmp(const char *c1, const char *c2, int len);
int g_atoi(const char *str);

/**
* Extends g_atoi(), Converts decimal and hexadecimal number String to integer
*
Expand All @@ -283,4 +304,17 @@ char *g_strstr(const char *haystack, const char *needle);
int g_mbstowcs(twchar *dest, const char *src, int n);
int g_wcstombs(char *dest, const twchar *src, int n);
int g_strtrim(char *str, int trim_flags);

/**
* Maps a signal number to a string, i.e. SIGHUP -> "SIGHUP"
*
* @param signum Signal number
* @param sigstr buffer for result
* @return sigstr, for convenience
*
* Buffer is assumed to be at least MAXSTRSIGLEN
*
* The string "SIG#<num>" is returned for unrecognised signums
*/
char *g_sig2text(int signum, char sigstr[]);
#endif
2 changes: 0 additions & 2 deletions fontutils/windows/fontdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ create_window(void)
{
WNDCLASS wc;
DWORD style;
HDC dc;
int height;
int left;
int top;

Expand Down
15 changes: 11 additions & 4 deletions instfiles/pam.d/xrdp-sesman.arch
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#%PAM-1.0
auth include system-remote-login
account include system-remote-login
password include system-remote-login
session include system-remote-login
auth include system-remote-login
-auth optional pam_gnome_keyring.so
-auth optional pam_kwallet5.so

account include system-remote-login

password include system-remote-login

session include system-remote-login
-session optional pam_gnome_keyring.so auto_start
-session optional pam_kwallet5.so auto_start
11 changes: 10 additions & 1 deletion instfiles/pam.d/xrdp-sesman.debian
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#%PAM-1.0
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale
@include common-auth
-auth optional pam_gnome_keyring.so
-auth optional pam_kwallet5.so

@include common-account
@include common-session

@include common-password

@include common-session
-session optional pam_gnome_keyring.so auto_start
-session optional pam_kwallet5.so auto_start
2 changes: 2 additions & 0 deletions instfiles/xrdp.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Type=exec
EnvironmentFile=-@sysconfdir@/sysconfig/xrdp
EnvironmentFile=-@sysconfdir@/default/xrdp
ExecStart=@sbindir@/xrdp $XRDP_OPTIONS --nodaemon
SystemCallArchitectures=native
SystemCallFilter=@basic-io @file-system @io-event @ipc @network-io @process @signal ioctl madvise sysinfo uname

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion librfxcodec
Submodule librfxcodec updated 1 files
+1 −1 tests/rfxencode.c
Loading

0 comments on commit 0df64fb

Please sign in to comment.