From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202608 header.b=F43nqprn; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 9A2715A026E for ; Fri, 21 Aug 2026 07:04:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202608; t=1787288649; bh=0dnXQb5dwy+QTN5AIKtZQwN/HjIYZ1f6+sSIWYwMay4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F43nqprn233jTkA3WDbRiweA+ebT1Z1uG6Fqj3TQDyyrIggVSDZbJi9fjheiupZqK dwBZbblZP76+TW2sJuU16G0Z31psZb48HWre9pWzWBqirjrdH8ukkcSKIM6Qnkjn2H OdkXCGtCwhQJ+MmlkVCd4RpF6qKnatPZGXdTbd7Dcv0H/nONEuRFmvf3bDks43rc5/ 8kcEewBcLXPi9e73zryDUcs/O3gOcGUoOymbnLasAxHcBqjP6onhraOiszQHKs/CKl Gi8V9G5NBFb75o/t4dSJ02EgG8dJ+0SmhzqoIvYf2nZdReHCGJEYVz14506qY5Mr7I kr03ljeesSNMw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4hR7WY38l1z4wJh; Fri, 21 Aug 2026 15:04:09 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top, Laurent Vivier Subject: [PATCH 3/5] util: Add missing O_CLOEXEC for !HAS_GETRANDOM path Date: Fri, 21 Aug 2026 15:04:01 +1000 Message-ID: <20260821050403.170891-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260821050403.170891-1-david@gibson.dropbear.id.au> References: <20260821050403.170891-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: UXIHFLE5XT2R3LCU6EX5NTXWVSSZ2J3R X-Message-ID-Hash: UXIHFLE5XT2R3LCU6EX5NTXWVSSZ2J3R X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: It rarely matters, since we usually have getrandom(), but in case we don't our open() of /dev/random was missing O_CLOEXEC, which can cause clang warnings. Signed-off-by: David Gibson --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 500e8f55..df972a05 100644 --- a/util.c +++ b/util.c @@ -964,7 +964,7 @@ void raw_random(void *buf, size_t buflen) { size_t random_read = 0; #ifndef HAS_GETRANDOM - int fd = open(DEV_RANDOM, O_RDONLY); + int fd = open(DEV_RANDOM, O_RDONLY | O_CLOEXEC); if (fd < 0) die_perror("Couldn't open %s", DEV_RANDOM); -- 2.53.0