forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quit client and server when starting with elevated privileges
Launching client and server with elevated privileges can cause files and folders to have inconsistent permissions and should never be necessary. Therefore, immediately quit client and server if elevated privileges are detected. On Unix, this mean the process was launched either by the "root" user itself or by using the "sudo" command on a regular user. On Windows, this means the process was launched by giving it administrative access using User Account Control (UAC). This does not include the user itself having the administrator role, as this is very common on Windows and in itself does not cause issues with permissions, as long as the user stays administrator. Add `os_has_elevated_privileges` to check for elevated privileges of the current process. Tests are also expected to not be run with elevated privileges.
- Loading branch information
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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