From b160aedcf1c254f8ffc64d46ac7253863055e1c2 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Nov 18 2014 01:41:46 +0000 Subject: - fix incorrect autofs.conf installed and add several upstream bug fixes. --- diff --git a/autofs-5.1.0-fix-hosts-map-update-on-reload.patch b/autofs-5.1.0-fix-hosts-map-update-on-reload.patch new file mode 100644 index 0000000..872a3e2 --- /dev/null +++ b/autofs-5.1.0-fix-hosts-map-update-on-reload.patch @@ -0,0 +1,84 @@ +autofs-5.1.0 - fix hosts map update on reload + +From: Ian Kent + +Commit aedfd5aa - "amd lookup fix host mount naming" introduced a +regression when updating sun format maps. + +The amd host mount type assumes the lookup name is the host name for +the host mount but amd uses ${rhost} for this. + +This introduces the possibility of multiple concurrent mount requests +since constructing a mount tree that isn't under the lookup name can't +take advantage of the kernel queuing of other concurrent lookups while +the mount tree is constructed. + +Consequently multi-mount updates (currently only done for the internal +hosts map which the amd parser also uses for its hosts map) can't be +allowed for amd mounts. +--- + CHANGELOG | 1 + + modules/parse_sun.c | 37 ++++++++++++++++++++++++++++--------- + 2 files changed, 29 insertions(+), 9 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 645efe5..59f2906 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -36,6 +36,7 @@ + - fix fix master map type check. + - init qdn before use in get_query_dn(). + - fix typo in update_hosts_mounts(). ++- fix hosts map update on reload. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/parse_sun.c b/modules/parse_sun.c +index b881ee9..a3c736e 100644 +--- a/modules/parse_sun.c ++++ b/modules/parse_sun.c +@@ -1356,16 +1356,35 @@ int parse_mount(struct autofs_point *ap, const char *name, + } + + cache_multi_writelock(me); +- /* Someone beat us to it, return success */ +- if (me->multi) { +- free(options); +- cache_multi_unlock(me); +- cache_unlock(mc); +- pthread_setcancelstate(cur_state, NULL); +- return 0; +- } + /* So we know we're the multi-mount root */ +- me->multi = me; ++ if (!me->multi) ++ me->multi = me; ++ else { ++ /* ++ * The amd host mount type assumes the lookup name ++ * is the host name for the host mount but amd uses ++ * ${rhost} for this. ++ * ++ * This introduces the possibility of multiple ++ * concurrent mount requests since constructing a ++ * mount tree that isn't under the lookup name can't ++ * take advantage of the kernel queuing of other ++ * concurrent lookups while the mount tree is ++ * constructed. ++ * ++ * Consequently multi-mount updates (currently only ++ * done for the internal hosts map which the amd ++ * parser also uses for its hosts map) can't be ++ * allowed for amd mounts. ++ */ ++ if (source->flags & MAP_FLAG_FORMAT_AMD) { ++ free(options); ++ cache_multi_unlock(me); ++ cache_unlock(mc); ++ pthread_setcancelstate(cur_state, NULL); ++ return 0; ++ } ++ } + + age = me->age; + diff --git a/autofs-5.1.0-fix-typo-in-update_hosts_mounts.patch b/autofs-5.1.0-fix-typo-in-update_hosts_mounts.patch new file mode 100644 index 0000000..7580e0c --- /dev/null +++ b/autofs-5.1.0-fix-typo-in-update_hosts_mounts.patch @@ -0,0 +1,35 @@ +autofs-5.1.0 - fix typo in update_hosts_mounts() + +From: Ian Kent + +Correct the stutter in the update exports message. +--- + CHANGELOG | 1 + + modules/lookup_hosts.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 7c0a7bb..645efe5 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -35,6 +35,7 @@ + - update man page autofs(8) for systemd. + - fix fix master map type check. + - init qdn before use in get_query_dn(). ++- fix typo in update_hosts_mounts(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c +index 9d689ff..407cf31 100644 +--- a/modules/lookup_hosts.c ++++ b/modules/lookup_hosts.c +@@ -214,7 +214,7 @@ next: + goto cont; + + debug(ap->logopt, MODPREFIX +- "attempt to update exports for exports for %s", me->key); ++ "attempt to update exports for %s", me->key); + + master_source_current_wait(ap->entry); + ap->entry->current = source; diff --git a/autofs-5.1.0-init-qdn-before-use.patch b/autofs-5.1.0-init-qdn-before-use.patch new file mode 100644 index 0000000..a084dcf --- /dev/null +++ b/autofs-5.1.0-init-qdn-before-use.patch @@ -0,0 +1,35 @@ +autofs-5.1.0 - init qdn before use in get_query_dn() + +From: Ian Kent + +Ensure qdn is initialized before use in case there's garbage in it. +--- + CHANGELOG | 1 + + modules/lookup_ldap.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 9e2dc89..7c0a7bb 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -34,6 +34,7 @@ + - gaurd against incorrect umount return. + - update man page autofs(8) for systemd. + - fix fix master map type check. ++- init qdn before use in get_query_dn(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index ac2ef30..5da613e 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -335,7 +335,7 @@ LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_conte + static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt, const char *class, const char *key) + { + char buf[MAX_ERR_BUF]; +- char *query, *dn, *qdn; ++ char *query, *dn, *qdn = NULL; + LDAPMessage *result = NULL, *e; + char *attrs[2]; + struct berval **value; diff --git a/autofs.spec b/autofs.spec index b401797..96457e5 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.1.0 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -47,6 +47,9 @@ Patch31: autofs-5.1.0-clarify-multiple-mounts-description.patch Patch32: autofs-5.1.0-gaurd-against-incorrect-umount-return.patch Patch33: autofs-5.1.0-update-man-page-autofs-8-for-systemd.patch Patch34: autofs-5.1.0-fix-fix-master-map-type-check.patch +Patch35: autofs-5.1.0-init-qdn-before-use.patch +Patch36: autofs-5.1.0-fix-typo-in-update_hosts_mounts.patch +Patch37: autofs-5.1.0-fix-hosts-map-update-on-reload.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -169,6 +172,7 @@ install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{unitdir}/autofs.service install -m 755 redhat/autofs.init $RPM_BUILD_ROOT%{_initrddir}/autofs %define init_file_name /etc/rc.d/init.d/autofs %endif +install -m 644 redhat/autofs.conf $RPM_BUILD_ROOT/etc/autofs.conf install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs %clean @@ -229,6 +233,13 @@ fi %dir /etc/auto.master.d %changelog +* Tue Nov 18 2014 Ian Kent - 1:5.1.0-9 +- fix custom autofs.conf not being installed. +- init qdn before use in get_query_dn(). +- fix typo in update_hosts_mounts(). +- fix hosts map update on reload. + + * Fri Oct 17 2014 Ian Kent - 1:5.1.0-8 - fix fix master map type check.