Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #392 #2239
Replacement for the withdrawn #2223
The main reason for withdrawing #2223 was I discovered there were two separate places in the xrdp_client_info structure which described the currently connected client:-
The
connection_description
field. This was originally (and confusingly) calledclient_ip
, and introduced by commit d797b2c for xrdp v0.6.0The
client_addr
andclient_port
fields introduced by commit 2536946 for xrdp v0.8.0In terms of maintainability and readability, it made sense to unify these two sets of fields into a single set of fields.
Another confusion is the presence of the 'C' argument to the session allocation policy in sesman.ini. The code for this in sesman uses the
connection_description
field. This is explored further in #2239This series of commits does the following:-
connection_description
,client_addr
andclient_port
with two unified fields in xrdp_client_info. These fields areclient_ip
andclient_description
. they are used as follows:-client_ip
contains the IP address of the client. For other connection types (e.g. AF_UNIX and AF_VSOCK) this field is empty.client_description
contains a string which describes the connected client.g_bitmask_to_charstr()
andg_charstr_to_bitmask()
are added to string_calls.c. These are intended for parsing thePolicy
string in sesman.ini in a more flexible way.This PR changes the public interface of the session allocation policy in sesman.ini. Effectively, the old 'C' policy is achieved by setting the policy to 'Separate'. This is I believe a little clearer, and I also think it is unlikely there are many users of the 'Separate' policy anyway. A use of the old 'C' flag is not honoured, but a warning is currently generated if it is discovered.