Dr. Werner Fink 2014-09-26 16:12:05 +00:00 committed by Git OBS Bridge
parent f997dee4e4
commit 0ef55bb4aa
5 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From 9ed2a35e93f4a9e82585f860f54cdcbbdf3e1f86 Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard@nod.at>
Date: Tue, 9 Sep 2014 11:09:37 +0200
Subject: [PATCH] systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
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 src/tmpfiles/tmpfiles.c src/tmpfiles/tmpfiles.c
index f9830c4..7eafd6b 100644
--- src/tmpfiles/tmpfiles.c
+++ src/tmpfiles/tmpfiles.c
@@ -1576,7 +1576,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;
}
--
1.7.9.2

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 26 16:11:10 UTC 2014 - werner@suse.de
- Add upstream patch
0001-systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch
for bsc#893797
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Sep 26 09:34:22 UTC 2014 - rmilasan@suse.com Fri Sep 26 09:34:22 UTC 2014 - rmilasan@suse.com

View File

@ -900,6 +900,8 @@ Patch434: 0002-util-avoid-non-portable-__WORDSIZE.patch
Patch435: 0001-Fix-warning-about-unused-variable-with-SELINUX.patch Patch435: 0001-Fix-warning-about-unused-variable-with-SELINUX.patch
# PATCH-FIX-UPSTREAM added at 2014/09/25 # PATCH-FIX-UPSTREAM added at 2014/09/25
Patch436: 0002-bus-remove-unused-check.patch Patch436: 0002-bus-remove-unused-check.patch
# PATCH-FIX-UPSTREAM added at 2014/09/26
Patch437: 0001-systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch
# UDEV PATCHES # UDEV PATCHES
# ============ # ============
@ -1680,6 +1682,7 @@ cp %{SOURCE7} m4/
%patch434 -p0 %patch434 -p0
%patch435 -p0 %patch435 -p0
%patch436 -p0 %patch436 -p0
%patch437 -p0
# udev patches # udev patches
%patch1001 -p1 %patch1001 -p1

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 26 16:11:10 UTC 2014 - werner@suse.de
- Add upstream patch
0001-systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch
for bsc#893797
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Sep 26 09:34:22 UTC 2014 - rmilasan@suse.com Fri Sep 26 09:34:22 UTC 2014 - rmilasan@suse.com

View File

@ -895,6 +895,8 @@ Patch434: 0002-util-avoid-non-portable-__WORDSIZE.patch
Patch435: 0001-Fix-warning-about-unused-variable-with-SELINUX.patch Patch435: 0001-Fix-warning-about-unused-variable-with-SELINUX.patch
# PATCH-FIX-UPSTREAM added at 2014/09/25 # PATCH-FIX-UPSTREAM added at 2014/09/25
Patch436: 0002-bus-remove-unused-check.patch Patch436: 0002-bus-remove-unused-check.patch
# PATCH-FIX-UPSTREAM added at 2014/09/26
Patch437: 0001-systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch
# UDEV PATCHES # UDEV PATCHES
# ============ # ============
@ -1675,6 +1677,7 @@ cp %{SOURCE7} m4/
%patch434 -p0 %patch434 -p0
%patch435 -p0 %patch435 -p0
%patch436 -p0 %patch436 -p0
%patch437 -p0
# udev patches # udev patches
%patch1001 -p1 %patch1001 -p1