From 75006470cefd07d35ac7d889ad3fc2959d19f381 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Mar 2019 18:35:03 +0100 Subject: [PATCH] tmpfiles: support the FS_PROJINHERIT_FL chattr flag --- man/tmpfiles.d.xml | 14 +++++--------- src/tmpfiles/tmpfiles.c | 4 +++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index acad6dcc01..67bd1dc724 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -368,15 +368,11 @@ L /tmp/foobar - - - - /dev/null Set file/directory attributes. Lines of this type accept shell-style globs in place of normal path names. - The format of the argument field is - [+-=][aAcCdDeijsStTu] . The prefix - + (the default one) causes the - attribute(s) to be added; - causes the - attribute(s) to be removed; = causes the - attributes to be set exactly as the following letters. The - letters aAcCdDeijsStTu select the new - attributes for the files, see - chattr + The format of the argument field is [+-=][aAcCdDeijPsStTu] . The prefix + + (the default one) causes the attribute(s) to be added; - + causes the attribute(s) to be removed; = causes the attributes to be set exactly + as the following letters. The letters aAcCdDeijPsStTu select the new attributes + for the files, see chattr 1 for further information. Passing only = as argument resets diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 96b619f8cc..5251c741ee 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1110,7 +1110,8 @@ static int path_set_acls(Item *item, const char *path) { FS_UNRM_FL | \ FS_NOTAIL_FL | \ FS_TOPDIR_FL | \ - FS_NOCOW_FL) + FS_NOCOW_FL | \ + FS_PROJINHERIT_FL) static int parse_attribute_from_arg(Item *item) { @@ -1132,6 +1133,7 @@ static int parse_attribute_from_arg(Item *item) { { 't', FS_NOTAIL_FL }, /* file tail should not be merged */ { 'T', FS_TOPDIR_FL }, /* Top of directory hierarchies */ { 'C', FS_NOCOW_FL }, /* Do not cow file */ + { 'P', FS_PROJINHERIT_FL }, /* Inherit the quota project ID */ }; enum {