aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/profile.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-01-16 20:44:06 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2018-01-16 20:44:06 -0500
commit3cab64296a5e0739552f1d959c5efc7fd49cc1d5 (patch)
tree6eb0961cd038780ccd7d2cc630b9408e6855b09f /src/firejail/profile.c
parentadded support for IPv6 DNS configuration - #1722 (diff)
downloadfirejail-3cab64296a5e0739552f1d959c5efc7fd49cc1d5.tar.gz
firejail-3cab64296a5e0739552f1d959c5efc7fd49cc1d5.tar.zst
firejail-3cab64296a5e0739552f1d959c5efc7fd49cc1d5.zip
add check for ipv6 address syntax
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r--src/firejail/profile.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index c14f2b1f3..d0c43d13e 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -502,18 +502,20 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
502 fprintf(stderr, "Error: no network device configured\n"); 502 fprintf(stderr, "Error: no network device configured\n");
503 exit(1); 503 exit(1);
504 } 504 }
505 if (br->arg_ip_none || br->ip6sandbox) { 505 if (br->ip6sandbox) {
506 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n"); 506 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n");
507 exit(1); 507 exit(1);
508 } 508 }
509 509
510 // configure this IP address for the last bridge defined 510 // configure this IP address for the last bridge defined
511 // todo: verify ipv6 syntax 511 if (check_ip46_address(ptr + 4) == 0) {
512 br->ip6sandbox = ptr + 4; 512 fprintf(stderr, "Error: invalid IPv6 address\n");
513// if (atoip(argv[i] + 5, &br->ipsandbox)) { 513 exit(1);
514// fprintf(stderr, "Error: invalid IP address\n"); 514 }
515// exit(1); 515
516// } 516 br->ip6sandbox = strdup(ptr + 4);
517 if (br->ip6sandbox == NULL)
518 errExit("strdup");
517 519
518 } 520 }
519 else 521 else