Commit 78d97ace authored by Martin Pitt's avatar Martin Pitt
Browse files

Don't auto-clean PrivateTmp dir in /var/tmp

In Debian we don't want to clean /var/tmp/ automatically.

Patch cherry-picked from upstream git (fixed in 218).

Closes: #773313
parent 6f3e3ee0
......@@ -10,6 +10,8 @@ systemd (215-9) UNRELEASED; urgency=medium
copy&paste'd comment, fix log strings. Thanks Adam D. Barratt.
* Log all members of cyclic dependencies (loops) even with quiet on the
kernel cmdline. (Closes: #770504)
* Don't auto-clean PrivateTmp dir in /var/tmp; in Debian we don't want to
clean /var/tmp/ automatically. (Closes: #773313)
-- Didier Roche <didrocks@ubuntu.com> Wed, 10 Dec 2014 13:57:17 +0100
......
......@@ -123,6 +123,7 @@ util-allow-strappenda-to-take-any-number-of-args.patch
journal-do-server_vacuum-for-sigusr1.patch
journalctl-correct-help-text-for-until.patch
Raise-level-of-Found-dependency.-lines.patch
systemd-tmpfiles-Fix-IGNORE_DIRECTORY_PATH-age-handl.patch
## Debian specific patches:
Add-back-support-for-Debian-specific-config-files.patch
......
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 a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index f9830c4..7eafd6b 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/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;
}
--
2.1.3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment