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 0E85948B5B for ; Thu, 20 Nov 2025 17:57:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EC6140657; Thu, 20 Nov 2025 17:57:28 +0100 (CET) Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) by mails.dpdk.org (Postfix) with ESMTP id 1EC1C402D3 for ; Thu, 20 Nov 2025 17:57:25 +0100 (CET) Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-11beb0a7bd6so1807464c88.1 for ; Thu, 20 Nov 2025 08:57:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1763657844; x=1764262644; 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=MGt4iTzAzvLgTyNWL9GwdWyS4jCaPVnMgsiGmIX723c=; b=TzWWez6AYYn48CbhqFxBSjgMlnkqgDnKIssTqKwkvKe6HEKK7dRkQCieO3f5xLqqeM 3u1sbOXCzpsjypXPo648ofYPB/PBhZZVCUnJPRQxv3S1h0/lFD+V+7bLaqEVmHXbi2rU 4WdGccF84456kNhCbBqz5qofE/4Si5uUZHYPe5t1BzpGOM3VCvgFmgS4AmmUrMYmqun5 dlXWKOHjpGMatN2ebLRPXDAoPBWBpBBT6RKyRDj7U9yY3rDe/dksiOvcxJkFJBU3g9nB A9QvI1bHsN9VSt2Yb4Z8t7yj9DTaZMpG9HoHDQzOk595a1iZIVfB3IoOMarq/Z7xRkip IogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763657844; x=1764262644; 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=MGt4iTzAzvLgTyNWL9GwdWyS4jCaPVnMgsiGmIX723c=; b=CUophkmVhkv4htImDUHZ6p2FJ/+rZjrv5z2rwuye7MfstjmLHoeXFt2wJWPlJwZyqL 9vUu4Iq0Y1DtHzygdiYsyhBWo3U/NKYUx9YWd4TChl283m1+dZ7IryouesgJZ3sGH9ss P0HB3Gi+jTNvK31dN88fbdvzRa3NTZXUVIp3F1/aqN7yzweLYYKg0Ab/VqnJCwgRnRH3 3vUftStOiemmJ9+KkzHFwKpr1KFqdciWfUJG02OysW3qUYuQKELxyklC4bq0UOoC8oYK x9zb+2iSORbKpCQq9eC0c0Vs3wxnUyYvzDKPLGeDJqOG5s4hPbrg7tB59mfB101nwZ2u PfgA== X-Forwarded-Encrypted: i=1; AJvYcCUiWml30OZpHcj+Th4HHJrwbrPWMyddjwXS3gNq1fkm6Lc0zVRJJbv/VxuJMT+YHuFtRTcuZQs=@dpdk.org X-Gm-Message-State: AOJu0YwIlUWMl7Nmb7HZMIAC0LErEkMC5Rwt8qjpXp8Yqpx/+cZhVZzU +7OWJto3A8u0ucR9NBitE4Ea8I6uLpWHxK0by22CaIaPphVhBEcvPiXoOoQFbMjAjvs= X-Gm-Gg: ASbGncuHnTrmdgYFfJolY+MI84IjJ4j1W0P1fCpwWo23bM1Jmbh2V8gxQ09NPlYiT+I p7Fmp5johXI5hqGwohwPkxK8JpNeyqJoTHEvtsM0uqrDfVU9Ur/9LoCpJ5Pe1mrsJAV6xMKyMWJ BtbBNJwAuD0+SAqnGw94Vzx+mjXdK7J0PiWVtET56F2yANo1r9P/BHDmtE63iAA3Jke8GE87OfC 64QQ6Oaz6fS62lNneTpn520hk9h5ibRKbtBvL2KGi7b1vT5mK/AeG7hGuONEHvpa70lz1V+YyLp uk64/FgnYvkzIiBJ1yXBCZJrIvKvJb+ZArohLRrF04f8xOeQelo2pnote71EB30zdYVmkrKOCqM 6Es20/42pwGOSOHrs2SHwEFvoQP4a/LytYtCv18GmwGuVic79eXTMS3cifJrXuGo85Z1QiRJ36X VhPSCaR52ku+YaPuCK+NnSzZhCmjH2No3ccxuI4B8P7Z8fMtHTNQ== X-Google-Smtp-Source: AGHT+IFLqrxukGR1yaKmNj8vK2q1V6Wu0BI7+D4UmXUnYmsmSjQR6mVprd6vGturlzHoJ/l2fHTE1A== X-Received: by 2002:a05:7022:522:b0:119:e569:f86c with SMTP id a92af1059eb24-11c94b10d94mr994668c88.9.1763657844082; Thu, 20 Nov 2025 08:57:24 -0800 (PST) Received: from phoenix.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11c93e55af3sm11536747c88.7.2025.11.20.08.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 08:57:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Cristian Dumitrescu , Bruce Richardson Subject: [PATCH v4 6/8] test: fix impossible format-truncation in cfgfiles Date: Thu, 20 Nov 2025 08:55:34 -0800 Message-ID: <20251120165713.120238-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251120165713.120238-1-stephen@networkplumber.org> References: <0251115193409.99740-1-stephen@networkplumber.org> <20251120165713.120238-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 --- 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