From patchwork Mon Nov 30 00:52:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Murray X-Patchwork-Id: 106322 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.23237.1795999969996161488 for ; Sun, 29 Nov 2026 16:52:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=bcb2ct8G; spf=pass (domain: konsulko.com, ip: 209.85.160.174, mailfrom: scott.murray@konsulko.com) Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-55c38cdd5b7so96533931cf.2 for ; Sun, 29 Nov 2026 16:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1795999969; x=1796604769; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=1GqdQ/ROLlxtuDfINUakVo6V0I2xL1J3vajwnTt6XVA=; b=bcb2ct8GkZRIvrfssFAF6N2TGfj7793FbN8sDtqvXgCk66EkyNKVd1tSpN2RaBzSgi +BJDhKXk7zOkmNbALQrOsjFvGGO+6qpoXDOn/OMdO816nFwDUwJ23nY0wBFJj5+RW6om VZB6x5CawXQvmzs5xes6ffPj9m7CCxqWtVVHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795999969; x=1796604769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=1GqdQ/ROLlxtuDfINUakVo6V0I2xL1J3vajwnTt6XVA=; b=uOv6PbJkzznwss59vt9HCy8ZBrU4IGGvbrjscYpSxzcNFIksY9JWaSmGF5Am/oFdYl 78FfgPaaPnK4hgvmotVg87wfY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bO89 dRJm5Vx107aVTC9KBIIb812cYjkDvBGS/w5Zmo609/VugQQdmgNZKNVSgxdhgZY6CEQ== X-Received: by 2002:a05:622a:988:b0:55d:5ba6:bf25 with SMTP id d75a77b69052e-55d767ab475mr619362651cf.0.1795999968810; Sun, 29 Nov 2026 16:52:48 -0800 (PST) Return-Path: Received: from ghidorah.spiteful.org (107-179-213-3.cpe.teksavvy.com. [107.179.213.3]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921787fd72asm141946796d6.12.2026.11.29.16.52.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:52:48 -0800 (PST) From: Scott Murray To: yocto-patches@lists.yoctoproject.org Subject: [meta-lts-mixins][wrynose/rust][PATCH 10/10] ptest-cargo.bbclass: don't follow symlinks when chowning Date: Sun, 29 Nov 2026 19:52:28 -0500 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 00:52:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5597 From: Trevor Gamblin Use os.lchown() instead of shutil.chown(), as the former follows symlinks. os.lchown changes the owner of the link itself. shutil.chown() didn't add the follow_symlinks option until Python 3.13[1], so we can't just add that argument. [1]: https://docs.python.org/3/library/shutil.html#shutil.chown AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Trevor Gamblin Signed-off-by: Mathieu Dubois-Briand (adapted from oe-core commit c88df9d0ef9b1418d96fea347475c331e54d5dd0) Signed-off-by: Scott Murray --- classes-recipe/ptest-cargo.bbclass | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/classes-recipe/ptest-cargo.bbclass b/classes-recipe/ptest-cargo.bbclass index 0173a2e..340fccf 100644 --- a/classes-recipe/ptest-cargo.bbclass +++ b/classes-recipe/ptest-cargo.bbclass @@ -115,12 +115,11 @@ python do_install_ptest_cargo() { if not script_exists: os.chmod(ptest_script, 0o755) - # this is chown -R root:root ${D}${PTEST_PATH} + # Equivalent to 'chown -R root:root ${D}${PTEST_PATH}, which doesn't follow + # symlinks for root, dirs, files in os.walk(ptest_dir): - for d in dirs: - shutil.chown(os.path.join(root, d), "root", "root") - for f in files: - shutil.chown(os.path.join(root, f), "root", "root") + for name in dirs + files: + os.lchown(os.path.join(root, name), 0, 0) } do_compile_ptest_cargo[dirs] = "${B}"