From 9222db574e8a6254884671ec563125c339a55448 Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Tue, 30 Mar 2010 13:54:10 +0000 Subject: [PATCH] - Ignore no-op bind mounts Resolves: #577819 --- mlocate-0.22.4-noop-bind.patch | 39 ++++++++++++++++++++++++++++++++++ mlocate.spec | 9 +++++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 mlocate-0.22.4-noop-bind.patch diff --git a/mlocate-0.22.4-noop-bind.patch b/mlocate-0.22.4-noop-bind.patch new file mode 100644 index 0000000..591f32f --- /dev/null +++ b/mlocate-0.22.4-noop-bind.patch @@ -0,0 +1,39 @@ +Ignore no-op bind mounts. + +2010-03-30 Miloslav Trmač + + * src/updatedb.c (rebuild_bind_mount_paths): Ignore no-op bind mounts. + * doc/updatedb.conf.5.in (PRUNE_BIND_MOUNTS): Document that no-op bind + mounts are not skipped. + +diff -r f505e36861d7 -r 87bcb87d48f9 doc/updatedb.conf.5.in +--- a/doc/updatedb.conf.5.in Fri Mar 26 20:16:16 2010 +0100 ++++ b/doc/updatedb.conf.5.in Tue Mar 30 15:36:08 2010 +0200 +@@ -96,6 +96,7 @@ + .BR updatedb (8). + All file systems mounted in the subtree of a bind mount are skipped as well, + even if they are not bind mounts. ++As an exception, bind mounts of a directory on itself are not skipped. + + By default, bind mounts are not skipped. + +diff -r f505e36861d7 -r 87bcb87d48f9 src/updatedb.c +--- a/src/updatedb.c Fri Mar 26 20:16:16 2010 +0100 ++++ b/src/updatedb.c Tue Mar 30 15:36:08 2010 +0200 +@@ -370,8 +370,14 @@ + { + if (conf_debug_pruning != false) + /* This is debuging output, don't mark anything for translation */ +- fprintf (stderr, " `%s', opts `%s'\n", me->mnt_dir, me->mnt_opts); +- if (hasmntopt (me, "bind") != NULL) ++ fprintf (stderr, " `%s' on `%s', opts `%s'\n", me->mnt_fsname, ++ me->mnt_dir, me->mnt_opts); ++ /* Bind mounts "to self" can be used (e.g. by policycoreutils-sandbox) to ++ create another mount point to which Linux name space privacy flags can ++ be attached. Such a bind mount is not duplicating any part of the ++ directory tree, so it should not be excluded. */ ++ if (hasmntopt (me, "bind") != NULL ++ && strcmp (me->mnt_fsname, me->mnt_dir) != 0) + { + char dbuf[PATH_MAX], *dir; + diff --git a/mlocate.spec b/mlocate.spec index e45693c..e3784c2 100644 --- a/mlocate.spec +++ b/mlocate.spec @@ -1,11 +1,13 @@ Summary: An utility for finding files by name Name: mlocate Version: 0.22.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 URL: https://fedorahosted.org/mlocate/ Group: Applications/System Source0: https://fedorahosted.org/releases/m/l/mlocate/mlocate-%{version}.tar.xz +# Upstream changeset 87bcb87d48f939b851bdcf9580dfa89fe03438e7 +Patch0: mlocate-0.22.4-noop-bind.patch Source1: updatedb.conf Source2: mlocate.cron Requires(pre): shadow-utils @@ -23,6 +25,7 @@ trash the system caches as much as traditional locate implementations. %prep %setup -q +%patch0 -p1 -b .noop-bind %build %configure --localstatedir=%{_localstatedir}/lib @@ -67,6 +70,10 @@ exit 0 %ghost %{_localstatedir}/lib/mlocate/mlocate.db %changelog +* Tue Mar 30 2010 Miloslav Trmač - 0.22.4-2 +- Ignore no-op bind mounts + Resolves: #577819 + * Fri Mar 26 2010 Miloslav Trmač - 0.22.4-1 - Update to mlocate-0.22.4