systemd/systemd-add-user-keep.patch

79 lines
3.7 KiB
Diff
Raw Normal View History

diff -Naur systemd-210/man/tmpfiles.d.xml systemd-210.mod/man/tmpfiles.d.xml
--- systemd-210/man/tmpfiles.d.xml 2014-12-18 09:40:29.403629407 +0100
+++ systemd-210.mod/man/tmpfiles.d.xml 2014-12-18 10:34:06.274130934 +0100
@@ -435,8 +435,12 @@
<varname>f</varname>, <varname>F</varname>,
and <varname>w</varname> may be used to
specify a short string that is written to the
- file, suffixed by a newline. Ignored for all
- other lines.</para>
+ file, suffixed by a newline.
+ For <varname>x</varname>, <varname>X</varname>
+ a comma separated list of usernames. If given,
+ only paths belonging to these users will be
+ excluded during directory cleanup.
+ Ignored for all other lines.</para>
</refsect2>
</refsect1>
diff -Naur systemd-210/src/tmpfiles/tmpfiles.c systemd-210.mod/src/tmpfiles/tmpfiles.c
--- systemd-210/src/tmpfiles/tmpfiles.c 2014-12-18 09:40:29.342629177 +0100
+++ systemd-210.mod/src/tmpfiles/tmpfiles.c 2014-12-18 11:58:16.686576974 +0100
@@ -263,6 +263,7 @@
struct timespec times[2];
bool deleted = false;
int r = 0;
+ Item *found = NULL;
while ((dent = readdir(d))) {
struct stat s;
@@ -306,11 +307,43 @@
}
/* Is there an item configured for this path? */
- if (hashmap_get(items, sub_path))
- continue;
-
- if (find_glob(globs, sub_path))
- continue;
+ found = hashmap_get(items, sub_path);
+
+ if (!found)
+ found = find_glob(globs, sub_path);
+
+ if (found) {
Accepting request 286653 from Base:System - mark more subpackages as !bootstrap for systemd-mini usage. - spec : remove --with-firmware-path, firmware loader was removed in v217 - spec: remove --disable-multi-seat-x, gone.(fixed in xorg) - spec: Do not enable systemd-readahead-collect.service and systemd-readahead-replay.service as these do not exist anymore. - spec: drop timedate-add-support-for-openSUSE-version-of-etc-sysconfig.patch Yast was fixed to write all timezone changes exactly how timedated expects things to be done. - spec: remove handle-etc-HOSTNAME.patch, since late 2014 the netcfg package handles the migration from /etc/HOSTNAME to /etc/hostname and owns both files. -spec: remove boot.udev and systemd-journald.init as they currently serve no purpose. - suse-sysv-bootd-support.diff: Remove HAVE_SYSVINIT conditions, we are in sysvcompat-only codepath, also remove the code targetting other distributions, never compiled as the TARGET_$DISTRO macros are never defined. - systemd-powerd-initctl-support.patch guard with HAVE_SYSV_COMPAT - set-and-use-default-logconsole.patch: fix HAVE_SYSV_COMPAT guards - insserv-generator.patch: Only build when sysvcompat is enabled - vhangup-on-all-consoles.patch add a comment indicating this is a workaround for a kernel bug. - spec: Add option to allow disabling sysvinit compat at build time. - spec: Add option to enable resolved at build time. - spec: Remove all %ifs for !factory products, current systemd releases can neither be built nor installed in older products without upgrading several components of the base system. (removed: 1008-add-msft-compability-rules.patch was only for =< 13.1) - spec: remove all dummy "aliases" to /etc/init.d, that made sense only when those init scripts still existed. (dummy localfs.service source: gone) OBS-URL: https://build.opensuse.org/request/show/286653 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=215
2015-03-01 14:49:19 +01:00
+ /* evaluate username arguments in ignore statements */
+ if (found->type == IGNORE_PATH || found->type == IGNORE_DIRECTORY_PATH) {
+ if (!found->argument)
+ continue;
+ else {
+ struct passwd *pw;
+ char *userfound = NULL, *args = strdup(found->argument);
+ bool match = false;
+ int uid = -1;
+
+ while ((userfound = strsep(&args, ","))) {
+ pw = getpwnam(userfound);
+
+ if (!pw)
+ log_error("Unknown user '%s' in ignore statement.", userfound);
+ else {
+ uid = pw->pw_uid;
+ if (s.st_uid == uid) {
+ match = true;
+ break;
+ }
+ }
+ }
+ if (match) {
+ found = NULL;
+ continue;
+ }
Accepting request 286653 from Base:System - mark more subpackages as !bootstrap for systemd-mini usage. - spec : remove --with-firmware-path, firmware loader was removed in v217 - spec: remove --disable-multi-seat-x, gone.(fixed in xorg) - spec: Do not enable systemd-readahead-collect.service and systemd-readahead-replay.service as these do not exist anymore. - spec: drop timedate-add-support-for-openSUSE-version-of-etc-sysconfig.patch Yast was fixed to write all timezone changes exactly how timedated expects things to be done. - spec: remove handle-etc-HOSTNAME.patch, since late 2014 the netcfg package handles the migration from /etc/HOSTNAME to /etc/hostname and owns both files. -spec: remove boot.udev and systemd-journald.init as they currently serve no purpose. - suse-sysv-bootd-support.diff: Remove HAVE_SYSVINIT conditions, we are in sysvcompat-only codepath, also remove the code targetting other distributions, never compiled as the TARGET_$DISTRO macros are never defined. - systemd-powerd-initctl-support.patch guard with HAVE_SYSV_COMPAT - set-and-use-default-logconsole.patch: fix HAVE_SYSV_COMPAT guards - insserv-generator.patch: Only build when sysvcompat is enabled - vhangup-on-all-consoles.patch add a comment indicating this is a workaround for a kernel bug. - spec: Add option to allow disabling sysvinit compat at build time. - spec: Add option to enable resolved at build time. - spec: Remove all %ifs for !factory products, current systemd releases can neither be built nor installed in older products without upgrading several components of the base system. (removed: 1008-add-msft-compability-rules.patch was only for =< 13.1) - spec: remove all dummy "aliases" to /etc/init.d, that made sense only when those init scripts still existed. (dummy localfs.service source: gone) OBS-URL: https://build.opensuse.org/request/show/286653 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=215
2015-03-01 14:49:19 +01:00
+ }
+ } else
+ continue;
+ }
if (S_ISDIR(s.st_mode)) {