From patchwork Fri Jun 30 14:59:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 114755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10439286vqr; Fri, 30 Jun 2023 08:07:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqrGPHZivTUZHQATQo4Y9I/uxzb29OmJCh6Radt5JDASfwLMEJwEZ8inKzbEjLOJ3ZpApM X-Received: by 2002:a05:6a00:218a:b0:67a:a4d1:e70 with SMTP id h10-20020a056a00218a00b0067aa4d10e70mr3126951pfi.16.1688137673170; Fri, 30 Jun 2023 08:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688137673; cv=none; d=google.com; s=arc-20160816; b=1LYKparrU6iJ2y/kz5z4xvP5mq5ZbebwoobCtixiL9ERhda4nvILk7c2qOUzDusT+a hcKrZ14lxtmolVMBu9bPC+cfi+1FbUj9U8Rnc02vCEQuo6evAjT/4LDbtXCeIWC09Dd7 5GK0Iah5esu5P3v3V6BMES5s8ZtdwN0yaILCSNeVcM3FunYzJcnJ2+J6g905y/o9/ROx AySH9WCeTKEWW55Ol4Wz6IGPxTg027ochIe5omJGGdX9YNOGwS+mQ9ZTW9wewEEeTehL IYZWhs5wE/bLKCAZUAeOFLwvS5pYB/ScAcJyy5JqSJoLugcQIClMaotz8dT7bOcEJ1FL ZLFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=fJrRr9pyUEDTGlyFVwZpyU5POwBr82BEPsABjKwkv20=; fh=49fx4+cYYT2jkB1G9v6CSOY1nO+RV0JwAuF3mNCzENI=; b=M4P60YYexaXve8oZfS0aRoRbJCQRYTECIyO7eQPRxHyzqVe+EPVf5hoG/OBemNIdp6 dCRR4/fNRNDkG46jg/OApIZ6btuazUzWbWGpdwePpd5LbHBzvGR9lnY84cBmQruh+wEv Z2wTqTwMujYnMM8YZSiy0rPNZmOZC/6JQ6lMfveKzMfmKDBZ10FlDFEzFcxPJFFt+HeL kwdx38+mOMIshhDYUls/ClYe+VKU2PWOfNPnxc4X+QDXRuEdkaAYNKQh+8tOwLOORrca 3TKSphZMSo44zoAC2v+JWFPLf3W9FOZnese1lToBy7MwyDG97tLsGZrp7wuJPK4PcU1Y p8ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a636307000000b0053f0cdab81esi12816841pgb.357.2023.06.30.08.07.38; Fri, 30 Jun 2023 08:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbjF3PAD (ORCPT + 99 others); Fri, 30 Jun 2023 11:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232907AbjF3O7r (ORCPT ); Fri, 30 Jun 2023 10:59:47 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F1E43ABC; Fri, 30 Jun 2023 07:59:41 -0700 (PDT) X-QQ-mid: bizesmtp86t1688137172t6z8crq0 Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Jun 2023 22:59:30 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: OtIeQkg1QQG1RpxwZ/4Otz5Iupcb5NPjfY3VZCaKJ6SgS7D8+uWkhgDprvLoA oB0PMopiPJcqeZMc7u6JWS2IV1Y0LhcTTMpAtYxyvZ5MIBPU1hwvkIJlf1skWilaA9XZpJV Zri0mMgAF2ucLHqnxB1RtntODWj70pNmBpDq3eaZ6gKQ/p8xTGas2fRKE4Rx5NM9UkPq3OM GJLNNJT7aVT01VgwY24MuHNQR9XtqDGiwFfBT60AwBfkQQfnkoBXeTjcT4CtM12nBr2Zo1+ JvKaow3EdvCmuqBH8zLDOit155ZIgP323OcH4owv0b+GBs0RfzVHTwSoLdVmDGmYNeNfQ0Z EmVcueUo1DcOiUrRRaGMvR1yqmXsbDZ4uHNCCyb3YyYevUQYtjEv76voh5zdQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14153631108985947431 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v3 13/14] selftests/nolibc: add chmod_tmpdir test Date: Fri, 30 Jun 2023 22:59:17 +0800 Message-Id: <7db449df61476b4e27a7fa70f31b6b98c6447660.1688134400.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770140648740133697?= X-GMAIL-MSGID: =?utf-8?q?1770140648740133697?= create a temp directory to test chmod with tmpfs. Reviewed-by: Thomas Weißschuh Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 906b70ddec79..be2a18cd5bd5 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -699,6 +699,7 @@ int run_syscall(int min, int max) CASE_TEST(chdir_dot); EXPECT_SYSZR(1, chdir(".")); break; CASE_TEST(chdir_blah); EXPECT_SYSER(1, chdir("/blah"), -1, ENOENT); break; CASE_TEST(chmod_self); EXPECT_SYSER(proc, chmod("/proc/self", 0555), -1, EPERM); break; + CASE_TEST(chmod_tmpdir); mkdir("/tmp/blah", 0755); EXPECT_SYSZR(1, chmod("/tmp/blah", 0555)); rmdir("/tmp/blah"); break; CASE_TEST(chown_self); EXPECT_SYSER(proc, chown("/proc/self", 0, 0), -1, EPERM); break; CASE_TEST(chroot_root); EXPECT_SYSZR(euid0, chroot("/")); break; CASE_TEST(chroot_blah); EXPECT_SYSER(1, chroot("/proc/self/blah"), -1, ENOENT); break;