1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-13 21:41:57 +00:00

miracle-dispd: set no new priviledge flag before exec encoder

Change-Id: I1b7f18a704203fc60a35b67f09936095ae6398f0
This commit is contained in:
Derek Dai 2017-05-10 14:21:32 +08:00
parent 7538d7c07f
commit 0648bb70a9

View file

@ -18,6 +18,7 @@
*/
#include <systemd/sd-event.h>
#include <systemd/sd-bus.h>
#include <sys/prctl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
@ -103,6 +104,12 @@ static void dispd_encoder_exec(const char *cmd, int fd, struct wfd_session *s)
goto error;
}
r = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
if(0 > r) {
log_vERRNO();
goto error;
}
r = execvpe(cmd,
(char *[]){ (char *) cmd, NULL },
(char *[]){ disp,