import autofs-5.1.4-68.el8

This commit is contained in:
CentOS Sources 2021-05-10 20:11:01 +00:00 committed by Andrew Lukoshko
parent 6eb0a2c83b
commit f719b745d3
3 changed files with 188 additions and 1 deletions

View File

@ -0,0 +1,48 @@
autofs-5.1.7 - fix amd hosts mount expire
From: Ian Kent <raven@themaw.net>
When swicthing to use the mnt_list to track mounts for expire, if the
amd hosts map entry name is for the host short name, the amd mount
entry for the short name gets removed. This causes a subsequent mounts
for host exports to fail.
What should happen is the short name amd entry not be removed and a
mounted mount entry for the symlinked FQDN mount added so it expires.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
modules/parse_amd.c | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -67,6 +67,7 @@
- cater for empty mounts list in mnts_get_expire_list().
- add ext_mount_hash_mutex lock helpers.
- fix amd section mounts map reload.
+- fix amd hosts mount expire.
xx/xx/2018 autofs-5.1.5
- fix flag file permission.
--- autofs-5.1.4.orig/modules/parse_amd.c
+++ autofs-5.1.4/modules/parse_amd.c
@@ -2341,12 +2341,13 @@ int parse_mount(struct autofs_point *ap,
if (!rv) {
/*
* If entry->path doesn't match the mnt->mp then
- * the mount point path has changed and a new
- * mnt_list entry added for it, so remove the
- * original.
+ * it's a "host" map and the mount point path is
+ * different to the lookup name. Add a new mnt_list
+ * entry so that both the symlinked name and the
+ * mount expire.
*/
if (strcmp(this->path, mnt->mp))
- mnts_remove_amdmount(this->path);
+ mnts_add_mount(ap, this->rhost, MNTS_INDIRECT|MNTS_MOUNTED);
break;
}
/* Not mounted, remove the mnt_list entry from amdmount list */

View File

@ -0,0 +1,120 @@
autofs-5.1.7 - fix amd section mounts map reload
From: Ian Kent <raven@themaw.net>
Master map section mounts (amd format mounts) get umounted on reload.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1
daemon/master.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 81 insertions(+), 1 deletion(-)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -66,6 +66,7 @@
- refactor lookup_prune_one_cache() a bit.
- cater for empty mounts list in mnts_get_expire_list().
- add ext_mount_hash_mutex lock helpers.
+- fix amd section mounts map reload.
xx/xx/2018 autofs-5.1.5
- fix flag file permission.
--- autofs-5.1.4.orig/daemon/master.c
+++ autofs-5.1.4/daemon/master.c
@@ -882,6 +882,83 @@ struct master *master_new(const char *na
return master;
}
+static void master_update_amd_mount_section_mount(struct master *master,
+ const char *path, time_t age)
+{
+ unsigned int m_logopt = master->logopt;
+ struct master_mapent *entry;
+ struct map_source *source;
+ unsigned int loglevel;
+ unsigned int logopt;
+ unsigned int flags;
+ time_t timeout;
+ char *map;
+ char *opts;
+
+ entry = master_find_mapent(master, path);
+ if (!entry)
+ return;
+
+ map = conf_amd_get_map_name(path);
+ if (!map)
+ return;
+
+ /* amd top level mounts have only one map */
+ source = entry->maps;
+ if (strcmp(source->name, map) != 0) {
+ struct map_source *new;
+ char *type;
+ char *argv[2];
+
+ type = conf_amd_get_map_type(path);
+ argv[0] = map;
+ argv[1] = NULL;
+
+ new = master_add_map_source(entry, type, "amd",
+ age, 1, (const char **) argv);
+ if (!new) {
+ error(m_logopt,
+ "failed to add source for amd section mount %s",
+ path);
+ if (type)
+ free(type);
+ goto out;
+ }
+ master_free_map_source(source, 0);
+ entry->maps = new;
+ source = new;
+ if (type)
+ free(type);
+ }
+
+ loglevel = conf_amd_get_log_options();
+ logopt = m_logopt;
+ if (loglevel <= LOG_DEBUG && loglevel > LOG_INFO)
+ logopt = LOGOPT_DEBUG;
+ else if (loglevel <= LOG_INFO && loglevel > LOG_ERR)
+ logopt = LOGOPT_VERBOSE;
+
+ flags = conf_amd_get_flags(path);
+ if (flags & CONF_BROWSABLE_DIRS)
+ entry->ap->flags |= MOUNT_FLAG_GHOST;
+
+ opts = conf_amd_get_map_options(path);
+ if (opts) {
+ if (strstr(opts, "cache:=all"))
+ entry->ap->flags |= MOUNT_FLAG_AMD_CACHE_ALL;
+ free(opts);
+ }
+
+ entry->ap->logopt = logopt;
+
+ timeout = conf_amd_get_dismount_interval(path);
+ set_exp_timeout(entry->ap, source, timeout);
+ source->master_line = 0;
+ entry->age = age;
+out:
+ free(map);
+}
+
static void master_add_amd_mount_section_mounts(struct master *master, time_t age)
{
unsigned int m_logopt = master->logopt;
@@ -916,8 +993,10 @@ static void master_add_amd_mount_section
* master map it's not a duplicate, don't issue
* an error message.
*/
- if (ret == 1)
+ if (ret == 1) {
+ master_update_amd_mount_section_mount(master, path, age);
goto next;
+ }
info(m_logopt,
"amd section mount path conflict, %s ignored",
path);

View File

@ -8,7 +8,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.1.4
Release: 66%{?dist}
Release: 68%{?dist}
Epoch: 1
License: GPLv2+
Group: System Environment/Daemons
@ -232,6 +232,9 @@ Patch209: autofs-5.1.7-refactor-lookup_prune_one_cache-a-bit.patch
Patch210: autofs-5.1.7-cater-for-empty-mounts-list-in-mnts_get_expire_list.patch
Patch211: autofs-5.1.7-add-ext_mount_hash_mutex-lock-helpers.patch
Patch212: autofs-5.1.7-fix-amd-section-mounts-map-reload.patch
Patch213: autofs-5.1.7-fix-amd-hosts-mount-expire.patch
%if %{with_systemd}
BuildRequires: systemd-units
BuildRequires: systemd-devel
@ -505,6 +508,9 @@ echo %{version}-%{release} > .version
%patch210 -p1
%patch211 -p1
%patch212 -p1
%patch213 -p1
%build
LDFLAGS=-Wl,-z,now
%configure --disable-mount-locking --enable-ignore-busy --with-libtirpc --without-hesiod %{?systemd_configure_arg:}
@ -599,6 +605,19 @@ fi
%dir /etc/auto.master.d
%changelog
* Mon May 10 2021 Ian Kent <ikent@redhat.com> - 5.1.4-68
- bz1958487 - autofs amd mounts present in the configuration get umounted
on reload
- fix amd section mounts map reload.
- bz1958485 - autofs amd type host mounts fail for certain host names
- fix amd hosts mount expire.
- Resolves: rhbz#1958487 rhbz#1958485
* Thu May 06 2021 Ian Kent <ikent@redhat.com> - 5.1.4-67
- bz1954430 - Please, rebuild autofs-5.1.4-66.el8
- rebuild with fixed binutils.
- Resolves: rhbz#1954430
* Tue Mar 16 2021 Ian Kent <ikent@redhat.com> - 5.1.4-66
- bz1912106 - Using -hosts option does not resolve host from /etc/hosts and mount
failes