mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-14 00:31:51 +00:00
miracle-dispd: set no new priviledge flag before exec encoder
Change-Id: I1b7f18a704203fc60a35b67f09936095ae6398f0
This commit is contained in:
parent
7538d7c07f
commit
0648bb70a9
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
#include <systemd/sd-event.h>
|
#include <systemd/sd-event.h>
|
||||||
#include <systemd/sd-bus.h>
|
#include <systemd/sd-bus.h>
|
||||||
|
#include <sys/prctl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -103,6 +104,12 @@ static void dispd_encoder_exec(const char *cmd, int fd, struct wfd_session *s)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||||
|
if(0 > r) {
|
||||||
|
log_vERRNO();
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
r = execvpe(cmd,
|
r = execvpe(cmd,
|
||||||
(char *[]){ (char *) cmd, NULL },
|
(char *[]){ (char *) cmd, NULL },
|
||||||
(char *[]){ disp,
|
(char *[]){ disp,
|
||||||
|
|
Loading…
Reference in a new issue