- Ignore no-op bind mounts Resolves: #577819

This commit is contained in:
Miloslav Trmac 2010-03-30 13:54:10 +00:00
parent 0094a2b5d2
commit 9222db574e
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,39 @@
Ignore no-op bind mounts.
2010-03-30 Miloslav Trmač <mitr@redhat.com>
* 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;

View File

@ -1,11 +1,13 @@
Summary: An utility for finding files by name Summary: An utility for finding files by name
Name: mlocate Name: mlocate
Version: 0.22.4 Version: 0.22.4
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2 License: GPLv2
URL: https://fedorahosted.org/mlocate/ URL: https://fedorahosted.org/mlocate/
Group: Applications/System Group: Applications/System
Source0: https://fedorahosted.org/releases/m/l/mlocate/mlocate-%{version}.tar.xz 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 Source1: updatedb.conf
Source2: mlocate.cron Source2: mlocate.cron
Requires(pre): shadow-utils Requires(pre): shadow-utils
@ -23,6 +25,7 @@ trash the system caches as much as traditional locate implementations.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .noop-bind
%build %build
%configure --localstatedir=%{_localstatedir}/lib %configure --localstatedir=%{_localstatedir}/lib
@ -67,6 +70,10 @@ exit 0
%ghost %{_localstatedir}/lib/mlocate/mlocate.db %ghost %{_localstatedir}/lib/mlocate/mlocate.db
%changelog %changelog
* Tue Mar 30 2010 Miloslav Trmač <mitr@redhat.com> - 0.22.4-2
- Ignore no-op bind mounts
Resolves: #577819
* Fri Mar 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.22.4-1 * Fri Mar 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.22.4-1
- Update to mlocate-0.22.4 - Update to mlocate-0.22.4