From mboxrd@z Thu Jan 1 00:00:00 1970 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 Content-Type: multipart/mixed; boundary="===============0380285502098940702==" List-Id: --===============0380285502098940702== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - /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 }, =20 // /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 }, =20 // Do not allow any subdirectories in /var { "/var/*", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNO= TEXIST }, @@ -165,7 +167,7 @@ static const struct pakfire_fhs_check { { "/sys/**", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNO= TEXIST }, =20 // /tmp - { "/tmp", S_IFDIR, 1755, "root", "root", 0 }, + { "/tmp", S_IFDIR, 01755, "root", "root", 0 }, { "/tmp/**", 0, 0, NULL, NULL, PAKFIRE_FHS_MUSTNO= TEXIST }, =20 // FHS Directories --=20 2.42.0 --===============0380285502098940702==--