diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-03-27 13:10:26 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-03-29 15:35:38 +0200 |
commit | 62c3edd9575cb7dfef0d86392e4b87a4c14d8dee (patch) | |
tree | a81a324ef38fdbb62c42f25dfa6cfdaec41480c0 /conf.c | |
parent | ad7f57a5b75ae62b48e5ff4f0c302f545dea2603 (diff) | |
download | passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.gz passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.bz2 passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.lz passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.xz passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.tar.zst passt-62c3edd9575cb7dfef0d86392e4b87a4c14d8dee.zip |
treewide: Fix android-cloexec-* clang-tidy warnings, re-enable checks
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -285,7 +285,7 @@ static void get_dns(struct ctx *c) if (dns_set && dnss_set) return; - if ((fd = open("/etc/resolv.conf", O_RDONLY)) < 0) + if ((fd = open("/etc/resolv.conf", O_RDONLY | O_CLOEXEC)) < 0) goto out; while (!(*buf = 0) && line_read(buf, BUFSIZ, fd)) { @@ -406,13 +406,17 @@ static int conf_ns_opt(struct ctx *c, continue; } + /* Don't pass O_CLOEXEC here: ns_enter() needs those files */ if (!c->netns_only) { if (*conf_userns) + /* NOLINTNEXTLINE(android-cloexec-open) */ ufd = open(conf_userns, O_RDONLY); else if (*userns) + /* NOLINTNEXTLINE(android-cloexec-open) */ ufd = open(userns, O_RDONLY); } + /* NOLINTNEXTLINE(android-cloexec-open) */ nfd = open(netns, O_RDONLY); if (nfd == -1 || (ufd == -1 && !c->netns_only)) { |