Allow for xrdp not being able to delete PID file

If xrdp is running with dropped privileges it won't be able to delete
the PID file it's created. Places where xrdp is stopped need to cater
for this.

It's prefereable to do this than make the PID file writeable by xrdp
with dropped privileges, as this can still lead to DoS attacks if an
attacker manages to modify the PID file from a compromised xrdp
process.
This commit is contained in:
matt335672
2024-02-28 15:13:25 +00:00
parent b1d8428579
commit ce355fc235
6 changed files with 109 additions and 35 deletions
+6
View File
@@ -3538,6 +3538,12 @@ g_sigterm(int pid)
#endif
}
/*****************************************************************************/
int g_pid_is_active(int pid)
{
return (kill(pid, 0) == 0);
}
/*****************************************************************************/
/* does not work in win32 */
int
+6
View File
@@ -372,6 +372,12 @@ int g_exit(int exit_code);
int g_getpid(void);
int g_sigterm(int pid);
int g_sighup(int pid);
/*
* Is a particular PID active?
* @param pid PID to check
* Returns boolean
*/
int g_pid_is_active(int pid);
int g_getuser_info_by_name(const char *username, int *uid, int *gid,
char **shell, char **dir, char **gecos);
int g_getuser_info_by_uid(int uid, char **username, int *gid,