From 20809c7d742e0565ea1e120ee105c29cb537d691 Mon Sep 17 00:00:00 2001 From: glitsj16 Date: Wed, 15 Mar 2023 09:50:21 +0000 Subject: [PATCH 1/2] fs_etc.c: conditionally create /etc/resolv.conf --- src/firejail/fs_etc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c index 3b7369ea811..fdbbd63ff01 100644 --- a/src/firejail/fs_etc.c +++ b/src/firejail/fs_etc.c @@ -111,6 +111,10 @@ char *fs_etc_build(char *str) { } void fs_resolvconf(void) { + if (arg_nonetwork) + if (arg_debug) + printf("arg_nonetwork found (--net=none). Skip creating /etc/resolv.conf file\n"); + return; if (arg_debug) printf("Creating a new /etc/resolv.conf file\n"); FILE *fp = fopen(RUN_RESOLVCONF_FILE, "wxe"); From 9059b5ed6089a13973d36375278c51fb521c1d59 Mon Sep 17 00:00:00 2001 From: glitsj16 Date: Wed, 15 Mar 2023 10:12:03 +0000 Subject: [PATCH 2/2] fs_etc.c: fix misleading indentation --- src/firejail/fs_etc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c index fdbbd63ff01..dc4e5c2282b 100644 --- a/src/firejail/fs_etc.c +++ b/src/firejail/fs_etc.c @@ -111,10 +111,11 @@ char *fs_etc_build(char *str) { } void fs_resolvconf(void) { - if (arg_nonetwork) + if (arg_nonetwork) { if (arg_debug) printf("arg_nonetwork found (--net=none). Skip creating /etc/resolv.conf file\n"); return; + } if (arg_debug) printf("Creating a new /etc/resolv.conf file\n"); FILE *fp = fopen(RUN_RESOLVCONF_FILE, "wxe");