mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 06:06:02 -06:00
build: netfilter.c: replace system() with execv() (#7159)
This commit is contained in:
parent
f2df11ae37
commit
5b5952573f
1 changed files with 5 additions and 4 deletions
|
|
@ -66,11 +66,12 @@ void netfilter_netlock(pid_t pid) {
|
|||
env_apply_all();
|
||||
umask(orig_umask);
|
||||
|
||||
char *cmd;
|
||||
if (asprintf(&cmd, "%s -e \"%s/firejail/fnetlock --tail --log=%s\"", terminal, LIBDIR, flog) == -1)
|
||||
char fnetlock_path[] = LIBDIR "/firejail/fnetlock";
|
||||
char *log_arg;
|
||||
if (asprintf(&log_arg, "--log=%s", flog) == -1)
|
||||
errExit("asprintf");
|
||||
int rv = system(cmd);
|
||||
(void) rv;
|
||||
char *exec_args[] = { terminal, "-e", fnetlock_path, "--tail", log_arg, NULL };
|
||||
execv(terminal, exec_args);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue