From patchwork Fri Sep 15 15:19:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7178 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RnHst2JnFz3wnC for ; Fri, 15 Sep 2023 15:19:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RnHsr5kPgz1GJ; Fri, 15 Sep 2023 15:19:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RnHsr50v9z2yTq; Fri, 15 Sep 2023 15:19:28 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RnHsq1XWRz2xQs for ; Fri, 15 Sep 2023 15:19:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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 mail01.ipfire.org (Postfix) with ESMTPSA id 4RnHsp00dszQb; Fri, 15 Sep 2023 15:19:25 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1694791166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3dcGQ+l1BUdBtXbyJh0jCHUWCdQqVLj69JD5MQ1xWII=; b=FKjabf2bu00My01AwIHoT1pX+ta4Ub22wYWaQPQVx1igt/Ncd5DYQkzdUV/MTlEFwNmDMD 1z8Zq1eoZWTY/jAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1694791166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3dcGQ+l1BUdBtXbyJh0jCHUWCdQqVLj69JD5MQ1xWII=; b=Ilr0YN7f7Oueu/RIGiBcEgYCiOuFVrsleoNbw9dcO/Y2FmF5oQ70/QZRsrUn5dF7O+vWNW CJOJCQe76rTKRHZLXQAuhr7gH1PIvBDzBzLfWK2dqp/NVvhJU7VNBiqYooach+jG9JvQ3p QSzvyIATaRy0YHP0ni2Aow1yiBHfiJ4N4eiYnyDnS77EICApDlXeOAOiF/atSD/e/keus0 R68jXoDyV0FPlThgmne/3FB/1lVWHLknUda6vtvDV6Xlc112pO9t9bf+XVPfvDi305aD0y gtt+a+XauJ98wAh/R1qRxRz1/fMvR2cEKIfMaUaah3j27fgw0XoV6CjYCZ7sGQ== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] fhs.c: Correct permissions for /var/mail and /tmp Date: Fri, 15 Sep 2023 17:19:10 +0200 Message-ID: <20230915151910.1140-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - /var/mail is looking for 0755 but dma is setting 02775 checking FHS it looks like the settings should be 02775 - /tmp is being checked for 1755 instead of 01755 so the number is not being recognised as octal but as decimal - The /var/mail change confirmed to allow dma to be built in ipfire3.x without failing for FHS errors Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- src/libpakfire/fhs.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/libpakfire/fhs.c b/src/libpakfire/fhs.c index 94fe6667..a7a62267 100644 --- a/src/libpakfire/fhs.c +++ b/src/libpakfire/fhs.c @@ -97,17 +97,19 @@ static const struct pakfire_fhs_check { { "/usr/lib/firmware/**", S_IFDIR, 0755, "root", "root", 0 }, // /var - { "/var", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/cache", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/db", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/empty", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/lib", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/log", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/mail", S_IFDIR, 0755, "root", "mail", 0 }, - { "/var/opt", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/run", S_IFLNK, 0755, "root", "root", 0 }, - { "/var/spool", S_IFDIR, 0755, "root", "root", 0 }, - { "/var/tmp", S_IFDIR, 0755, "root", "root", 0 }, + // The first 0 in the permissions defines that the number is octal whether + // three or four digits are used + { "/var", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/cache", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/db", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/empty", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/lib", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/log", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/mail", S_IFDIR, 02775, "root", "mail", 0 }, + { "/var/opt", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/run", S_IFLNK, 0755, "root", "root", 0 }, + { "/var/spool", S_IFDIR, 0755, "root", "root", 0 }, + { "/var/tmp", S_IFDIR, 0755, "root", "root", 0 }, // Do not allow any subdirectories in /var { "/var/*", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNOTEXIST }, @@ -165,7 +167,7 @@ static const struct pakfire_fhs_check { { "/sys/**", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNOTEXIST }, // /tmp - { "/tmp", S_IFDIR, 1755, "root", "root", 0 }, + { "/tmp", S_IFDIR, 01755, "root", "root", 0 }, { "/tmp/**", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNOTEXIST }, // FHS Directories