[Resubmit] Improve support for running xrdp without privileges#3602
Merged
matt335672 merged 2 commits intoneutrinolabs:develfrom Sep 1, 2025
Merged
[Resubmit] Improve support for running xrdp without privileges#3602matt335672 merged 2 commits intoneutrinolabs:develfrom
matt335672 merged 2 commits intoneutrinolabs:develfrom
Conversation
metalefty
reviewed
Sep 1, 2025
xrdp/xrdp.c
Outdated
| LOG(LOG_LEVEL_ALWAYS, | ||
| "You are running xrdp as root. This is not safe."); | ||
| rv = 0; | ||
| "You are running xrdp as uid=%d gid=%d. This is not safe.", |
Member
There was a problem hiding this comment.
BTW, not directly related to the change, but "not safe" might sound too strong. It suggests being vulnerable or insecure (like not using TLS), whereas that’s not really the case. What about using "not recommended" instead?
Member
Author
There was a problem hiding this comment.
Agreed - that sound much better.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #3599
The xrdp daemon currently starts running as root for the following reasons:-
/var/log/xrdp.logOnce these startup actions have been completed, the daemon permanently drops root privileges.
A system administrator may wish to move the xrdp log file from its default location, for example, using the LogsDirectory setting documented in systemd.exec(5). If this is done, and no special listen options are required, it makes a lot of sense to start xrdp without any special privileges.
At the moment xrdp does not anticipate this might be done, and assumes it has been started as root. This PR simply checks for that occurrence and generates corresponding log messages.