From 66b5fc9ab5d8b2c25f06afeee4ca838987d8cc0e Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Oct 15 2012 07:52:07 +0000 Subject: - add current upstream fixes. --- diff --git a/autofs-5.0.7-README-update-mailing-list-subscription-info.patch b/autofs-5.0.7-README-update-mailing-list-subscription-info.patch new file mode 100644 index 0000000..99b6181 --- /dev/null +++ b/autofs-5.0.7-README-update-mailing-list-subscription-info.patch @@ -0,0 +1,56 @@ +autofs-5.0.7 - README: update mailing list subscription info + +From: Chris Packham + +Following the kernel.org compromise the mailing list was moved to +vger.kernel.org. Update the subscription info and add URLs for the gmane +mailing list archive. + +Signed-off-by: Chris Packham +--- + + CHANGELOG | 1 + + README | 17 ++++++++++++++--- + 2 files changed, 15 insertions(+), 3 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index fe801e8..44c9fb2 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -10,6 +10,7 @@ + - fix null map entry order handling. + - make description of default MOUNT_WAIT setting clear. + - configure.in: allow cross compilation. ++- README: update mailing list subscription info. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/README b/README +index cef16a9..9024e64 100644 +--- a/README ++++ b/README +@@ -43,9 +43,20 @@ Fitzhardinge's work on autofs 3. Further enhancements + have been made by Ian Kent . + + If you use or want to help develop autofs, please join the autofs +-mailing list by visiting: ++mailing list by sending an email to: + +- http://linux.kernel.org/mailman/listinfo/autofs ++ majordomo@vger.kernel.org + +-and folling the instructions there to subscribe to the autofs mailing list. ++With the body text: ++ ++ subscribe autofs ++ ++Once subscribed you can send patches to: ++ ++ autofs@vger.kernel.org ++ ++The autofs mailing list archive can be viewed on gmane: ++ ++ http://news.gmane.org/gmane.linux.kernel.autofs ++ http://blog.gmane.org/gmane.linux.kernel.autofs + diff --git a/autofs-5.0.7-add-timeout-option-description-to-man-page.patch b/autofs-5.0.7-add-timeout-option-description-to-man-page.patch new file mode 100644 index 0000000..ac598dd --- /dev/null +++ b/autofs-5.0.7-add-timeout-option-description-to-man-page.patch @@ -0,0 +1,42 @@ +autofs-5.0.7 - add timeout option description to man page + +From: Ian Kent + +The pseudo option used t set the timeout for map entries is one of +the most most frequently used autofs options but is not mentioned +in auto.master(5). +--- + + CHANGELOG | 1 + + man/auto.master.5.in | 5 +++++ + 2 files changed, 6 insertions(+), 0 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 93b9c26..7b8d185 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -6,6 +6,7 @@ + - fix parse buffer initialization. + - fix typo in automount(8). + - dont wait forever to restart. ++- add timeout option description to man page. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/auto.master.5.in b/man/auto.master.5.in +index 54269f8..21d7544 100644 +--- a/man/auto.master.5.in ++++ b/man/auto.master.5.in +@@ -167,6 +167,11 @@ server is specified in the map entry. If no server weights are given + then each available server will be tried in the order listed, within + proximity. + .TP ++.I "\-t, \-\-timeout " ++Set the expire timeout for map entries. This option can be used to ++override the global default given either on the command line ++or in the configuration. ++.TP + .I "\-n, \-\-negative\-timeout " + Set the timeout for caching failed key lookups. This option can be + used to override the global default given either on the command line diff --git a/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/autofs-5.0.7-allow-non-root-user-to-check-status.patch new file mode 100644 index 0000000..6020c31 --- /dev/null +++ b/autofs-5.0.7-allow-non-root-user-to-check-status.patch @@ -0,0 +1,69 @@ +autofs-5.0.7 - allow non root user to check status + +From: Ian Kent + + +--- + + CHANGELOG | 1 + + redhat/autofs.init.in | 20 +++++++++++++------- + 2 files changed, 14 insertions(+), 7 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 44c9fb2..936c9ab 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -11,6 +11,7 @@ + - make description of default MOUNT_WAIT setting clear. + - configure.in: allow cross compilation. + - README: update mailing list subscription info. ++- allow non root user to check status. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in +index cd5cb34..fe18b3e 100644 +--- a/redhat/autofs.init.in ++++ b/redhat/autofs.init.in +@@ -167,6 +167,19 @@ function usage_message() { + + RETVAL=0 + ++# allow non-root users to read status / usage ++ ++case "$1" in ++ status) ++ status -p @@autofspiddir@@/autofs.pid -l autofs $prog ++ exit 0; ++ ;; ++ usage) ++ usage_message ++ exit 0; ++ ;; ++esac ++ + # Only the root user may change the service status + if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then + echo "insufficient privilege to change service status" +@@ -184,9 +197,6 @@ case "$1" in + stop) + stop + ;; +- status) +- status -p @@autofspiddir@@/autofs.pid -l autofs $prog +- ;; + restart|force-reload) + restart + ;; +@@ -202,10 +212,6 @@ case "$1" in + restart + fi + ;; +- usage) +- usage_message +- exit 0 +- ;; + *) + usage_message + exit 2 diff --git a/autofs-5.0.7-configure-in-allow-cross-compilation.patch b/autofs-5.0.7-configure-in-allow-cross-compilation.patch new file mode 100644 index 0000000..ac18bd9 --- /dev/null +++ b/autofs-5.0.7-configure-in-allow-cross-compilation.patch @@ -0,0 +1,41 @@ +autofs-5.0.7 - configure.in: allow cross compilation + +From: Chris Packham + +The default behaviour of AC_RUN_IFELSE is to stop with an error if cross +compiling. Avoid this by providing the optional 4th argument to set +gcc_supports_pie=no if support for PIE cannot be detected. + +Signed-off-by: Chris Packham +--- + + CHANGELOG | 1 + + configure.in | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 961e340..fe801e8 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -9,6 +9,7 @@ + - add timeout option description to man page. + - fix null map entry order handling. + - make description of default MOUNT_WAIT setting clear. ++- configure.in: allow cross compilation. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/configure.in b/configure.in +index 1a24e34..90bda62 100644 +--- a/configure.in ++++ b/configure.in +@@ -307,7 +307,7 @@ DAEMON_CFLAGS= + DAEMON_LDFLAGS= + AC_MSG_CHECKING([whether gcc -fPIE works]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], +- [gcc_supports_pie=yes], [gcc_supports_pie=no]) ++ [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) + AC_MSG_RESULT([$gcc_supports_pie]) + if test $gcc_supports_pie = yes ; then + DAEMON_CFLAGS="-fPIE" diff --git a/autofs-5.0.7-dont-wait-forever-to-restart.patch b/autofs-5.0.7-dont-wait-forever-to-restart.patch new file mode 100644 index 0000000..9973b47 --- /dev/null +++ b/autofs-5.0.7-dont-wait-forever-to-restart.patch @@ -0,0 +1,54 @@ +autofs-5.0.7 - dont wait forever to restart + +From: Ian Kent + +When restarting autofs the daemon must be stopped before it is started +again if it is to function properly. At the moment the init script waits +forever which is not ok if the daemon won't exit for some reason. + +So, if the daemon is still running after the stop, run stop() again, wait +a bit longer and if it still hasn't stopped kill it with a SIGKILL to clear +the way for the startup. +--- + + CHANGELOG | 1 + + redhat/autofs.init.in | 13 ++++++++++--- + 2 files changed, 11 insertions(+), 3 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 6051723..93b9c26 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -5,6 +5,7 @@ + - fix ipv6 proximity calculation. + - fix parse buffer initialization. + - fix typo in automount(8). ++- dont wait forever to restart. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in +index ec6d5d6..cd5cb34 100644 +--- a/redhat/autofs.init.in ++++ b/redhat/autofs.init.in +@@ -129,9 +129,16 @@ function restart() { + status autofs > /dev/null 2>&1 + if [ $? -eq 0 ]; then + stop +- while [ -n "`pidof $prog`" ] ; do +- sleep 5 +- done ++ if [ -n "`pidof $prog`" ]; then ++ # If we failed to stop, try at least one more time ++ # after waiting a little while ++ sleep 20 ++ stop ++ auto_pid=`pidof $prog` ++ if [ -n "$auto_pid" ]; then ++ kill -9 $auto_pid ++ fi ++ fi + fi + start + } diff --git a/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/autofs-5.0.7-fix-null-map-entry-order-handling.patch new file mode 100644 index 0000000..610afaa --- /dev/null +++ b/autofs-5.0.7-fix-null-map-entry-order-handling.patch @@ -0,0 +1,81 @@ +autofs-5.0.7 - fix null map entry order handling + +From: Ian Kent + +If a null map entry appears after a corresponding indirect map entry +autofs doesn't handle it properly. + +Since it appears after the map entry it should'nt affect it but autofs +doesn't account for this case and assumes the map entry is already +mounted and tries to shut it down causing attempted access to facilities +that don't exist. +--- + + CHANGELOG | 1 + + lib/master.c | 32 +++++++++++++++++++++++++++++--- + 2 files changed, 30 insertions(+), 3 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 7b8d185..79cf673 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -7,6 +7,7 @@ + - fix typo in automount(8). + - dont wait forever to restart. + - add timeout option description to man page. ++- fix null map entry order handling. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master.c b/lib/master.c +index 904b13d..a0e62f2 100644 +--- a/lib/master.c ++++ b/lib/master.c +@@ -1179,9 +1179,35 @@ int master_mount_mounts(struct master *master, time_t age, int readall) + + cache_readlock(nc); + ne = cache_lookup_distinct(nc, this->path); +- if (ne && this->age > ne->age) { ++ /* ++ * If this path matched a nulled entry the master map entry ++ * must be an indirect mount so the master map entry line ++ * number may be obtained from this->maps. ++ */ ++ if (ne) { ++ int lineno = ne->age; + cache_unlock(nc); +- st_add_task(ap, ST_SHUTDOWN_PENDING); ++ ++ /* null entry appears after map entry */ ++ if (this->maps->master_line < lineno) { ++ warn(ap->logopt, ++ "ignoring null entry that appears after " ++ "existing entry for %s", this->path); ++ goto cont; ++ } ++ if (ap->state != ST_INIT) { ++ st_add_task(ap, ST_SHUTDOWN_PENDING); ++ continue; ++ } ++ /* ++ * The map entry hasn't been started yet and we've ++ * seen a preceeding null map entry for it so just ++ * delete it from the master map entry list so it ++ * doesn't get in the road. ++ */ ++ list_del_init(&this->list); ++ master_free_mapent_sources(ap->entry, 1); ++ master_free_mapent(ap->entry); + continue; + } + nested = cache_partial_match(nc, this->path); +@@ -1194,7 +1220,7 @@ int master_mount_mounts(struct master *master, time_t age, int readall) + cache_delete(nc, nested->key); + } + cache_unlock(nc); +- ++cont: + st_mutex_lock(); + + state_pipe = this->ap->state_pipe[1]; diff --git a/autofs-5.0.7-include-usage-in-usage-message.patch b/autofs-5.0.7-include-usage-in-usage-message.patch new file mode 100644 index 0000000..1c8a565 --- /dev/null +++ b/autofs-5.0.7-include-usage-in-usage-message.patch @@ -0,0 +1,25 @@ +autofs-5.0.7 - include usage in usage message + +From: Ian Kent + +Since usage is a case entry we should also nclude it in the usage +message. +--- + + redhat/autofs.init.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + + +diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in +index 8e355da..ec6d5d6 100644 +--- a/redhat/autofs.init.in ++++ b/redhat/autofs.init.in +@@ -155,7 +155,7 @@ function reload() { + } + + function usage_message() { +- echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" ++ echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" + } + + RETVAL=0 diff --git a/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch b/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch new file mode 100644 index 0000000..a3dd3fb --- /dev/null +++ b/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch @@ -0,0 +1,57 @@ +autofs-5.0.7 - make description of default MOUNT_WAIT setting clear + +From: Ian Kent + + +--- + + CHANGELOG | 1 + + redhat/autofs.sysconfig.in | 5 +++-- + samples/autofs.conf.default.in | 5 +++-- + 3 files changed, 7 insertions(+), 4 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 79cf673..961e340 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -8,6 +8,7 @@ + - dont wait forever to restart. + - add timeout option description to man page. + - fix null map entry order handling. ++- make description of default MOUNT_WAIT setting clear. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/redhat/autofs.sysconfig.in b/redhat/autofs.sysconfig.in +index 36b924d..a8992c4 100644 +--- a/redhat/autofs.sysconfig.in ++++ b/redhat/autofs.sysconfig.in +@@ -18,8 +18,9 @@ TIMEOUT=300 + # Setting this timeout can cause problems when + # mount would otherwise wait for a server that + # is temporarily unavailable, such as when it's +-# restarting. The defailt of waiting for mount(8) +-# usually results in a wait of around 3 minutes. ++# restarting. The default setting (-1) of waiting ++# for mount(8) usually results in a wait of around ++# 3 minutes. + # + #MOUNT_WAIT=-1 + # +diff --git a/samples/autofs.conf.default.in b/samples/autofs.conf.default.in +index ac2f63b..1da89cf 100644 +--- a/samples/autofs.conf.default.in ++++ b/samples/autofs.conf.default.in +@@ -18,8 +18,9 @@ TIMEOUT=300 + # Setting this timeout can cause problems when + # mount would otherwise wait for a server that + # is temporarily unavailable, such as when it's +-# restarting. The defailt of waiting for mount(8) +-# usually results in a wait of around 3 minutes. ++# restarting. The default setting (-1) of waiting ++# for mount(8) usually results in a wait of around ++# 3 minutes. + # + #MOUNT_WAIT=-1 + # diff --git a/autofs.spec b/autofs.spec index 84d3b6c..7851aba 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.7 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -18,6 +18,14 @@ Patch2: autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch Patch3: autofs-5.0.7-fix-ipv6-proximity-calculation.patch Patch4: autofs-5.0.7-fix-parse-buffer-initialization.patch Patch5: autofs-5.0.7-fix-typo-in-automount-8.patch +Patch6: autofs-5.0.7-include-usage-in-usage-message.patch +Patch7: autofs-5.0.7-dont-wait-forever-to-restart.patch +Patch8: autofs-5.0.7-add-timeout-option-description-to-man-page.patch +Patch9: autofs-5.0.7-fix-null-map-entry-order-handling.patch +Patch10: autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch +Patch11: autofs-5.0.7-configure-in-allow-cross-compilation.patch +Patch12: autofs-5.0.7-README-update-mailing-list-subscription-info.patch +Patch13: autofs-5.0.7-allow-non-root-user-to-check-status.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -79,6 +87,14 @@ echo %{version}-%{release} > .version %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -170,6 +186,16 @@ fi %dir /etc/auto.master.d %changelog +* Mon Sep 15 2012 Ian Kent - 1:5.0.7-4 +- include usage in usage message. +- dont wait forever to restart. +- add option description to man page. +- fix null map entry order handling. +- make description of default MOUNT_WAIT setting clear. +- configure.in: allow cross compilation. +- README: update mailing list subscription info. +- allow non root user to check status. + * Mon Sep 12 2012 Ian Kent - 1:5.0.7-3 - fix nobind sun escaped map entries. - fix use cache entry after free mistake.