[systemd-devel] [RESEND][PATCH] systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
Tom Gundersen
teg at jklm.no
Fri Sep 26 08:39:49 PDT 2014
On Fri, Sep 26, 2014 at 12:46 PM, Richard Weinberger <richard at nod.at> wrote:
> Am 09.09.2014 11:09, schrieb Richard Weinberger:
>> If one has a config like:
>> d /tmp 1777 root root -
>> X /tmp/important_mount
>>
>> All files below /tmp/important_mount will be deleted as the
>> /tmp/important_mount item will spuriously inherit a max age of 0
>> from /tmp.
>> /tmp has a max age of 0 but age_set is (of course) false.
>>
>> This affects also the PrivateTmp feature of systemd.
>> All tmp files of such services will be deleted unconditionally
>> and can cause service failures and data loss.
>>
>> Fix this by checking ->age_set in the IGNORE_DIRECTORY_PATH logic.
>> ---
>> src/tmpfiles/tmpfiles.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
>> index 79fd0b7..c8d4abb 100644
>> --- a/src/tmpfiles/tmpfiles.c
>> +++ b/src/tmpfiles/tmpfiles.c
>> @@ -1572,7 +1572,7 @@ static int read_config_file(const char *fn, bool ignore_enoent) {
>> candidate_item = j;
>> }
>>
>> - if (candidate_item) {
>> + if (candidate_item && candidate_item->age_set) {
>> i->age = candidate_item->age;
>> i->age_set = true;
>> }
>>
>
> ping?
>
> Is there something horrible wrong with this patch or the submission itself?
> Please tell me. :)
Hi Richard,
Sorry for the delay in getting back to you!
Patch looks good. Applied.
Thanks!
Tom
More information about the systemd-devel
mailing list