Skip to content

Commit

Permalink
feat: replace system call with execute function in add_trusted_ip for…
Browse files Browse the repository at this point in the history
… improved security

Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Feb 1, 2025
1 parent 28105a0 commit 880912a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dns_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "dns_forward.h"
#include "debug.h"
#include "conf.h"
#include "wd_util.h"

struct dns_query {
int client_fd;
Expand Down Expand Up @@ -229,7 +230,7 @@ add_trusted_ip(t_domain_trusted *trusted_domain, uint16_t type, unsigned char *a
} else {
snprintf(cmd, sizeof(cmd), "nft add element inet fw4 set_wifidogx_inner_trust_domains_v6 { %s }", ip_str);
}
system(cmd);
execute(cmd, 0);
}
return 0;
}
Expand Down

0 comments on commit 880912a

Please sign in to comment.