From patchwork Mon Mar 25 09:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 1915472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xd9mNfLh; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=gA70w505; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V37X36m6Cz1yXy for ; Mon, 25 Mar 2024 20:52:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/k8TvBjIlaca+8GDpZYfiH2fn+rfvps+78nLYoV4Pfc=; b=xd9mNfLh09ab1A l6Z1aeBAtFgx+cDNeeV4OkYKzy09ybkth8VeFebGxtmwtFZ/5q/72gyEn3xMtpJBVhbIh3MzaI0aD gra823rpKQ4PRfJ/x3oypq0WkwvNOA06U+crcDZyYU3TJ36bDJN2Iuqo1LHBFu9hSrOzWqeRvjuvv hRUwsl4LI77ogR2BAOnXi3JQFb1npNTjV80UalVfEEIt32SieawbU4Jy6+DwSJuIXlrb0NxJ7CcXl ja7sq8KVLXKcU3SgRXyfMoXUXFBZ4sWa6jGHrZHnxdn3HxxLugtLAnyzEzJkWYyB1KaB7wKqsSO4F TSa+GkFwa19VC+IwBPZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rogzo-0000000GYuL-3EMp; Mon, 25 Mar 2024 09:52:00 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rogzj-0000000GYs0-11Gk for hostap@lists.infradead.org; Mon, 25 Mar 2024 09:51:57 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a4715991c32so484062166b.1 for ; Mon, 25 Mar 2024 02:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711360312; x=1711965112; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LTbMUmDpk2bXzLRKtw0S/Sgigsix530xoRtqVu1ymBM=; b=gA70w505YMK0gpTZvsOeZv8b0sQptmsdrgzzYKv8CyX5JYjodTWMZ0+EUzhFrymwwm IaQoCK+tQaV8jomxnqSf+n068LdFAVMt9AKI7EvqHRWaAz9BoYqQuBeEHqAxG6A6FMme dHmz5Vz6F+fVcqnkf6KYKw9O+wpOrfMf0Cl7xnI5mANXII5iGj9tfHnhPklcqmr/G2Wi Xr8AFHGtoV3w/z0bTeeGvuZ2CzDKomUhgAem6ai8ZMs4pAJDU1Es9GWqAA2fi9MLhv7L H+AyIVANAbEPOjhzqnG1keI4809PqLxPOPFz1CVUzRQ3+RdHjJcclDo0n05Kve1wKfJT dISw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711360312; x=1711965112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LTbMUmDpk2bXzLRKtw0S/Sgigsix530xoRtqVu1ymBM=; b=RzzPInr5nfn5fFERunHhRrNhDwCissmSTqPb+ohFeMBeBPA9XUtBQ7ATCsDVxGv2Ar Ihit6PpcYppCq7dMtV2XxtSYv3FDxwNiMwi6XVFon+dd5YGwZfcrDkeJ7Mqy4oWr03oV +DMQK4J/4O+vCTptk7MyjRQqRZeqRKGYM0k71ANhUUInCqjVJrAuYGrtfi2EIJG0RZFx wbRE/bgZ1qe1p3Rl7MgzbCkUsl9OZorJ6Hch7PW0S1TsrwKUNiSuvVS1W8EXi6FHnbuN zW0pytnzIdFMz66i/lkGV7mcc/OgZbrIPrSxD6U9GWfaG4KK1m0VGGO3lguJYCErRRwR N0PQ== X-Gm-Message-State: AOJu0YxTYxUvx7Usr7LRoTcq3NyAbwa9KHrN7fOoLLJGB8CTJ1KvjLcm 4YFVrli5WLdMyedaRXQJZQBF6KE1XUaoNopN0QikOePIazcpiJSxJcer+rTy X-Google-Smtp-Source: AGHT+IHGbKJDVQyq3cQ6/W/Y1ai3ywYKtdikRNpn5niQ1kAgOafJlCW/NNflBmJCr+irC3aNblDa/w== X-Received: by 2002:a17:906:3847:b0:a47:3695:dfe4 with SMTP id w7-20020a170906384700b00a473695dfe4mr4174761ejc.11.1711360311989; Mon, 25 Mar 2024 02:51:51 -0700 (PDT) Received: from fedora.. (cpe-94-253-164-166.zg.cable.xnet.hr. [94.253.164.166]) by smtp.googlemail.com with ESMTPSA id z2-20020a1709060be200b00a45f2dc6795sm2868184ejg.137.2024.03.25.02.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:51:51 -0700 (PDT) From: Robert Marko To: hostap@lists.infradead.org Cc: Robert Marko Subject: [PATCH] build: make _make_dirs robust against too long argument error Date: Mon, 25 Mar 2024 10:51:45 +0100 Message-ID: <20240325095149.194489-1-robimarko@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240325_025155_314009_A8DE83DF X-CRM114-Status: GOOD ( 10.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: _make_dirs currently can fail as _DIRS can be really long and thus go over the MAX_ARG_STRLEN limit so it will fail with: /bin/sh: Argument list too long Lets avoid this by stripping the $(BUILDDIR) prefix and then restoring it. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [robimarko(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62f listed in] [list.dnswl.org] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org _make_dirs currently can fail as _DIRS can be really long and thus go over the MAX_ARG_STRLEN limit so it will fail with: /bin/sh: Argument list too long Lets avoid this by stripping the $(BUILDDIR) prefix and then restoring it. Signed-off-by: Robert Marko --- src/build.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.rules b/src/build.rules index acda88472..497580d88 100644 --- a/src/build.rules +++ b/src/build.rules @@ -80,7 +80,7 @@ endif _DIRS := $(BUILDDIR)/$(PROJ) .PHONY: _make_dirs _make_dirs: - @mkdir -p $(_DIRS) + @printf '$(BUILDDIR)/%s ' $(patsubst $(BUILDDIR)/%,%,$(_DIRS)) | xargs mkdir -p $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs $(Q)$(CC) -c -o $@ $(CFLAGS) $<