From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2880148B8D for ; Fri, 28 Nov 2025 23:44:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A9DD4065D; Fri, 28 Nov 2025 23:44:40 +0100 (CET) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by mails.dpdk.org (Postfix) with ESMTP id 92A5D402F0 for ; Fri, 28 Nov 2025 23:44:33 +0100 (CET) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-88249766055so25792606d6.1 for ; Fri, 28 Nov 2025 14:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1764369873; x=1764974673; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WmT0N/n74EPEE6smaUUFOrqeqMbkWMQqkiLgpTfyWr0=; b=rQzfXn1i7+uXV4VlkfIThEQmtLKFWFcO/0xSnE4j19gbMlhPATZhXISIuro7cNKKve fqplZ9syndmpfJBcVuHkyGJfEnZ3/v2kgp3Ww9LBoLtrjHuF5MLAlHj9YyZfrHB3YpNo EUGxaN93jqoeMHGvl1UYyQ6wkAEHCib35tX/KRXU/77beB4wwsg38Wye7ty4RzHGyWpT 7HKp13zBoSvzJCTU/s+eZFNXAlitkKNb9SOxLSllOo77daQiGjvEpdUrOG10dcQLyzzl v4wU+m3wGTNbEoU/f11opy1LgMNoT2H5/RKc+SwLDKXGY+h6SQQ/vRLJ5lMCAxxtj33k dHSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764369873; x=1764974673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WmT0N/n74EPEE6smaUUFOrqeqMbkWMQqkiLgpTfyWr0=; b=WboZrd7V/9w9tgMNyWOK7PUbf8nQOZHhYpJ3fDtQntOnLBpfNKCkkc5qdPEDu6yEbQ w1M4KZikt5Y4nUItS2SXKOXneSLpRC4oDLpwEcQ+qKk55siqnERhlNqAk6bzpEbLC0yR NsPEv2wN8/pQ5DFW4gk8m5OsRkdDwgo3CV3NPRoeCvHybEC7Bpky+8xUlnsuMloNpd8O Cw079LjEe2hkNgEtP5T+JJTtt66IOhBnNO2pWza+m2jPEAeiTRQhcdhBKR46zmYBRw7d 6YcMhoGMOU//EElgwnUUpSwb42iPVWkHRUP24VxhPtBRCBBhPv+038vta3xQ+8zRyTwi FmAQ== X-Forwarded-Encrypted: i=1; AJvYcCVPBUjuzlegJKs0ANE32/I++S7wImXf1fcTSpBpsaVnokV2lMsaOhYughWy6rWvh2DomF41GAA=@dpdk.org X-Gm-Message-State: AOJu0Yy8+1juPGob7HuIVpJIO6yhDrxbzeMgWAVoNYvEda+jAHAstVoh GnsmY8x1Khc0BELTPPuOnr+F/j38YAs/RXDBscpOnmtQraEblBhoXlNYk718D5vdFR0= X-Gm-Gg: ASbGncuSk2r++wvIWYJO1DFjTYZ5TyJ+c/kVjdf+BZ5Xm7UlNHJp3vNCs0J9L7n1hxQ R85GlxxxEicUIQlZcApoU68LpoiAwnYXZWDRkusQBKnKPSUpdKe9SnX16N+b/ePwek+kznsvJG5 rEBY/r62cEJMGgfQcj2hqGWyBhmWy9Cd3+socbfqy5gxSijoiRiEcFCqSr8WW1YrvAAxCjT4tpI J6YQ9nemutwmutNdMTmTjMMujz5I12gFtHsgxLE/SGp3dWA6yHJMPz/QPtEoDwHGfT/9FOTeA2B IMOJVqvfKz2ZOFXJIMT5KxcuYoTrxEgWa6UzpBW9N/wjbfh4Z2zZEPZ7QiuJFKMCN740TE8ozY/ FJB8niwwIcjo726nc8OvWCxWgBvVfEy4RvGVSzw412o9dwppwj71fcN3temKvvvf2vREhtcRZUV jpdDRZKDgQc6rkpCiY7GCVVsfyUzsawQCGmQZwYn5dhFED1WHS5Q== X-Google-Smtp-Source: AGHT+IFypmZlVc3Rkx02DxROAQp2j/Duk5FQyPon6L3v6QkjjZ1ZdUj37DV5bbwIng4sFgQFXC/qvw== X-Received: by 2002:a05:6214:262a:b0:87c:81f:6200 with SMTP id 6a1803df08f44-8847c4c7decmr483103906d6.28.1764369872873; Fri, 28 Nov 2025 14:44:32 -0800 (PST) Received: from phoenix.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-886524e2b8asm37022216d6.16.2025.11.28.14.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Nov 2025 14:44:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Anatoly Burakov , Cristian Dumitrescu , Bruce Richardson Subject: [PATCH v8 06/10] test: fix impossible format-truncation in cfgfiles Date: Fri, 28 Nov 2025 14:42:09 -0800 Message-ID: <20251128224420.195013-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251128224420.195013-1-stephen@networkplumber.org> References: <20251110182209.104087-1-stephen@networkplumber.org> <20251128224420.195013-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Although, it is not possible on Linux (which always uses /tmp) the compiler complains about possible snprintf() truncation. Use existing code to make empty tmp file which puts the OS specific code in one spot and avoids any races if two tests are run at once. Fixes: be22019a58c4 ("test: restore cfgfile tests") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Anatoly Burakov --- app/test/test_cfgfile.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/test/test_cfgfile.c b/app/test/test_cfgfile.c index b189d9d7a5..eabf155404 100644 --- a/app/test/test_cfgfile.c +++ b/app/test/test_cfgfile.c @@ -178,12 +178,8 @@ test_cfgfile_realloc_sections(void) ret = remove(filename); TEST_ASSERT_SUCCESS(ret, "Failed to remove file"); - char tmp[PATH_MAX] = "/tmp/"; -#ifdef RTE_EXEC_ENV_WINDOWS - ret = GetTempPathA(sizeof(tmp), tmp); - TEST_ASSERT(ret > 0, "Failed to get tmp directory"); -#endif - snprintf(filename, sizeof(filename), "%s%s", tmp, "cfg_save.ini"); + ret = make_tmp_file(filename, "save", ""); + TEST_ASSERT(ret == 0, "Failed to make empty tmp filename for save"); ret = rte_cfgfile_save(cfgfile, filename); TEST_ASSERT_SUCCESS(ret, "Failed to save to %s", filename); -- 2.51.0