From ab3a3d73945aac828d15840d8e174945bc6b8af8 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Nov 07 2013 00:26:42 +0000 Subject: import autofs-5.0.7-32.el7.src.rpm --- diff --git a/.autofs.metadata b/.autofs.metadata new file mode 100644 index 0000000..db485ac --- /dev/null +++ b/.autofs.metadata @@ -0,0 +1 @@ +b2604cbd78ed7a854cb434061a7c37e84a984870 SOURCES/autofs-5.0.7.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/autofs-5.0.6-fix-recursive-mount-deadlock.patch b/SOURCES/autofs-5.0.6-fix-recursive-mount-deadlock.patch new file mode 100644 index 0000000..e6549a7 --- /dev/null +++ b/SOURCES/autofs-5.0.6-fix-recursive-mount-deadlock.patch @@ -0,0 +1,78 @@ +autofs-5.0.6 - fix recursive mount deadlock + +From: Ian Kent + +Prior to the vfs-automount changes that went into 2.6.38 +and were finalized in 3.1 it was not possible to block +path walks into multi-mounts whose root was covered by +another mount. To deal with that a write lock was used +to ensure the mount tree construction was completed. This +restricts the types of recursively defined mount maps that +can be used and can lead to a deadlock during lookup. + +Now that we can prevent processes walking into multi-mounts +that are under construction we no longer need to use a +write lock. + +Also, in the patch below, a cache writelock is changed to +a read lock because a write lock isn't needed since the +map cache entry isn't being updated. +--- + + CHANGELOG | 1 + + daemon/direct.c | 14 ++++++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 936c9ab..9cdad6e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -12,6 +12,7 @@ + - configure.in: allow cross compilation. + - README: update mailing list subscription info. + - allow non root user to check status. ++- fix recursive mount deadlock. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/direct.c b/daemon/direct.c +index 7e2f0d7..3e09c5d 100644 +--- a/daemon/direct.c ++++ b/daemon/direct.c +@@ -1285,6 +1285,8 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ + struct timespec wait; + struct timeval now; + int ioctlfd, len, state; ++ unsigned int kver_major = get_kver_major(); ++ unsigned int kver_minor = get_kver_minor(); + + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); + +@@ -1297,8 +1299,16 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ + * cache entry we will not be able to find the mapent. So + * we must take the source writelock to ensure the parent + * has mount is complete before we look for the entry. ++ * ++ * Since the vfs-automount kernel changes we can now block ++ * on covered mounts during mount tree construction so a ++ * write lock is no longer needed. So we now can handle a ++ * wider class of recursively define mount lookups. + */ +- master_source_writelock(ap->entry); ++ if (kver_major > 5 || (kver_major == 5 && kver_minor > 1)) ++ master_source_readlock(ap->entry); ++ else ++ master_source_writelock(ap->entry); + map = ap->entry->maps; + while (map) { + /* +@@ -1311,7 +1321,7 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ + } + + mc = map->mc; +- cache_writelock(mc); ++ cache_readlock(mc); + me = cache_lookup_ino(mc, pkt->dev, pkt->ino); + if (me) + break; diff --git a/SOURCES/autofs-5.0.6-increase-file-map-read-buffer-size.patch b/SOURCES/autofs-5.0.6-increase-file-map-read-buffer-size.patch new file mode 100644 index 0000000..39b2221 --- /dev/null +++ b/SOURCES/autofs-5.0.6-increase-file-map-read-buffer-size.patch @@ -0,0 +1,38 @@ +autofs-5.0.6 - increase file map read buffer size + +From: Ian Kent + +The file map entry read buffer can be too small for larger +multi-mount map entries so increase it. +--- + + CHANGELOG | 1 + + include/automount.h | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 9cdad6e..3bdf8a4 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -13,6 +13,7 @@ + - README: update mailing list subscription info. + - allow non root user to check status. + - fix recursive mount deadlock. ++- increase file map read buffer size. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/include/automount.h b/include/automount.h +index 561fcc2..37541f5 100644 +--- a/include/automount.h ++++ b/include/automount.h +@@ -233,7 +233,7 @@ int rmdir_path(struct autofs_point *ap, const char *path, dev_t dev); + #define AUTOFS_LOOKUP_VERSION 5 + + #define KEY_MAX_LEN NAME_MAX +-#define MAPENT_MAX_LEN 4095 ++#define MAPENT_MAX_LEN 16384 + #define PARSE_MAX_BUF KEY_MAX_LEN + MAPENT_MAX_LEN + 2 + + int lookup_nss_read_master(struct master *master, time_t age); diff --git a/SOURCES/autofs-5.0.7-README-update-mailing-list-subscription-info.patch b/SOURCES/autofs-5.0.7-README-update-mailing-list-subscription-info.patch new file mode 100644 index 0000000..99b6181 --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch b/SOURCES/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch new file mode 100644 index 0000000..5d7d1c2 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch @@ -0,0 +1,35 @@ +autofs-5.0.7 - add after sssd dependency to unit file + +From: Ian Kent + +When using sss as a map source autofs can sometimes start before +sssd is ready. +--- + CHANGELOG | 1 + + samples/autofs.service.in | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 7749f01..2734fe3 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -55,6 +55,7 @@ + - fix add null check in parse_server_string(). + - don't override LDFLAGS in make rules. + - fix a couple of compiler warnings. ++- add after sssd dependency to unit file. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/samples/autofs.service.in b/samples/autofs.service.in +index 056ab5e..777463d 100644 +--- a/samples/autofs.service.in ++++ b/samples/autofs.service.in +@@ -1,6 +1,6 @@ + [Unit] + Description=Automounts filesystems on demand +-After=network.target ypbind.service ++After=network.target ypbind.service sssd.service + + [Service] + Type=forking diff --git a/SOURCES/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch b/SOURCES/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch new file mode 100644 index 0000000..a628512 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch @@ -0,0 +1,48 @@ +autofs-5.0.7 - add changlog entry for coverity fixes + +From: Ian Kent + +A bunch of changes have been made based on a Covarity report. +Mostly I pust the changes into seperate patches so they can be kept simple. + +Changes: +- fix fcntl return check. +- fix spawn_umount() return check in mount_bind.c:lookup_init(). +- fix check mkdir_path() in mount_bind.c:mount_mount(). +- fix incorrect var name in test. +- remove debug only code in alarm.c. +- fix inconsistent use of cache lock in handle_packet_missing_direct(). +- fix several off by one errors. +- fix memory leak in get_dc_list(). +- fix host_addr null reference in add_new_host(). +- add null check in read_one(). +- add pgrp check in do_spawn(). +- fix inconsistent signed usage for __rpc_ping(). +- add null check in extract_version(). +- recheck valid map entry lookup return in do_readmap_mount(). +- add null check in parse_server_string(). +- add map entry null check in do_expire_direct(). +- add mapent null check in lookup_nisplus.c:lookup_mount(). +- fix potential null dereference in lookup_mount(). +- fix leaked ldap percent hack allocation in lookup_one(). +- fix incorrect value reference in parse_line(). +- add debug alert for waitpid in check_nfs_mount_version(). +- add initialization of bind_result in-do_sasl_bind(). +- fix incorrect check in flag_is_owned(). +- fix possible use after free in lookup_dir.c:lookup_init(). +--- + CHANGELOG | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CHANGELOG b/CHANGELOG +index 48e9806..25179b1 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -49,6 +49,7 @@ + - fix master map bogus keywork match. + - fix fix map entry duplicate offset detection. + - probe each nfs version in turn for singleton mounts. ++- add changlog entry for coverity fixes. + + 25/07/2012 autofs-5.0.7 + ======================= diff --git a/SOURCES/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch b/SOURCES/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch new file mode 100644 index 0000000..e8c239e --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch @@ -0,0 +1,24 @@ +autofs-5.0.7 - add debug alert for waitpid in check_nfs_mount_version() + +From: Ian Kent + +We don't really case if there's no process to wait for but add a debug +log alert for information. +--- + lib/mounts.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/mounts.c b/lib/mounts.c +index 7b959b8..a6f560e 100644 +--- a/lib/mounts.c ++++ b/lib/mounts.c +@@ -287,7 +287,8 @@ int check_nfs_mount_version(struct nfs_mount_vers *vers, + ret = 0; + } + +- if (waitpid(f, &status, 0) != f) ; ++ if (waitpid(f, &status, 0) != f) ++ debug(LOGOPT_NONE, "no process found to wait for"); + + pthread_sigmask(SIG_SETMASK, &oldsig, NULL); + pthread_setcancelstate(cancel_state, NULL); diff --git a/SOURCES/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch b/SOURCES/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch new file mode 100644 index 0000000..c6dd8d5 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch @@ -0,0 +1,691 @@ +autofs-5.0.7 - add enable sloppy mount option to configure + +From: Ian Kent + +Add an option --enable-sloppy-mount or --disable-sloppy-mount to force +or prevent the use of the -s option to mount, thus avoiding the +autodetection. This can be useful in setups where executing mount +might be undesirable, particularly in packaging environments. + +2013-04-04 Martin von Gagern + +References: + * https://bugs.gentoo.org/453778 +--- + CHANGELOG | 1 + aclocal.m4 | 2 + configure | 252 +++++++++++++++++++++++++++++++--------------------------- + configure.in | 10 ++ + 4 files changed, 146 insertions(+), 119 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 61edddf..66c11de 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -42,6 +42,7 @@ + - fix submount tree not all expiring. + - make dump maps check for duplicate indirect mounts. + - document allowed map sources in auto.master. ++- add enable sloppy mount option to configure. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/aclocal.m4 b/aclocal.m4 +index 47bca0c..c5de159 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -66,7 +66,7 @@ AC_DEFUN(AF_SLOPPY_MOUNT, + [if test -n "$MOUNT" ; then + AC_MSG_CHECKING([if mount accepts the -s option]) + if "$MOUNT" -s > /dev/null 2>&1 ; then +- AC_DEFINE(HAVE_SLOPPY_MOUNT, 1, [define if the mount command supports the -s option]) ++ enable_sloppy_mount=yes + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +diff --git a/configure b/configure +index c1423d8..08b7ccc 100755 +--- a/configure ++++ b/configure +@@ -1,11 +1,9 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.68. ++# Generated by GNU Autoconf 2.69. + # + # +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +-# Foundation, Inc. ++# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. + # + # + # This configure script is free software; the Free Software Foundation +@@ -134,6 +132,31 @@ export LANGUAGE + # CDPATH. + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + ++# Use a proper internal environment variable to ensure we don't fall ++ # into an infinite loop, continuously re-executing ourselves. ++ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then ++ _as_can_reexec=no; export _as_can_reexec; ++ # We cannot yet assume a decent shell, so we have to provide a ++# neutralization value for shells without unset; and this also ++# works around shells that cannot unset nonexistent variables. ++# Preserve -v and -x to the replacement shell. ++BASH_ENV=/dev/null ++ENV=/dev/null ++(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV ++case $- in # (((( ++ *v*x* | *x*v* ) as_opts=-vx ;; ++ *v* ) as_opts=-v ;; ++ *x* ) as_opts=-x ;; ++ * ) as_opts= ;; ++esac ++exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} ++# Admittedly, this is quite paranoid, since all the known shells bail ++# out after a failed `exec'. ++$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 ++as_fn_exit 255 ++ fi ++ # We don't want this to propagate to other subprocesses. ++ { _as_can_reexec=; unset _as_can_reexec;} + if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh +@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + else + exitcode=1; echo positional parameters were not saved. + fi +-test x\$exitcode = x0 || exit 1" ++test x\$exitcode = x0 || exit 1 ++test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && +@@ -212,21 +236,25 @@ IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : +- # We cannot yet assume a decent shell, so we have to provide a +- # neutralization value for shells without unset; and this also +- # works around shells that cannot unset nonexistent variables. +- # Preserve -v and -x to the replacement shell. +- BASH_ENV=/dev/null +- ENV=/dev/null +- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +- export CONFIG_SHELL +- case $- in # (((( +- *v*x* | *x*v* ) as_opts=-vx ;; +- *v* ) as_opts=-v ;; +- *x* ) as_opts=-x ;; +- * ) as_opts= ;; +- esac +- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} ++ export CONFIG_SHELL ++ # We cannot yet assume a decent shell, so we have to provide a ++# neutralization value for shells without unset; and this also ++# works around shells that cannot unset nonexistent variables. ++# Preserve -v and -x to the replacement shell. ++BASH_ENV=/dev/null ++ENV=/dev/null ++(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV ++case $- in # (((( ++ *v*x* | *x*v* ) as_opts=-vx ;; ++ *v* ) as_opts=-v ;; ++ *x* ) as_opts=-x ;; ++ * ) as_opts= ;; ++esac ++exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} ++# Admittedly, this is quite paranoid, since all the known shells bail ++# out after a failed `exec'. ++$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 ++exit 255 + fi + + if test x$as_have_required = xno; then : +@@ -328,6 +356,14 @@ $as_echo X"$as_dir" | + + + } # as_fn_mkdir_p ++ ++# as_fn_executable_p FILE ++# ----------------------- ++# Test if FILE is an executable regular file. ++as_fn_executable_p () ++{ ++ test -f "$1" && test -x "$1" ++} # as_fn_executable_p + # as_fn_append VAR VALUE + # ---------------------- + # Append the text in VALUE to the end of the definition contained in VAR. Take +@@ -449,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + ++ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have ++ # already done that, so ensure we don't try to do so again and fall ++ # in an infinite loop. This has already happened in practice. ++ _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). +@@ -483,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +- # In both cases, we have to default to `cp -p'. ++ # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + fi + else +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + fi + rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file + rmdir conf$$.dir 2>/dev/null +@@ -504,28 +544,8 @@ else + as_mkdir_p=false + fi + +-if test -x / >/dev/null 2>&1; then +- as_test_x='test -x' +-else +- if ls -dL / >/dev/null 2>&1; then +- as_ls_L_option=L +- else +- as_ls_L_option= +- fi +- as_test_x=' +- eval sh -c '\'' +- if test -d "$1"; then +- test -d "$1/."; +- else +- case $1 in #( +- -*)set "./$1";; +- esac; +- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( +- ???[sx]*):;;*)false;;esac;fi +- '\'' sh +- ' +-fi +-as_executable_p=$as_test_x ++as_test_x='test -x' ++as_executable_p=as_fn_executable_p + + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +@@ -715,6 +735,7 @@ with_fifodir + with_flagdir + with_libtirpc + with_dmalloc ++enable_sloppy_mount + with_hesiod + with_openldap + with_sasl +@@ -1187,8 +1208,6 @@ target=$target_alias + if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe +- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. +- If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +@@ -1341,6 +1360,7 @@ Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-sloppy-mount enable the use of the -s option to mount + --disable-ext-env disable search in environment for substitution variable + --disable-mount-locking disable use of locking when spawning mount command + --enable-force-shutdown enable USR1 signal to force unlink umount of any +@@ -1442,9 +1462,9 @@ test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF + configure +-generated by GNU Autoconf 2.68 ++generated by GNU Autoconf 2.69 + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2012 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1520,7 +1540,7 @@ $as_echo "$ac_try_echo"; } >&5 + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || +- $as_test_x conftest$ac_exeext ++ test -x conftest$ac_exeext + }; then : + ac_retval=0 + else +@@ -1740,7 +1760,7 @@ This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + + It was created by $as_me, which was +-generated by GNU Autoconf 2.68. Invocation command line was ++generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +@@ -2324,7 +2344,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -2364,7 +2384,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -2417,7 +2437,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -2458,7 +2478,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +@@ -2516,7 +2536,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -2560,7 +2580,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3006,8 +3026,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +-#include +-#include ++struct stat; + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); +@@ -3209,7 +3228,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MOUNT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3269,7 +3288,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MOUNT_NFS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3329,7 +3348,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_UMOUNT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3389,7 +3408,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_E2FSCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3448,7 +3467,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_E3FSCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3507,7 +3526,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_E4FSCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3566,7 +3585,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MODPROBE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3626,7 +3645,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LEX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3682,7 +3701,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_YACC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3738,7 +3757,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RANLIB="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3794,7 +3813,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_RPCGEN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3858,13 +3877,19 @@ fi + # Newer mounts have the -s (sloppy) option to ignore unknown options, + # good for portability + # +-if test -n "$MOUNT" ; then ++# Check whether --enable-sloppy-mount was given. ++if test "${enable_sloppy_mount+set}" = set; then : ++ enableval=$enable_sloppy_mount; ++else ++ enable_sloppy_mount=auto ++fi ++ ++if test x$enable_sloppy_mount = xauto; then ++ if test -n "$MOUNT" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if mount accepts the -s option" >&5 + $as_echo_n "checking if mount accepts the -s option... " >&6; } + if "$MOUNT" -s > /dev/null 2>&1 ; then +- +-$as_echo "#define HAVE_SLOPPY_MOUNT 1" >>confdefs.h +- ++ enable_sloppy_mount=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -3872,6 +3897,12 @@ $as_echo "yes" >&6; } + $as_echo "no" >&6; } + fi + fi ++fi ++if test x$enable_sloppy_mount = xyes; then ++ ++$as_echo "#define HAVE_SLOPPY_MOUNT 1" >>confdefs.h ++ ++fi + + # LDAP SASL auth needs libxml and Kerberos + for ac_prog in xml2-config +@@ -3894,7 +3925,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3969,7 +4000,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4387,7 +4418,7 @@ do + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue ++ as_fn_executable_p "$ac_path_GREP" || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP + case `"$ac_path_GREP" --version 2>&1` in +@@ -4453,7 +4484,7 @@ do + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" +- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue ++ as_fn_executable_p "$ac_path_EGREP" || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP + case `"$ac_path_EGREP" --version 2>&1` in +@@ -4928,7 +4959,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4968,7 +4999,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5021,7 +5052,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5062,7 +5093,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +@@ -5120,7 +5151,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5164,7 +5195,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5360,8 +5391,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + #include +-#include +-#include ++struct stat; + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); +@@ -5882,16 +5912,16 @@ if (echo >conf$$.file) 2>/dev/null; then + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +- # In both cases, we have to default to `cp -p'. ++ # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + fi + else +- as_ln_s='cp -p' ++ as_ln_s='cp -pR' + fi + rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file + rmdir conf$$.dir 2>/dev/null +@@ -5951,28 +5981,16 @@ else + as_mkdir_p=false + fi + +-if test -x / >/dev/null 2>&1; then +- as_test_x='test -x' +-else +- if ls -dL / >/dev/null 2>&1; then +- as_ls_L_option=L +- else +- as_ls_L_option= +- fi +- as_test_x=' +- eval sh -c '\'' +- if test -d "$1"; then +- test -d "$1/."; +- else +- case $1 in #( +- -*)set "./$1";; +- esac; +- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( +- ???[sx]*):;;*)false;;esac;fi +- '\'' sh +- ' +-fi +-as_executable_p=$as_test_x ++ ++# as_fn_executable_p FILE ++# ----------------------- ++# Test if FILE is an executable regular file. ++as_fn_executable_p () ++{ ++ test -f "$1" && test -x "$1" ++} # as_fn_executable_p ++as_test_x='test -x' ++as_executable_p=as_fn_executable_p + + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +@@ -5994,7 +6012,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + # values after options handling. + ac_log=" + This file was extended by $as_me, which was +-generated by GNU Autoconf 2.68. Invocation command line was ++generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -6056,10 +6074,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ + config.status +-configured by $0, generated by GNU Autoconf 2.68, ++configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2012 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -6147,7 +6165,7 @@ fi + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + if \$ac_cs_recheck; then +- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' +diff --git a/configure.in b/configure.in +index 4029375..559045a 100644 +--- a/configure.in ++++ b/configure.in +@@ -157,7 +157,15 @@ AC_SUBST(sssldir) + # Newer mounts have the -s (sloppy) option to ignore unknown options, + # good for portability + # +-AF_SLOPPY_MOUNT() ++AC_ARG_ENABLE(sloppy-mount, ++[ --enable-sloppy-mount enable the use of the -s option to mount],, ++ enable_sloppy_mount=auto) ++if test x$enable_sloppy_mount = xauto; then ++ AF_SLOPPY_MOUNT() ++fi ++if test x$enable_sloppy_mount = xyes; then ++ AC_DEFINE(HAVE_SLOPPY_MOUNT, 1, [define if the mount command supports the -s option]) ++fi + + # LDAP SASL auth needs libxml and Kerberos + AF_CHECK_LIBXML() diff --git a/SOURCES/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch b/SOURCES/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch new file mode 100644 index 0000000..0066b9b --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch @@ -0,0 +1,23 @@ +autofs-5.0.7 - add initialization of bind_result in-do_sasl_bind() + +From: Ian Kent + +There is an unlikley code path where bind_result could be used uninitialized +so initialize it so it isn't incorrectly used if it has rubish in it. +--- + modules/cyrus-sasl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/cyrus-sasl.c b/modules/cyrus-sasl.c +index b456333..68f9242 100644 +--- a/modules/cyrus-sasl.c ++++ b/modules/cyrus-sasl.c +@@ -210,7 +210,7 @@ int + do_sasl_bind(unsigned logopt, LDAP *ld, sasl_conn_t *conn, const char **clientout, + unsigned int *clientoutlen, const char *auth_mech, int sasl_result) + { +- int ret, msgid, bind_result; ++ int ret, msgid, bind_result = LDAP_OTHER; + struct berval client_cred, *server_cred, temp_cred; + LDAPMessage *results; + int have_data, expected_data; diff --git a/SOURCES/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch b/SOURCES/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch new file mode 100644 index 0000000..165eec5 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch @@ -0,0 +1,25 @@ +autofs-5.0.7 - add map entry null check in do_expire_direct() + +From: Ian Kent + +Since we've seen a mount failure for this map entry it should exist +but add a null check in case it's been removed while we waited on +the lock. +--- + daemon/direct.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/daemon/direct.c b/daemon/direct.c +index 399ad0a..f85e1b5 100644 +--- a/daemon/direct.c ++++ b/daemon/direct.c +@@ -1019,7 +1019,8 @@ static void *do_expire_direct(void *arg) + struct mapent *me; + cache_writelock(mt.mc); + me = cache_lookup_distinct(mt.mc, mt.name); +- me->ioctlfd = -1; ++ if (me) ++ me->ioctlfd = -1; + cache_unlock(mt.mc); + ops->send_ready(ap->logopt, mt.ioctlfd, mt.wait_queue_token); + ops->close(ap->logopt, mt.ioctlfd); diff --git a/SOURCES/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch b/SOURCES/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch new file mode 100644 index 0000000..9cda9df --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch @@ -0,0 +1,24 @@ +autofs-5.0.7 - add mapent null check in lookup_nisplus.c:lookup_mount() + +From: Ian Kent + +malloc(3) could return null under low memory conditions, add a null check +for this case. +--- + modules/lookup_nisplus.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c +index 8237a1e..ef942a7 100644 +--- a/modules/lookup_nisplus.c ++++ b/modules/lookup_nisplus.c +@@ -584,7 +584,8 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + if (me && (me->source == source || *me->key == '/')) { + mapent_len = strlen(me->mapent); + mapent = malloc(mapent_len + 1); +- strcpy(mapent, me->mapent); ++ if (mapent) ++ strcpy(mapent, me->mapent); + } + } + cache_unlock(mc); diff --git a/SOURCES/autofs-5.0.7-add-null-check-in-extract_version.patch b/SOURCES/autofs-5.0.7-add-null-check-in-extract_version.patch new file mode 100644 index 0000000..93bd2ac --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-null-check-in-extract_version.patch @@ -0,0 +1,23 @@ +autofs-5.0.7 - add null check in extract_version() + +From: Ian Kent + +A space should always be found in the passed in string but a check +should be done in case it isn't. +--- + lib/mounts.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/mounts.c b/lib/mounts.c +index 0caa0aa..7b959b8 100644 +--- a/lib/mounts.c ++++ b/lib/mounts.c +@@ -168,6 +168,8 @@ unsigned int get_kver_minor(void) + static int extract_version(char *start, struct nfs_mount_vers *vers) + { + char *s_ver = strchr(start, ' '); ++ if (!s_ver) ++ return 0; + while (*s_ver && !isdigit(*s_ver)) { + s_ver++; + if (!*s_ver) diff --git a/SOURCES/autofs-5.0.7-add-null-check-in-parse_server_string.patch b/SOURCES/autofs-5.0.7-add-null-check-in-parse_server_string.patch new file mode 100644 index 0000000..e5a0adb --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-null-check-in-parse_server_string.patch @@ -0,0 +1,26 @@ +autofs-5.0.7 - add null check in parse_server_string() + +From: Ian Kent + +Add an error check for the case there's no ':' server name delimiter in +parse_server_string(). +--- + modules/lookup_ldap.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 17cbe9a..a59de92 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -1212,6 +1212,11 @@ static int parse_server_string(unsigned logopt, const char *url, struct lookup_c + /* Isolate the server. Include the port spec */ + if (*ptr != '[') + q = strchr(ptr, ':'); ++ if (!q) { ++ crit(logopt, MODPREFIX ++ "LDAP server name not found in %s", ptr); ++ return 0; ++ } + else { + q = ++ptr; + while (*q == ':' || isxdigit(*q)) diff --git a/SOURCES/autofs-5.0.7-add-null-check-in-read_one.patch b/SOURCES/autofs-5.0.7-add-null-check-in-read_one.patch new file mode 100644 index 0000000..a830bc9 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-null-check-in-read_one.patch @@ -0,0 +1,26 @@ +autofs-5.0.7 - add null check in read_one() + +From: Ian Kent + +The pointter p shouldn't be null here but add a chack anyway. +--- + modules/lookup_file.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/modules/lookup_file.c b/modules/lookup_file.c +index 65e5ee6..2836996 100644 +--- a/modules/lookup_file.c ++++ b/modules/lookup_file.c +@@ -302,8 +302,10 @@ static int read_one(unsigned logopt, FILE *f, char *key, unsigned int *k_len, ch + if (gotten == got_real || gotten == getting) + goto got_it; + } else if (mapent_len < MAPENT_MAX_LEN) { +- mapent_len++; +- *(p++) = ch; ++ if (p) { ++ mapent_len++; ++ *(p++) = ch; ++ } + nch = getc(f); + if (nch == EOF && + (gotten == got_real || gotten == getting)) diff --git a/SOURCES/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch b/SOURCES/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch new file mode 100644 index 0000000..6674f6d --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch @@ -0,0 +1,23 @@ +autofs-5.0.7 - add pgrp check in do_spawn() + +From: Ian Kent + +The process group should never be negative here but add a check anyway. +--- + daemon/spawn.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/daemon/spawn.c b/daemon/spawn.c +index 9b8d5a2..abb353a 100644 +--- a/daemon/spawn.c ++++ b/daemon/spawn.c +@@ -201,7 +201,8 @@ static int do_spawn(unsigned logopt, unsigned int wait, + + seteuid(0); + setegid(0); +- setpgid(0, pgrp); ++ if (pgrp >= 0) ++ setpgid(0, pgrp); + } + + execv(prog, (char *const *) argv); diff --git a/SOURCES/autofs-5.0.7-add-symlink-pseudo-option.patch b/SOURCES/autofs-5.0.7-add-symlink-pseudo-option.patch new file mode 100644 index 0000000..b0440f4 --- /dev/null +++ b/SOURCES/autofs-5.0.7-add-symlink-pseudo-option.patch @@ -0,0 +1,217 @@ +autofs-5.0.7 - add symlink pseudo option + +From: Ian Kent + +Add a "symlink" pseudo option to tell the bind mount module to symlink +instead of bind when mounting mounts other than direct mounts and +non-root indirect mount offset mounts (aka. non-root multi-mount +entries). +--- + CHANGELOG | 1 + + include/automount.h | 3 +++ + lib/master_parse.y | 8 +++++++- + lib/master_tok.l | 1 + + man/auto.master.5.in | 8 ++++++++ + modules/mount_autofs.c | 5 +++++ + modules/mount_bind.c | 36 +++++++++++++++++++++++++++++++++++- + 7 files changed, 60 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index c189483..247d334 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -32,6 +32,7 @@ + - fix wildcard multi map regression. + - fix file descriptor leak when reloading the daemon. + - depricate nosymlink pseudo option. ++- add symlink pseudo option. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/include/automount.h b/include/automount.h +index 37541f5..e72fa0d 100644 +--- a/include/automount.h ++++ b/include/automount.h +@@ -455,6 +455,9 @@ struct kernel_mod_version { + /* Don't use bind mounts even when system supports them */ + #define MOUNT_FLAG_NOBIND 0x0020 + ++/* Use symlinks instead of bind mounting local mounts */ ++#define MOUNT_FLAG_SYMLINK 0x0040 ++ + struct autofs_point { + pthread_t thid; + char *path; /* Mount point name */ +diff --git a/lib/master_parse.y b/lib/master_parse.y +index f925b5a..11caf5b 100644 +--- a/lib/master_parse.y ++++ b/lib/master_parse.y +@@ -57,6 +57,7 @@ static char *type; + static char *format; + static long timeout; + static long negative_timeout; ++static unsigned symlnk; + static unsigned nobind; + static unsigned ghost; + extern unsigned global_selection_options; +@@ -100,7 +101,7 @@ static int master_fprintf(FILE *, char *, ...); + %token COMMENT + %token MAP + %token OPT_TIMEOUT OPT_NTIMEOUT OPT_NOBIND OPT_NOGHOST OPT_GHOST OPT_VERBOSE +-%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT ++%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT OPT_SYMLINK + %token COLON COMMA NL DDASH + %type map + %type options +@@ -186,6 +187,7 @@ line: + | PATH OPT_USE_WEIGHT { master_notify($1); YYABORT; } + | PATH OPT_DEBUG { master_notify($1); YYABORT; } + | PATH OPT_TIMEOUT { master_notify($1); YYABORT; } ++ | PATH OPT_SYMLINK { master_notify($1); YYABORT; } + | PATH OPT_NOBIND { master_notify($1); YYABORT; } + | PATH OPT_GHOST { master_notify($1); YYABORT; } + | PATH OPT_NOGHOST { master_notify($1); YYABORT; } +@@ -557,6 +559,7 @@ option: daemon_option + + daemon_option: OPT_TIMEOUT NUMBER { timeout = $2; } + | OPT_NTIMEOUT NUMBER { negative_timeout = $2; } ++ | OPT_SYMLINK { symlnk = 1; } + | OPT_NOBIND { nobind = 1; } + | OPT_NOGHOST { ghost = 0; } + | OPT_GHOST { ghost = 1; } +@@ -627,6 +630,7 @@ static void local_init_vars(void) + debug = 0; + timeout = -1; + negative_timeout = 0; ++ symlnk = 0; + nobind = 0; + ghost = defaults_get_browse_mode(); + random_selection = global_selection_options & MOUNT_FLAG_RANDOM_SELECT; +@@ -811,6 +815,8 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne + entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT; + if (use_weight) + entry->ap->flags |= MOUNT_FLAG_USE_WEIGHT_ONLY; ++ if (symlnk) ++ entry->ap->flags |= MOUNT_FLAG_SYMLINK; + if (negative_timeout) + entry->ap->negative_timeout = negative_timeout; + +diff --git a/lib/master_tok.l b/lib/master_tok.l +index 30abb15..f9b4e55 100644 +--- a/lib/master_tok.l ++++ b/lib/master_tok.l +@@ -361,6 +361,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo + return(NUMBER); + } + ++ -?symlink { return(OPT_SYMLINK); } + -?nobind { return(OPT_NOBIND); } + -?nobrowse { return(OPT_NOGHOST); } + -g|--ghost|-?browse { return(OPT_GHOST); } +diff --git a/man/auto.master.5.in b/man/auto.master.5.in +index 8007542..bbea43a 100644 +--- a/man/auto.master.5.in ++++ b/man/auto.master.5.in +@@ -159,6 +159,14 @@ on individual map entries of both types. Bind mounting of NFS file + systems can also be prevented for specific map entrys by adding the + "port=" mount option to the entries. + .TP ++.I "symlink" ++This option makes bind mounting use a symlink instead of an actual bind ++mount. It is an autofs specific option that is a pseudo mount option and ++so is given without a leading dash. It may be used with indirect map ++entries only, either in the master map (so it effects all map entries) ++or with individual map entries. The option is ignored for direct mounts ++and non-root offest mount entries. ++.TP + .I "\-r, \-\-random-multimount-selection" + Enables the use of ramdom selection when choosing a host from a + list of replicated servers. This option is applied to this mount +diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c +index ef16020..8c1e600 100644 +--- a/modules/mount_autofs.c ++++ b/modules/mount_autofs.c +@@ -51,6 +51,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, + int argc, status; + int nobind = ap->flags & MOUNT_FLAG_NOBIND; + int ghost = ap->flags & MOUNT_FLAG_GHOST; ++ int symlnk = ap->flags & MOUNT_FLAG_SYMLINK; + time_t timeout = ap->entry->maps->exp_timeout; + unsigned logopt = ap->logopt; + struct map_type_info *info; +@@ -120,6 +121,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, + nobind = 1; + else if (strncmp(cp, "browse", 6) == 0) + ghost = 1; ++ else if (strncmp(cp, "symlink", 7) == 0) ++ symlnk = 1; + else if (strncmp(cp, "timeout=", 8) == 0) { + char *val = strchr(cp, '='); + unsigned tout; +@@ -158,6 +161,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, + } + nap = entry->ap; + nap->parent = ap; ++ if (symlnk) ++ nap->flags |= MOUNT_FLAG_SYMLINK; + + argc = 1; + +diff --git a/modules/mount_bind.c b/modules/mount_bind.c +index 9bce686..4975294 100644 +--- a/modules/mount_bind.c ++++ b/modules/mount_bind.c +@@ -73,10 +73,44 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + char buf[MAX_ERR_BUF]; + int err; + int i, len; ++ int symlnk = (*name != '/' && (ap->flags & MOUNT_FLAG_SYMLINK)); + + if (ap->flags & MOUNT_FLAG_REMOUNT) + return 0; + ++ /* Extract "symlink" pseudo-option which forces local filesystems ++ * to be symlinked instead of bound. ++ */ ++ if (*name != '/' && !symlnk && options) { ++ const char *comma; ++ int o_len = strlen(options) + 1; ++ ++ for (comma = options; *comma != '\0';) { ++ const char *cp; ++ const char *end; ++ ++ while (*comma == ',') ++ comma++; ++ ++ /* Skip leading white space */ ++ while (*comma == ' ' || *comma == '\t') ++ comma++; ++ ++ cp = comma; ++ while (*comma != '\0' && *comma != ',') ++ comma++; ++ ++ /* Skip trailing white space */ ++ end = comma - 1; ++ while (*comma == ' ' || *comma == '\t') ++ end--; ++ ++ o_len = end - cp + 1; ++ if (strncmp("symlink", cp, o_len) == 0) ++ symlnk = 1; ++ } ++ } ++ + /* Root offset of multi-mount */ + len = strlen(root); + if (root[len - 1] == '/') { +@@ -100,7 +134,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + if (options == NULL || *options == '\0') + options = "defaults"; + +- if (bind_works) { ++ if (!symlnk && bind_works) { + int status, existed = 1; + + debug(ap->logopt, MODPREFIX "calling mkdir_path %s", fullpath); diff --git a/SOURCES/autofs-5.0.7-add-timeout-option-description-to-man-page.patch b/SOURCES/autofs-5.0.7-add-timeout-option-description-to-man-page.patch new file mode 100644 index 0000000..ac598dd --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/SOURCES/autofs-5.0.7-allow-non-root-user-to-check-status.patch new file mode 100644 index 0000000..6020c31 --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch b/SOURCES/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch new file mode 100644 index 0000000..c342d10 --- /dev/null +++ b/SOURCES/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch @@ -0,0 +1,50 @@ +autofs-5.0.7 - Allow nsswitch.conf to not contain "automount:" lines + +From: Michael Tokarev + +Current code does not allow a case when nsswitch.conf +does not mention automount map at all, like all new +installations. It logs a rather unpleasant error +message instead: + + syntax error in nsswitch config near [ syntax error ] + +this patch has a minimal fix, to allo "file" to be empty. + +Whole parser in C is about 25 lines of code, the "grammar" +is trivial, and it is better to ditch all this yacc/lex +stuff, but that will be much more intrusive change. + +Signed-off-by: Michael Tokarev +Cc: 682266@bugs.debian.org +--- + + CHANGELOG | 1 + + lib/nss_parse.y | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index bd0dd82..16ac2a0 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -16,6 +16,7 @@ + - increase file map read buffer size. + - handle new location of systemd. + - fix map entry duplicate offset detection. ++- Allow nsswitch.conf to not contain "automount:" lines. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/nss_parse.y b/lib/nss_parse.y +index a39fda4..055e9d7 100644 +--- a/lib/nss_parse.y ++++ b/lib/nss_parse.y +@@ -72,6 +72,7 @@ file: { + nss_debug = YYDEBUG; + #endif + } sources NL ++ | /* empty */ + ; + + sources: nss_source diff --git a/SOURCES/autofs-5.0.7-check-for-protocol-option.patch b/SOURCES/autofs-5.0.7-check-for-protocol-option.patch new file mode 100644 index 0000000..5a3464b --- /dev/null +++ b/SOURCES/autofs-5.0.7-check-for-protocol-option.patch @@ -0,0 +1,38 @@ +autofs-5.0.7 - check for protocol option + +From: Ian Kent + +When a specific protocol is requested in the mount options only +that protocol should be probed for. +--- + modules/mount_nfs.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 9de8a73..3d2ccea 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -156,6 +156,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + if (port < 0) + port = 0; + port_opt = cp; ++ } else if (strncmp("proto=udp", cp, o_len) == 0 || ++ strncmp("udp", cp, o_len) == 0) { ++ vers &= ~TCP_SUPPORTED; ++ } else if (strncmp("proto=tcp", cp, o_len) == 0 || ++ strncmp("tcp", cp, o_len) == 0) { ++ vers &= ~UDP_SUPPORTED; + } + /* Check for options that also make sense + with bind mounts */ +@@ -167,6 +173,10 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + } + } + ++ /* In case both tcp and udp options were given */ ++ if ((vers & NFS_PROTO_MASK) == 0) ++ vers |= NFS_PROTO_MASK; ++ + debug(ap->logopt, MODPREFIX + "nfs options=\"%s\", nobind=%d, nosymlink=%d, ro=%d", + nfsoptions, nobind, nosymlink, ro); diff --git a/SOURCES/autofs-5.0.7-configure-allow-cross-compilation-update.patch b/SOURCES/autofs-5.0.7-configure-allow-cross-compilation-update.patch new file mode 100644 index 0000000..a8bc3ce --- /dev/null +++ b/SOURCES/autofs-5.0.7-configure-allow-cross-compilation-update.patch @@ -0,0 +1,28 @@ +autofs-5.0.7 - configure: allow cross compilation update + +From: Chris Packham + +Run "make distclean" to update configure. This should have been included +in 5936c738 when configure.in was updated but it was missed. +--- + + configure | 5 +---- + 1 files changed, 1 insertions(+), 4 deletions(-) + + +diff --git a/configure b/configure +index bf62203..ba3bba6 100755 +--- a/configure ++++ b/configure +@@ -5378,10 +5378,7 @@ DAEMON_LDFLAGS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc -fPIE works" >&5 + $as_echo_n "checking whether gcc -fPIE works... " >&6; } + if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run test program while cross compiling +-See \`config.log' for more details" "$LINENO" 5; } ++ gcc_supports_pie=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ diff --git a/SOURCES/autofs-5.0.7-configure-in-allow-cross-compilation.patch b/SOURCES/autofs-5.0.7-configure-in-allow-cross-compilation.patch new file mode 100644 index 0000000..ac18bd9 --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch b/SOURCES/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch new file mode 100644 index 0000000..c784de7 --- /dev/null +++ b/SOURCES/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch @@ -0,0 +1,40 @@ +autofs-5.0.7 - depricate nosymlink pseudo option + +From: Ian Kent + +The undocumented "nosymlink" option was the only way to force local +NFS mounting until the more descriptive "nobind" option was added. + +So depricate the "nosymlink" option in favour of the "nobind" option. +--- + CHANGELOG | 1 + + modules/mount_nfs.c | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/CHANGELOG b/CHANGELOG +index a7ed212..c189483 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -31,6 +31,7 @@ + - dont fail on master map self include. + - fix wildcard multi map regression. + - fix file descriptor leak when reloading the daemon. ++- depricate nosymlink pseudo option. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index bbbb1de..e61320b 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -125,6 +125,10 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + + o_len = end - cp + 1; + if (strncmp("nosymlink", cp, o_len) == 0) { ++ warn(ap->logopt, MODPREFIX ++ "the \"nosymlink\" option is depricated " ++ "and will soon be removed, " ++ "use the \"nobind\" option instead"); + nosymlink = 1; + } else if (strncmp("nobind", cp, o_len) == 0) { + nobind = 1; diff --git a/SOURCES/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch b/SOURCES/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch new file mode 100644 index 0000000..737b5d1 --- /dev/null +++ b/SOURCES/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch @@ -0,0 +1,48 @@ +autofs-5.0.7 - document allowed map sources in auto.master + +From: Ian Kent + +Direct map may have multiple map sources but indirect maps may have +only one map source. +--- + CHANGELOG | 1 + + man/auto.master.5.in | 7 +++++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 4576d47..61edddf 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -41,6 +41,7 @@ + - syncronize handle_mounts() shutdown. + - fix submount tree not all expiring. + - make dump maps check for duplicate indirect mounts. ++- document allowed map sources in auto.master. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/auto.master.5.in b/man/auto.master.5.in +index c552e56..7907ffa 100644 +--- a/man/auto.master.5.in ++++ b/man/auto.master.5.in +@@ -40,7 +40,8 @@ For direct maps the mount point is always specified as: + .P + /- + .P +-and the key used within the direct map is the full path to the mount point. ++and the key used within the direct map is the full path to the mount point. The direct map ++may have multiple entries in the master map. + .P + For indirect maps access is by using the path scheme: + .P +@@ -60,7 +61,9 @@ present in the master map by including a line of the form: + and + .BR automount (8) + will process the map according to the specification described below for +-map entries. ++map entries. Indirect map entries must be unique in the master map so ++second and subsequent entries for an indirect mount point are ignored by ++.BR automount (8). + .SH "FORMAT" + Master map entries have three fields separated by an arbitrary number + of spaces or tabs. Lines beginning with # are comments. The first field diff --git a/SOURCES/autofs-5.0.7-document-browse-option-in-man-page.patch b/SOURCES/autofs-5.0.7-document-browse-option-in-man-page.patch new file mode 100644 index 0000000..4641342 --- /dev/null +++ b/SOURCES/autofs-5.0.7-document-browse-option-in-man-page.patch @@ -0,0 +1,46 @@ +autofs-5.0.7 - document browse option in man page + +From: Ian Kent + +The "browse" option has remained undocumented for a long time. +Finally add a section for it to auto.master(5) making special +note of the potential performance implications. +--- + CHANGELOG | 1 + + man/auto.master.5.in | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/CHANGELOG b/CHANGELOG +index ecdea0b..d8e4049 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -36,6 +36,7 @@ + - fix requires in spec file. + - fix libtirpc build option to require libtirpc-devel if needed. + - fix systemd unidir in spec file. ++- document browse option in man page. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/auto.master.5.in b/man/auto.master.5.in +index bbea43a..c552e56 100644 +--- a/man/auto.master.5.in ++++ b/man/auto.master.5.in +@@ -147,6 +147,17 @@ multiple file systems should be mounted (`multimounts'). If this option + is given, no file system is mounted at all if at least one file system + can't be mounted. + .TP ++.I "[no]browse" ++This is an autofs specific option that is a pseudo mount option and ++so is given without a leading dash. Use of the browse option pre-creates ++mount point directories for indirect mount maps so the map keys can be ++seen in a directory listing without being mounted. Use of this option ++can cause performance problem if the indirect map is large so it should ++be used with caution. The internal program default is to enable browse ++mode for indirect mounts but the default installed configuration overrides ++this by setting BROWSE_MODE to "no" because of the potential performance ++problem. ++.TP + .I "nobind" + This is an autofs specific option that is a pseudo mount option and + so is given without a leading dash. It may be used either in the master diff --git a/SOURCES/autofs-5.0.7-dont-fail-on-master-map-self-include.patch b/SOURCES/autofs-5.0.7-dont-fail-on-master-map-self-include.patch new file mode 100644 index 0000000..afb908b --- /dev/null +++ b/SOURCES/autofs-5.0.7-dont-fail-on-master-map-self-include.patch @@ -0,0 +1,59 @@ +autofs-5.0.7 - dont fail on master map self include + +From: Ian Kent + +When reading the master map a self included file map should skip the source +and proceed to the next so, in this case, return an nss status that will +allow the map read to continue. In particular not NSS_STATUS_UNAVAIL which +causes the lookup to record a failure or NSS_STATUS_SUCCESS which indicates +a successful lookup and termintes the reading of sources. +--- + CHANGELOG | 1 + + modules/lookup_file.c | 7 ++++--- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 39388a5..97d6f48 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -28,6 +28,7 @@ + - make yellow pages support optional. + - modules/replicated.c: use sin6_addr.s6_addr32. + - workaround missing GNU versionsort extension. ++- dont fail on master map self include. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/lookup_file.c b/modules/lookup_file.c +index facb305..f37bed9 100644 +--- a/modules/lookup_file.c ++++ b/modules/lookup_file.c +@@ -397,8 +397,9 @@ int lookup_read_master(struct master *master, time_t age, void *context) + unsigned int path_len, ent_len; + int entry, cur_state; + ++ /* Don't return fail on self include, skip source */ + if (master->recurse) +- return NSS_STATUS_UNAVAIL; ++ return NSS_STATUS_TRYAGAIN; + + if (master->depth > MAX_INCLUDE_DEPTH) { + error(logopt, MODPREFIX +@@ -443,7 +444,7 @@ int lookup_read_master(struct master *master, time_t age, void *context) + + inc = check_master_self_include(master, ctxt); + if (inc) +- master->recurse = 1;; ++ master->recurse = 1; + master->depth++; + status = lookup_nss_read_master(master, age); + if (!status) { +@@ -645,7 +646,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context) + mc = source->mc; + + if (source->recurse) +- return NSS_STATUS_UNAVAIL; ++ return NSS_STATUS_TRYAGAIN; + + if (source->depth > MAX_INCLUDE_DEPTH) { + error(ap->logopt, diff --git a/SOURCES/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch b/SOURCES/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch new file mode 100644 index 0000000..33db77c --- /dev/null +++ b/SOURCES/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch @@ -0,0 +1,46 @@ +autofs-5.0.7 - don't override LDFLAGS in make rules + +From: Ian Kent + +Ensure that externally defined LDFLAGS is not overridden. +--- + CHANGELOG | 1 + + Makefile.rules | 6 +++--- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 5d90139..37eac72 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -53,6 +53,7 @@ + - fix probe each nfs version in turn for singleton mounts. + - misc man page fixes. + - fix add null check in parse_server_string(). ++- don't override LDFLAGS in make rules. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/Makefile.rules b/Makefile.rules +index f2ba386..6b5b2bd 100644 +--- a/Makefile.rules ++++ b/Makefile.rules +@@ -24,16 +24,16 @@ endif + + ifdef DEBUG + CFLAGS ?= -g -Wall -DDEBUG +-LDFLAGS = -g ++LDFLAGS ?= -g + STRIP = : + else + ifdef DONTSTRIP + CFLAGS ?= -O2 -g +-LDFLAGS = -g ++LDFLAGS ?= -g + STRIP = : + else + CFLAGS ?= -O2 -Wall +-LDFLAGS = -s ++LDFLAGS ?= -s + STRIP = strip --strip-debug + endif + endif diff --git a/SOURCES/autofs-5.0.7-dont-probe-rdma-mounts.patch b/SOURCES/autofs-5.0.7-dont-probe-rdma-mounts.patch new file mode 100644 index 0000000..7dda820 --- /dev/null +++ b/SOURCES/autofs-5.0.7-dont-probe-rdma-mounts.patch @@ -0,0 +1,68 @@ +autofs-5.0.7 - dont probe rdma mounts + +From: Ian Kent + +Since the change to pass text nfs mount options drectly to the kernel all autofs +mount requests now probe server availability. This was because of long delays +mounting from servers that aren't responding. + +This caused mounts requesting the rdma protocol to fail if udp or tcp was also +not available from the server. + +Since, AFAICT the rmda protocol can't be used with RPC fromn userspace, the only +way to work around it is to not probe servers when rdma is requested. +--- + CHANGELOG | 1 + + modules/mount_nfs.c | 13 ++++++++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 50e83d7..f9bc987 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -44,6 +44,7 @@ + - document allowed map sources in auto.master. + - add enable sloppy mount option to configure. + - fix interface address null check. ++- dont probe rdma mounts. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index e61320b..5424d74 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -71,6 +71,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + int nosymlink = 0; + int port = -1; + int ro = 0; /* Set if mount bind should be read-only */ ++ int rdma = 0; + + if (ap->flags & MOUNT_FLAG_REMOUNT) + return 0; +@@ -124,6 +125,11 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + end--; + + o_len = end - cp + 1; ++ ++ if (strncmp("proto=rdma", cp, o_len) == 0 || ++ strncmp("rdma", cp, o_len) == 0) ++ rdma = 1; ++ + if (strncmp("nosymlink", cp, o_len) == 0) { + warn(ap->logopt, MODPREFIX + "the \"nosymlink\" option is depricated " +@@ -170,7 +176,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + info(ap->logopt, MODPREFIX "no hosts available"); + return 1; + } +- prune_host_list(ap->logopt, &hosts, vers, port); ++ /* ++ * We can't probe protocol rdma so leave it to mount.nfs(8) ++ * and and suffer the delay if a server isn't available. ++ */ ++ if (!rdma) ++ prune_host_list(ap->logopt, &hosts, vers, port); + + if (!hosts) { + info(ap->logopt, MODPREFIX "no hosts available"); diff --git a/SOURCES/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch b/SOURCES/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch new file mode 100644 index 0000000..6444687 --- /dev/null +++ b/SOURCES/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch @@ -0,0 +1,69 @@ +autofs-5.0.7 - don't schedule new alarms after readmap + +From: Leonardo Chiquitto + +Currently, a new alarm is scheduled every time the daemon receives +a SIGHUP (map re-read) or SIGUSR1 (forced expiration). Besides that, +map re-reads started on demand when a map is found to be outdated +also generate a new alarm. + +Once added, these alarms are never deleted and hence increase the +number of times the daemon wakes up to run the expiration procedure. +After a couple of months, in setups with many mount points, it's +normal to see automount waking up every second to handle the +expiration timer. + +This patch removes the alarm scheduling from the readmap cleanup +routine and makes sure the alarm is re-added after the expiration +process only when it was not triggered by SIGUSR1. + +I couldn't think of any use case to justify keeping these alarms: +it's critical to have the alarm ticking every timeout/4 seconds, +but more than one periodic alarm running doesn't seem to make +sense. +--- + + CHANGELOG | 1 + + daemon/state.c | 6 +----- + 2 files changed, 2 insertions(+), 5 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index c9be73e..4cf5621 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -22,6 +22,7 @@ + - fix init script status return. + - fix use get_proximity() without libtirpc. + - don't use dirent d_type to filter out files in scandir() ++- don't schedule new alarms after readmap. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/state.c b/daemon/state.c +index b451c56..6e23022 100644 +--- a/daemon/state.c ++++ b/daemon/state.c +@@ -144,7 +144,7 @@ void expire_cleanup(void *arg) + ap->submount = 2; + } + +- if (!ap->submount) ++ if (ap->state == ST_EXPIRE && !ap->submount) + alarm_add(ap, ap->exp_runfreq); + + /* FALLTHROUGH */ +@@ -330,13 +330,9 @@ static void do_readmap_cleanup(void *arg) + ap = ra->ap; + + st_mutex_lock(); +- + ap->readmap_thread = 0; + st_set_done(ap); +- if (!ap->submount) +- alarm_add(ap, ap->exp_runfreq); + st_ready(ap); +- + st_mutex_unlock(); + + free(ra); diff --git a/SOURCES/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch b/SOURCES/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch new file mode 100644 index 0000000..9c9d99b --- /dev/null +++ b/SOURCES/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch @@ -0,0 +1,41 @@ +autofs-5.0.7 - don't use dirent d_type to filter out files in scandir() + +From: Leonardo Chiquitto + +The "d_type" field of a dirent structure is not filled in by all +file systems (XFS being one example), so we can't rely on it to +check file types. +--- + + CHANGELOG | 1 + + modules/lookup_dir.c | 4 ---- + 2 files changed, 1 insertions(+), 4 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 460bd27..c9be73e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -21,6 +21,7 @@ + - fix submount offset delete. + - fix init script status return. + - fix use get_proximity() without libtirpc. ++- don't use dirent d_type to filter out files in scandir() + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c +index 658cc29..33901c0 100644 +--- a/modules/lookup_dir.c ++++ b/modules/lookup_dir.c +@@ -103,10 +103,6 @@ static int acceptable_dirent_p(const struct dirent *e) + { + size_t namesz; + +- +- if (!(e->d_type == DT_REG || e->d_type == DT_LNK)) +- return 0; +- + namesz = strlen(e->d_name); + if (!namesz) + return 0; diff --git a/SOURCES/autofs-5.0.7-dont-wait-forever-to-restart.patch b/SOURCES/autofs-5.0.7-dont-wait-forever-to-restart.patch new file mode 100644 index 0000000..9973b47 --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch b/SOURCES/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch new file mode 100644 index 0000000..d1703d3 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch @@ -0,0 +1,51 @@ +autofs-5.0.7 - fix a couple of compiler warnings + +From: Ian Kent + +Quiet a couple of ompiler warnings by making intention explicit using brackets. +--- + CHANGELOG | 1 + + modules/mount_bind.c | 2 +- + modules/mount_nfs.c | 4 ++-- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 37eac72..7749f01 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -54,6 +54,7 @@ + - misc man page fixes. + - fix add null check in parse_server_string(). + - don't override LDFLAGS in make rules. ++- fix a couple of compiler warnings. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/mount_bind.c b/modules/mount_bind.c +index 61a773c..2b70104 100644 +--- a/modules/mount_bind.c ++++ b/modules/mount_bind.c +@@ -208,7 +208,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + MODPREFIX + "failed to create local mount %s -> %s", + fullpath, what); +- if (ap->flags & MOUNT_FLAG_GHOST && !status) ++ if ((ap->flags & MOUNT_FLAG_GHOST) && !status) + if (mkdir_path(fullpath, 0555) && errno != EEXIST) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + error(ap->logopt, +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 3d2ccea..adf2002 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -202,8 +202,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + */ + if ((hosts && !hosts->next) && + mount_default_proto == 4 && +- vers & NFS_VERS_MASK != 0 && +- vers & NFS4_VERS_MASK != 0) { ++ (vers & NFS_VERS_MASK) != 0 && ++ (vers & NFS4_VERS_MASK) != 0) { + unsigned int v4_probe_ok = 0; + struct host *tmp = new_host(hosts->name, + hosts->addr, hosts->addr_len, diff --git a/SOURCES/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch b/SOURCES/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch new file mode 100644 index 0000000..1e3fc20 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch @@ -0,0 +1,45 @@ +autofs-5.0.7 - fix add null check in parse_server_string() + +From: Ian Kent + +In a recent patch that added an error check for the case there's no ':' server +name delimiter parse_server_string() braces were not added which lead to an +incorrect parse error. +--- + CHANGELOG | 1 + + modules/lookup_ldap.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 503a21e..5d90139 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -52,6 +52,7 @@ + - add changlog entry for coverity fixes. + - fix probe each nfs version in turn for singleton mounts. + - misc man page fixes. ++- fix add null check in parse_server_string(). + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 35ea6ea..a2bfafd 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -1210,14 +1210,14 @@ static int parse_server_string(unsigned logopt, const char *url, struct lookup_c + const char *q = NULL; + + /* Isolate the server. Include the port spec */ +- if (*ptr != '[') ++ if (*ptr != '[') { + q = strchr(ptr, ':'); + if (!q) { + crit(logopt, MODPREFIX + "LDAP server name not found in %s", ptr); + return 0; + } +- else { ++ } else { + q = ++ptr; + while (*q == ':' || isxdigit(*q)) + q++; diff --git a/SOURCES/autofs-5.0.7-fix-automounter-support-on-parisc.patch b/SOURCES/autofs-5.0.7-fix-automounter-support-on-parisc.patch new file mode 100644 index 0000000..e00fdc1 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-automounter-support-on-parisc.patch @@ -0,0 +1,24 @@ +autofs-5.0.7 - fix automounter support on parisc + +From: Helge Deller + +This patch fixes automounter support on the parisc architecture with +64-bit kernel and 32-bit userspace. + +Signed-off-by: Helge Deller +--- + daemon/automount.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/daemon/automount.c b/daemon/automount.c +index 4a3eb3d..4c651cf 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -610,6 +610,7 @@ static size_t get_kpkt_len(void) + if (strcmp(un.machine, "alpha") == 0 || + strcmp(un.machine, "ia64") == 0 || + strcmp(un.machine, "x86_64") == 0 || ++ strcmp(un.machine, "parisc64") == 0 || + strcmp(un.machine, "ppc64") == 0) + pkt_len += 4; + diff --git a/SOURCES/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch b/SOURCES/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch new file mode 100644 index 0000000..74ba6aa --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch @@ -0,0 +1,27 @@ +autofs-5.0.7 - fix check mkdir_path() in mount_bind.c:mount_mount() + +From: Ian Kent + + +--- + modules/mount_bind.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/modules/mount_bind.c b/modules/mount_bind.c +index d6c6fe7..61a773c 100644 +--- a/modules/mount_bind.c ++++ b/modules/mount_bind.c +@@ -209,7 +209,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + "failed to create local mount %s -> %s", + fullpath, what); + if (ap->flags & MOUNT_FLAG_GHOST && !status) +- mkdir_path(fullpath, 0555); ++ if (mkdir_path(fullpath, 0555) && errno != EEXIST) { ++ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); ++ error(ap->logopt, ++ MODPREFIX "mkdir_path %s failed: %s", ++ fullpath, estr); ++ } + else { + if (ap->type == LKP_INDIRECT) + rmdir_path(ap, fullpath, ap->dev); diff --git a/SOURCES/autofs-5.0.7-fix-dumpmaps-multi-output.patch b/SOURCES/autofs-5.0.7-fix-dumpmaps-multi-output.patch new file mode 100644 index 0000000..fd2898e --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-dumpmaps-multi-output.patch @@ -0,0 +1,108 @@ +autofs-5.0.7 - fix dumpmaps multi output + +From: Ian Kent + +If the maps contain the old style "multi" type the dumped map information +isn't right. +--- + CHANGELOG | 1 + lib/master.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++------------ + 2 files changed, 50 insertions(+), 12 deletions(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -58,6 +58,7 @@ + - add after sssd dependency to unit file. + - fix syncronize handle_mounts() shutdown. + - fix fix wildcard multi map regression. ++- fix dumpmaps multi output. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/lib/master.c ++++ autofs-5.0.7/lib/master.c +@@ -1281,6 +1281,54 @@ static void list_source_instances(struct + return; + } + ++static void print_map_info(struct map_source *source) ++{ ++ int argc = source->argc; ++ int i, multi, map_num; ++ ++ multi = (source->type && !strcmp(source->type, "multi")); ++ map_num = 1; ++ for (i = 0; i < argc; i++) { ++ if (source->argv[i] && *source->argv[i] != '-') { ++ if (!multi) ++ printf(" map: %s\n", source->argv[i]); ++ else ++ printf(" map[%i]: %s\n", map_num, source->argv[i]); ++ i++; ++ } ++ ++ if (i >= argc) ++ return; ++ ++ if (!strcmp(source->argv[i], "--")) ++ continue; ++ ++ if (source->argv[i]) { ++ int need_newline = 0; ++ int j; ++ ++ if (!multi) ++ printf(" arguments:"); ++ else ++ printf(" arguments[%i]:", map_num); ++ ++ for (j = i; j < source->argc; j++) { ++ if (!strcmp(source->argv[j], "--")) ++ break; ++ printf(" %s", source->argv[j]); ++ i++; ++ need_newline = 1; ++ } ++ if (need_newline) ++ printf("\n"); ++ } ++ if (multi) ++ map_num++; ++ } ++ ++ return; ++} ++ + int master_show_mounts(struct master *master) + { + struct list_head *p, *head; +@@ -1311,7 +1359,6 @@ int master_show_mounts(struct master *ma + struct autofs_point *ap; + time_t now = time(NULL); + unsigned int count = 0; +- int i; + + this = list_entry(p, struct master_mapent, list); + p = p->next; +@@ -1357,20 +1404,10 @@ int master_show_mounts(struct master *ma + } + + if (source->argc >= 1) { +- i = 0; +- if (source->argv[0] && *source->argv[0] != '-') { +- printf(" map: %s\n", source->argv[0]); +- i = 1; +- } ++ print_map_info(source); + if (count && ap->type == LKP_INDIRECT) + printf(" duplicate indirect map entry" + " will be ignored at run time\n"); +- if (source->argc > 1) { +- printf(" arguments: "); +- for (; i < source->argc; i++) +- printf("%s ", source->argv[i]); +- printf("\n"); +- } + } + + printf("\n"); diff --git a/SOURCES/autofs-5.0.7-fix-fcntl-return-check.patch b/SOURCES/autofs-5.0.7-fix-fcntl-return-check.patch new file mode 100644 index 0000000..ebe9ea8 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-fcntl-return-check.patch @@ -0,0 +1,25 @@ +autofs-5.0.7 - fix fcntl return check + +From: Ian Kent + +When checking for FD_CLOEXEC support the return of the fcntl(2) call to +get the file descriptor flags is not checked which could result in an +incorrect result. +--- + include/automount.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/automount.h b/include/automount.h +index e72fa0d..6ced842 100644 +--- a/include/automount.h ++++ b/include/automount.h +@@ -547,7 +547,8 @@ static inline void check_cloexec(int fd) + { + if (cloexec_works == 0) { + int fl = fcntl(fd, F_GETFD); +- cloexec_works = (fl & FD_CLOEXEC) ? 1 : -1; ++ if (fl != -1) ++ cloexec_works = (fl & FD_CLOEXEC) ? 1 : -1; + } + if (cloexec_works > 0) + return; diff --git a/SOURCES/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch b/SOURCES/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch new file mode 100644 index 0000000..8ce6c0f --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch @@ -0,0 +1,179 @@ +autofs-5.0.7 - fix file descriptor leak when reloading the daemon + +From: Leonardo Chiquitto + +A customer reported that AutoFS may leak file descriptors when some +maps are modified and the daemon reloaded. I'm able to reproduce the +problem on 5.0.7 by following these steps: + +1. Configure a simple direct mount: + +# cat /etc/auto.master +/- /etc/auto.direct + +# cat /etc/auto.direct +/nfs server:/nfs + +2. Start the automounter and do NOT trigger the mount + +3. Replace /etc/auto.direct with: + +# cat /etc/auto.direct +/nfs/1 server:/nfs +/nfs/2 server:/nfs + +4. Reload: + +# kill -HUP $(pidof automount) + +>From now on, every reload will leak a file descriptor: + +# ls -la /proc/$(pidof automount)/fd | grep /nfs +lr-x------ 1 root root 64 Aug 14 22:08 11 -> /nfs +lr-x------ 1 root root 64 Aug 14 22:08 12 -> /nfs +lr-x------ 1 root root 64 Aug 14 22:08 13 -> /nfs +lr-x------ 1 root root 64 Aug 14 22:08 14 -> /nfs +lr-x------ 1 root root 64 Aug 14 22:08 5 -> /nfs + +I've investigated the problem and discovered that the leak happens in +do_umount_autofs_direct(): + +- edit imk +The same leak is present in umount_autofs_offset() also. +Updated patch to cover that too. +- end edit + +int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list +*mnts, struct mapent *me) +{ +(...) + if (me->ioctlfd != -1) { + if (tree_is_mounted(mnts, me->key, MNTS_REAL)) { + error(ap->logopt, + "attempt to umount busy direct mount %s", + me->key); + return 1; + } + ioctlfd = me->ioctlfd; + } else // ioctlfd == -1 + ops->open(ap->logopt, &ioctlfd, me->dev, me->key); <= we open it here + + if (ioctlfd >= 0) { + unsigned int status = 1; + + rv = ops->askumount(ap->logopt, ioctlfd, &status); + /// at this point, rv == 0 and status == 0 + if (rv) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + error(ap->logopt, "ioctl failed: %s", estr); + return 1; + } else if (!status) { + /// at this point, ap->state == ST_READMAP + if (ap->state != ST_SHUTDOWN_FORCE) { + error(ap->logopt, + "ask umount returned busy for %s", + me->key); + return 1; <= we return here, without closing the fd + } else { + me->ioctlfd = -1; + ops->catatonic(ap->logopt, ioctlfd); + ops->close(ap->logopt, ioctlfd); + goto force_umount; + } +(...) +--- + CHANGELOG | 1 + + daemon/direct.c | 19 ++++++++++++++++--- + 2 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 46ef335..a7ed212 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -30,6 +30,7 @@ + - workaround missing GNU versionsort extension. + - dont fail on master map self include. + - fix wildcard multi map regression. ++- fix file descriptor leak when reloading the daemon. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/direct.c b/daemon/direct.c +index 3e09c5d..228a666 100644 +--- a/daemon/direct.c ++++ b/daemon/direct.c +@@ -86,7 +86,8 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru + { + struct ioctl_ops *ops = get_ioctl_ops(); + char buf[MAX_ERR_BUF]; +- int ioctlfd, rv, left, retries; ++ int ioctlfd = -1, rv, left, retries; ++ int opened = 0; + + left = umount_multi(ap, me->key, 0); + if (left) { +@@ -103,8 +104,10 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru + return 1; + } + ioctlfd = me->ioctlfd; +- } else ++ } else { + ops->open(ap->logopt, &ioctlfd, me->dev, me->key); ++ opened = 1; ++ } + + if (ioctlfd >= 0) { + unsigned int status = 1; +@@ -113,12 +116,16 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru + if (rv) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + error(ap->logopt, "ioctl failed: %s", estr); ++ if (opened && ioctlfd != -1) ++ ops->close(ap->logopt, ioctlfd); + return 1; + } else if (!status) { + if (ap->state != ST_SHUTDOWN_FORCE) { + error(ap->logopt, + "ask umount returned busy for %s", + me->key); ++ if (opened && ioctlfd != -1) ++ ops->close(ap->logopt, ioctlfd); + return 1; + } else { + me->ioctlfd = -1; +@@ -536,7 +543,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) + { + struct ioctl_ops *ops = get_ioctl_ops(); + char buf[MAX_ERR_BUF]; +- int ioctlfd, rv = 1, retries; ++ int ioctlfd = -1, rv = 1, retries; ++ int opened = 0; + + if (me->ioctlfd != -1) { + if (is_mounted(_PATH_MOUNTED, me->key, MNTS_REAL)) { +@@ -554,6 +562,7 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) + return 0; + } + ops->open(ap->logopt, &ioctlfd, me->dev, me->key); ++ opened = 1; + } + + if (ioctlfd >= 0) { +@@ -563,6 +572,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) + if (rv) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + logerr("ioctl failed: %s", estr); ++ if (opened && ioctlfd != -1) ++ ops->close(ap->logopt, ioctlfd); + return 1; + } else if (!status) { + if (ap->state != ST_SHUTDOWN_FORCE) { +@@ -570,6 +581,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) + error(ap->logopt, + "ask umount returned busy for %s", + me->key); ++ if (opened && ioctlfd != -1) ++ ops->close(ap->logopt, ioctlfd); + return 1; + } else { + me->ioctlfd = -1; diff --git a/SOURCES/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch b/SOURCES/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch new file mode 100644 index 0000000..82092c0 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch @@ -0,0 +1,37 @@ +autofs-5.0.7 - fix fix map entry duplicate offset detection + +From: Ian Kent + +Map entry duplicate detection was still broken. +This hopefully will fix it, at least the Conectathon duplicate offset entry +tests pass now. +--- + CHANGELOG | 1 + + lib/cache.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index e15aa1f..39d7889 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -47,6 +47,7 @@ + - dont probe rdma mounts. + - fix master map mount options matching. + - fix master map bogus keywork match. ++- fix fix map entry duplicate offset detection. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/cache.c b/lib/cache.c +index 1e05a99..ecace4a 100644 +--- a/lib/cache.c ++++ b/lib/cache.c +@@ -659,7 +659,7 @@ int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *k + + me = cache_lookup_distinct(mc, key); + if (me && me->age == age) { +- if (me->multi == owner) ++ if (me == owner || strcmp(me->key, key) == 0) + return CHE_DUPLICATE; + } + diff --git a/SOURCES/autofs-5.0.7-fix-fix-wildcard-multi-map-regression.patch b/SOURCES/autofs-5.0.7-fix-fix-wildcard-multi-map-regression.patch new file mode 100644 index 0000000..22ff41a --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-fix-wildcard-multi-map-regression.patch @@ -0,0 +1,283 @@ +autofs-5.0.7 - fix fix wildcard multi map regression + +From: Ian Kent + +A recent patch to fix a wildcard multi map mount regression has a +side effect of causing a deadlock at startup when trying to re-connect +to existing mounts. + +The patch required the map entry cache write lock be taken so the cache +could be updated. But when starting and trying to re-connect to existing +mounts there's no need to update the cache. +--- + CHANGELOG | 1 + + modules/lookup_file.c | 25 ++++++++++++++++++++----- + modules/lookup_ldap.c | 23 +++++++++++++++++++---- + modules/lookup_nisplus.c | 26 +++++++++++++++++++++----- + modules/lookup_sss.c | 22 ++++++++++++++++++---- + modules/lookup_yp.c | 23 +++++++++++++++++++---- + 6 files changed, 98 insertions(+), 22 deletions(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -57,6 +57,7 @@ + - fix a couple of compiler warnings. + - add after sssd dependency to unit file. + - fix syncronize handle_mounts() shutdown. ++- fix fix wildcard multi map regression. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/modules/lookup_file.c ++++ autofs-5.0.7/modules/lookup_file.c +@@ -1042,7 +1042,7 @@ int lookup_mount(struct autofs_point *ap + return NSS_STATUS_UNAVAIL; + } + +- cache_writelock(mc); ++ cache_readlock(mc); + me = cache_lookup_first(mc); + if (me && st.st_mtime <= me->age) { + /* +@@ -1084,7 +1084,18 @@ int lookup_mount(struct autofs_point *ap + } + } + +- cache_writelock(mc); ++ /* ++ * We can't take the writelock for direct mounts. If we're ++ * starting up or trying to re-connect to an existing direct ++ * mount we could be iterating through the map entries with ++ * the readlock held. But we don't need to update the cache ++ * when we're starting up so just take the readlock in that ++ * case. ++ */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ cache_readlock(mc); ++ else ++ cache_writelock(mc); + do_cache_lookup: + me = cache_lookup(mc, key); + /* +@@ -1102,10 +1113,11 @@ do_cache_lookup: + } + if (me && me->mapent) { + /* +- * Add wildcard match for later validation checks and +- * negative cache lookups. ++ * If this is a lookup add wildcard match for later validation ++ * checks and negative cache lookups. + */ +- if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ if (!(ap->flags & MOUNT_FLAG_REMOUNT) && ++ ap->type == LKP_INDIRECT && *me->key == '*') { + ret = cache_update(mc, source, key, me->mapent, me->age); + if (!(ret & (CHE_OK | CHE_UPDATED))) + me = NULL; +@@ -1130,6 +1142,9 @@ do_cache_lookup: + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { ++ /* Don't update negative cache when re-connecting */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ return NSS_STATUS_TRYAGAIN; + cache_writelock(mc); + cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); +--- autofs-5.0.7.orig/modules/lookup_ldap.c ++++ autofs-5.0.7/modules/lookup_ldap.c +@@ -2975,7 +2975,18 @@ int lookup_mount(struct autofs_point *ap + return status; + } + +- cache_writelock(mc); ++ /* ++ * We can't take the writelock for direct mounts. If we're ++ * starting up or trying to re-connect to an existing direct ++ * mount we could be iterating through the map entries with ++ * the readlock held. But we don't need to update the cache ++ * when we're starting up so just take the readlock in that ++ * case. ++ */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ cache_readlock(mc); ++ else ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -2987,10 +2998,11 @@ int lookup_mount(struct autofs_point *ap + } + if (me && me->mapent) { + /* +- * Add wildcard match for later validation checks and +- * negative cache lookups. ++ * If this is a lookup add wildcard match for later validation ++ * checks and negative cache lookups. + */ +- if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ if (!(ap->flags & MOUNT_FLAG_REMOUNT) && ++ ap->type == LKP_INDIRECT && *me->key == '*') { + ret = cache_update(mc, source, key, me->mapent, me->age); + if (!(ret & (CHE_OK | CHE_UPDATED))) + me = NULL; +@@ -3012,6 +3024,9 @@ int lookup_mount(struct autofs_point *ap + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { ++ /* Don't update negative cache when re-connecting */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ return NSS_STATUS_TRYAGAIN; + cache_writelock(mc); + cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); +--- autofs-5.0.7.orig/modules/lookup_nisplus.c ++++ autofs-5.0.7/modules/lookup_nisplus.c +@@ -561,7 +561,18 @@ int lookup_mount(struct autofs_point *ap + return status; + } + +- cache_writelock(mc); ++ /* ++ * We can't take the writelock for direct mounts. If we're ++ * starting up or trying to re-connect to an existing direct ++ * mount we could be iterating through the map entries with ++ * the readlock held. But we don't need to update the cache ++ * when we're starting up so just take the readlock in that ++ * case. ++ */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ cache_readlock(mc); ++ else ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -573,10 +584,11 @@ int lookup_mount(struct autofs_point *ap + } + if (me && me->mapent) { + /* +- * Add wildcard match for later validation checks and +- * negative cache lookups. ++ * If this is a lookup add wildcard match for later validation ++ * checks and negative cache lookups. + */ +- if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ if (!(ap->flags & MOUNT_FLAG_REMOUNT) && ++ ap->type == LKP_INDIRECT && *me->key == '*') { + ret = cache_update(mc, source, key, me->mapent, me->age); + if (!(ret & (CHE_OK | CHE_UPDATED))) + me = NULL; +@@ -603,6 +615,11 @@ int lookup_mount(struct autofs_point *ap + time_t now = time(NULL); + int rv = CHE_OK; + ++ free(mapent); ++ ++ /* Don't update negative cache when re-connecting */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ return NSS_STATUS_TRYAGAIN; + cache_writelock(mc); + me = cache_lookup_distinct(mc, key); + if (!me) +@@ -612,7 +629,6 @@ int lookup_mount(struct autofs_point *ap + me->status = time(NULL) + ap->negative_timeout; + } + cache_unlock(mc); +- free(mapent); + return NSS_STATUS_TRYAGAIN; + } + free(mapent); +--- autofs-5.0.7.orig/modules/lookup_sss.c ++++ autofs-5.0.7/modules/lookup_sss.c +@@ -635,7 +635,17 @@ int lookup_mount(struct autofs_point *ap + return status; + } + +- cache_readlock(mc); ++ /* ++ * We can't take the writelock for direct mounts. If we're ++ * starting up or trying to re-connect to an existing direct ++ * mount we could be iterating through the map entries with ++ * the readlock held. But we don't need to update the cache ++ * when we're starting up so just take the readlock in that ++ */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ cache_writelock(mc); ++ else ++ cache_readlock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -647,10 +657,11 @@ int lookup_mount(struct autofs_point *ap + } + if (me && me->mapent) { + /* +- * Add wildcard match for later validation checks and +- * negative cache lookups. ++ * If this is a lookup add wildcard match for later validation ++ * checks and negative cache lookups. + */ +- if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ if (ap->type == LKP_INDIRECT && *me->key == '*' && ++ !(ap->flags & MOUNT_FLAG_REMOUNT)) { + ret = cache_update(mc, source, key, me->mapent, me->age); + if (!(ret & (CHE_OK | CHE_UPDATED))) + me = NULL; +@@ -672,6 +683,9 @@ int lookup_mount(struct autofs_point *ap + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { ++ /* Don't update negative cache when re-connecting */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ return NSS_STATUS_TRYAGAIN; + cache_writelock(mc); + cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); +--- autofs-5.0.7.orig/modules/lookup_yp.c ++++ autofs-5.0.7/modules/lookup_yp.c +@@ -662,7 +662,18 @@ int lookup_mount(struct autofs_point *ap + return status; + } + +- cache_writelock(mc); ++ /* ++ * We can't take the writelock for direct mounts. If we're ++ * starting up or trying to re-connect to an existing direct ++ * mount we could be iterating through the map entries with ++ * the readlock held. But we don't need to update the cache ++ * when we're starting up so just take the readlock in that ++ * case. ++ */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ cache_readlock(mc); ++ else ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -674,10 +685,11 @@ int lookup_mount(struct autofs_point *ap + } + if (me && me->mapent) { + /* +- * Add wildcard match for later validation checks and +- * negative cache lookups. ++ * If this is a lookup add wildcard match for later validation ++ * checks and negative cache lookups. + */ +- if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ if (ap->type == LKP_INDIRECT && *me->key == '*' && ++ !(ap->flags & MOUNT_FLAG_REMOUNT)) { + ret = cache_update(mc, source, key, me->mapent, me->age); + if (!(ret & (CHE_OK | CHE_UPDATED))) + me = NULL; +@@ -698,6 +710,9 @@ int lookup_mount(struct autofs_point *ap + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { ++ /* Don't update negative cache when re-connecting */ ++ if (ap->flags & MOUNT_FLAG_REMOUNT) ++ return NSS_STATUS_TRYAGAIN; + cache_writelock(mc); + cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); diff --git a/SOURCES/autofs-5.0.7-fix-get_nfs_info-probe.patch b/SOURCES/autofs-5.0.7-fix-get_nfs_info-probe.patch new file mode 100644 index 0000000..88b82b9 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-get_nfs_info-probe.patch @@ -0,0 +1,94 @@ +autofs-5.0.7 - fix get_nfs_info() probe + +From: Ian Kent + +A recent contributed patch series changed the behaviour of server +probing to use port specification in the same way as mount.nfs(8). + +Unfortunately, if NFSv2 only is to be probed and the NFS port +needs to be obtained, the probe fails unconditionally because +no rpc client has yet been created. +--- + CHANGELOG | 1 + + modules/replicated.c | 32 ++++++++++++++++++++------------ + 2 files changed, 21 insertions(+), 12 deletions(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -61,6 +61,7 @@ + - fix dumpmaps multi output. + - try and cleanup after dumpmaps. + - teach dumpmaps to output simple key value pairs. ++- fix get_nfs_info() probe. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/modules/replicated.c ++++ autofs-5.0.7/modules/replicated.c +@@ -444,6 +444,11 @@ static unsigned int get_nfs_info(unsigne + host->name, proto, version); + + rpc_info->proto = proto; ++ if (port < 0) ++ rpc_info->port = NFS_PORT; ++ else if (port > 0) ++ rpc_info->port = port; ++ + memset(&parms, 0, sizeof(struct pmap)); + parms.pm_prog = NFS_PROGRAM; + parms.pm_prot = proto; +@@ -451,11 +456,7 @@ static unsigned int get_nfs_info(unsigne + if (!(version & NFS4_REQUESTED)) + goto v3_ver; + +- if (port < 0) +- rpc_info->port = NFS_PORT; +- else if (port > 0) +- rpc_info->port = port; +- else { ++ if (!port) { + status = rpc_portmap_getclient(pm_info, + host->name, host->addr, host->addr_len, + proto, RPC_CLOSE_DEFAULT); +@@ -515,7 +516,7 @@ v3_ver: + if (!(version & NFS3_REQUESTED)) + goto v2_ver; + +- if (port <= 0 && !(version & NFS4_REQUESTED && port == 0)) { ++ if (!port && !pm_info->client) { + status = rpc_portmap_getclient(pm_info, + host->name, host->addr, host->addr_len, + proto, RPC_CLOSE_DEFAULT); +@@ -526,9 +527,7 @@ v3_ver: + goto done_ver; + } + +- if (port > 0) +- rpc_info->port = port; +- else { ++ if (!port) { + parms.pm_vers = NFS3_VERSION; + status = rpc_portmap_getport(pm_info, &parms, &rpc_info->port); + if (status == -EHOSTUNREACH || status == -ETIMEDOUT) { +@@ -573,9 +572,18 @@ v2_ver: + if (!(version & NFS2_REQUESTED)) + goto done_ver; + +- if (port > 0) +- rpc_info->port = port; +- else { ++ if (!port && !pm_info->client) { ++ status = rpc_portmap_getclient(pm_info, ++ host->name, host->addr, host->addr_len, ++ proto, RPC_CLOSE_DEFAULT); ++ if (status == -EHOSTUNREACH) { ++ supported = status; ++ goto done_ver; ++ } else if (status) ++ goto done_ver; ++ } ++ ++ if (!port) { + parms.pm_vers = NFS2_VERSION; + status = rpc_portmap_getport(pm_info, &parms, &rpc_info->port); + if (status == -EHOSTUNREACH || status == -ETIMEDOUT) { diff --git a/SOURCES/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch b/SOURCES/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch new file mode 100644 index 0000000..45bd53f --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch @@ -0,0 +1,55 @@ +autofs-5.0.7 - fix host_addr null reference in add_new_host() + +From: Ian Kent + +The function add_new_host() is always called from a loop that depends +on host_addr being non-null. + +Remove the redundant check. +--- + modules/replicated.c | 29 ++++++++++------------------- + 1 file changed, 10 insertions(+), 19 deletions(-) + +diff --git a/modules/replicated.c b/modules/replicated.c +index 0a044b9..e793ca4 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -1030,28 +1030,19 @@ static int add_new_host(struct host **list, + unsigned int prx; + int addr_len; + ++ prx = get_proximity(host_addr->ai_addr); ++ + /* +- * If we are using random selection we pretend all hosts are at +- * the same proximity so hosts further away don't get excluded. +- * We can't use PROXIMITY_LOCAL or we won't perform an RPC ping +- * to remove hosts that may be down. ++ * If we want the weight to be the determining factor ++ * when selecting a host, or we are using random selection, ++ * then all hosts must have the same proximity. However, ++ * if this is the local machine it should always be used ++ * since it is certainly available. + */ +- if (!host_addr) ++ if (prx != PROXIMITY_LOCAL && ++ (options & (MOUNT_FLAG_USE_WEIGHT_ONLY | ++ MOUNT_FLAG_RANDOM_SELECT))) + prx = PROXIMITY_SUBNET; +- else { +- prx = get_proximity(host_addr->ai_addr); +- /* +- * If we want the weight to be the determining factor +- * when selecting a host, or we are using random selection, +- * then all hosts must have the same proximity. However, +- * if this is the local machine it should always be used +- * since it is certainly available. +- */ +- if (prx != PROXIMITY_LOCAL && +- (options & (MOUNT_FLAG_USE_WEIGHT_ONLY | +- MOUNT_FLAG_RANDOM_SELECT))) +- prx = PROXIMITY_SUBNET; +- } + + /* + * If we tried to add an IPv6 address and we don't have IPv6 diff --git a/SOURCES/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch b/SOURCES/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch new file mode 100644 index 0000000..661685f --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch @@ -0,0 +1,41 @@ +autofs-5.0.7 - fix inconsistent signed usage for __rpc_ping() + +From: Ian Kent + +There is some incosistent usage of unsigned int variables with the usage +of __rpc_ping(). +--- + lib/rpc_subs.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c +index 718caf9..f5742e8 100644 +--- a/lib/rpc_subs.c ++++ b/lib/rpc_subs.c +@@ -670,13 +670,11 @@ int rpc_ping_proto(struct conn_info *info) + return 1; + } + +-static unsigned int __rpc_ping(const char *host, +- unsigned long version, +- int proto, +- long seconds, long micros, +- unsigned int option) ++static int __rpc_ping(const char *host, ++ unsigned long version, int proto, ++ long seconds, long micros, unsigned int option) + { +- unsigned int status; ++ int status; + struct conn_info info; + struct pmap parms; + +@@ -713,7 +711,7 @@ int rpc_ping(const char *host, long seconds, long micros, unsigned int option) + { + unsigned long vers3 = NFS3_VERSION; + unsigned long vers2 = NFS2_VERSION; +- unsigned int status; ++ int status; + + status = __rpc_ping(host, vers2, IPPROTO_UDP, seconds, micros, option); + if (status > 0) diff --git a/SOURCES/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch b/SOURCES/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch new file mode 100644 index 0000000..9d59e34 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch @@ -0,0 +1,23 @@ +autofs-5.0.7 - fix inconsistent use of cache lock in handle_packet_missing_direct() + +From: Ian Kent + +All references here except this one refer to the same variable so change the odd +one out for consistency. +--- + daemon/direct.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/daemon/direct.c b/daemon/direct.c +index 228a666..399ad0a 100644 +--- a/daemon/direct.c ++++ b/daemon/direct.c +@@ -1392,7 +1392,7 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ + ops->send_fail(ap->logopt, + ioctlfd, pkt->wait_queue_token, -ENOENT); + ops->close(ap->logopt, ioctlfd); +- cache_unlock(me->mc); ++ cache_unlock(mc); + master_source_unlock(ap->entry); + master_mutex_unlock(); + pthread_setcancelstate(state, NULL); diff --git a/SOURCES/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch b/SOURCES/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch new file mode 100644 index 0000000..63312f8 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch @@ -0,0 +1,30 @@ +autofs-5.0.7 - fix incorrect check in flag_is_owned() + +From: Ian Kent + +The flag file code isn't used any more but this is clearly incorrect +so fix it in case it gets used sometime in the future. +--- + daemon/flag.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/daemon/flag.c b/daemon/flag.c +index f8fe163..db9a4bd 100644 +--- a/daemon/flag.c ++++ b/daemon/flag.c +@@ -66,12 +66,11 @@ static int flag_is_owned(int fd) + + continue; + } +- +- /* Stale flagfile */ +- if (!tries) +- return 0; + } + ++ /* Stale flagfile */ ++ if (!tries) ++ return 0; + + if (pid) { + int ret; diff --git a/SOURCES/autofs-5.0.7-fix-incorrect-name-in-test.patch b/SOURCES/autofs-5.0.7-fix-incorrect-name-in-test.patch new file mode 100644 index 0000000..bce7c45 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-incorrect-name-in-test.patch @@ -0,0 +1,22 @@ +autofs-5.0.7 - fix incorrect var name in test + +From: Ian Kent + +Fix incorrect variable name used for test of buffer size for getgrgid_r. +--- + lib/mounts.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/mounts.c b/lib/mounts.c +index 550445c..0caa0aa 100644 +--- a/lib/mounts.c ++++ b/lib/mounts.c +@@ -1222,7 +1222,7 @@ void set_tsd_user_vars(unsigned int logopt, uid_t uid, gid_t gid) + /* Try to get group info */ + + grplen = sysconf(_SC_GETGR_R_SIZE_MAX); +- if (tmplen < 0) { ++ if (grplen < 0) { + error(logopt, "failed to get buffer size for getgrgid_r"); + goto free_tsv_home; + } diff --git a/SOURCES/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch b/SOURCES/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch new file mode 100644 index 0000000..a9c2031 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch @@ -0,0 +1,22 @@ +autofs-5.0.7 - fix incorrect value reference in parse_line() + +From: Ian Kent + +This chack should clearly be on the contents of key not the pointer value. +--- + lib/defaults.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/defaults.c b/lib/defaults.c +index 1e89509..7c65387 100644 +--- a/lib/defaults.c ++++ b/lib/defaults.c +@@ -167,7 +167,7 @@ static int parse_line(char *line, char **res, char **value) + while (*key && *key == ' ') + key++; + +- if (!key) ++ if (!*key) + return 0; + + if (!(val = strchr(key, '='))) diff --git a/SOURCES/autofs-5.0.7-fix-init-script-status-return.patch b/SOURCES/autofs-5.0.7-fix-init-script-status-return.patch new file mode 100644 index 0000000..a08d62f --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-init-script-status-return.patch @@ -0,0 +1,39 @@ +autofs-5.0.7 - fix init script status return + +From: Ian Kent + +The patch that added the piddir to configure to fix incorrect init +script status() function returns failed to actually return the value +to the user. +--- + + CHANGELOG | 1 + + redhat/autofs.init.in | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 76c1f73..5bcb1af 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -19,6 +19,7 @@ + - Allow nsswitch.conf to not contain "automount:" lines. + - fix nobind man page description. + - fix submount offset delete. ++- fix init script status return. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in +index fe18b3e..9d008ff 100644 +--- a/redhat/autofs.init.in ++++ b/redhat/autofs.init.in +@@ -172,7 +172,7 @@ RETVAL=0 + case "$1" in + status) + status -p @@autofspiddir@@/autofs.pid -l autofs $prog +- exit 0; ++ exit $?; + ;; + usage) + usage_message diff --git a/SOURCES/autofs-5.0.7-fix-interface-address-null-check.patch b/SOURCES/autofs-5.0.7-fix-interface-address-null-check.patch new file mode 100644 index 0000000..f1a209b --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-interface-address-null-check.patch @@ -0,0 +1,55 @@ +autofs-5.0.7 - fix interface address null check + +From: Doug Nazar + +Since commit aa6f7793 [autofs-5.0.7 - fix ipv6 proximity calculation] +get_proximity() uses getifaddrs however it crashes on interfaces with +no addresses. + +Fix the NULL check to ignore interfaces with no addresses. +Also skip interfaces which are not currently running. +--- + CHANGELOG | 1 + + modules/replicated.c | 10 ++++++---- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 66c11de..50e83d7 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -43,6 +43,7 @@ + - make dump maps check for duplicate indirect mounts. + - document allowed map sources in auto.master. + - add enable sloppy mount option to configure. ++- fix interface address null check. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/replicated.c b/modules/replicated.c +index 26f64b8..6dbdade 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -165,8 +165,9 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + + this = ifa; + while (this) { +- if (this->ifa_flags & IFF_POINTOPOINT || +- this->ifa_addr->sa_data == NULL) { ++ if (!(this->ifa_flags & IFF_UP) || ++ this->ifa_flags & IFF_POINTOPOINT || ++ this->ifa_addr == NULL) { + this = this->ifa_next; + continue; + } +@@ -202,8 +203,9 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + + this = ifa; + while (this) { +- if (this->ifa_flags & IFF_POINTOPOINT || +- this->ifa_addr->sa_data == NULL) { ++ if (!(this->ifa_flags & IFF_UP) || ++ this->ifa_flags & IFF_POINTOPOINT || ++ this->ifa_addr == NULL) { + this = this->ifa_next; + continue; + } diff --git a/SOURCES/autofs-5.0.7-fix-ipv6-proximity-calculation.patch b/SOURCES/autofs-5.0.7-fix-ipv6-proximity-calculation.patch new file mode 100644 index 0000000..b341ecd --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-ipv6-proximity-calculation.patch @@ -0,0 +1,297 @@ +autofs-5.0.7 - fix ipv6 proximity calculation + +From: Ian Kent + +The socket based ioctl used to get interface information only +return IPv4 information. Change get_proximity() function to use +getifaddrs(3) instead. +--- + + CHANGELOG | 1 + modules/replicated.c | 149 ++++++++++++++------------------------------------ + 2 files changed, 42 insertions(+), 108 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index dc38580..34c70fa 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -2,6 +2,7 @@ + ======================= + - fix nobind sun escaped map entries. + - fix use cache entry after free in lookup_prune_one_cache(). ++- fix ipv6 proximity calculation. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/replicated.c b/modules/replicated.c +index 78046c6..bd6003b 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -52,6 +52,7 @@ + #include + #include + #include ++#include + + #include "rpc_subs.h" + #include "replicated.h" +@@ -110,58 +111,18 @@ void seed_random(void) + return; + } + +-static int alloc_ifreq(struct ifconf *ifc, int sock) +-{ +- int ret, lastlen = ifc_last_len, len = ifc_buf_len; +- char err_buf[MAX_ERR_BUF], *buf; +- +- while (1) { +- buf = malloc(len); +- if (!buf) { +- char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); +- logerr("malloc: %s", estr); +- return 0; +- } +- +- ifc->ifc_len = len; +- ifc->ifc_req = (struct ifreq *) buf; +- +- ret = ioctl(sock, SIOCGIFCONF, ifc); +- if (ret == -1) { +- char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); +- logerr("ioctl: %s", estr); +- free(buf); +- return 0; +- } +- +- if (ifc->ifc_len <= lastlen) +- break; +- +- lastlen = ifc->ifc_len; +- len += MAX_IFC_BUF; +- free(buf); +- } +- +- if (lastlen != ifc_last_len) { +- ifc_last_len = lastlen; +- ifc_buf_len = len; +- } +- +- return 1; +-} +- + static unsigned int get_proximity(struct sockaddr *host_addr) + { ++ struct ifaddrs *ifa = NULL; ++ struct ifaddrs *this; + struct sockaddr_in *addr, *msk_addr, *if_addr; + struct sockaddr_in6 *addr6, *msk6_addr, *if6_addr; + struct in_addr *hst_addr; + struct in6_addr *hst6_addr; + int addr_len; +- char buf[MAX_ERR_BUF], *ptr; +- struct ifconf ifc; +- struct ifreq *ifr, nmptr; +- int sock, ret, i; ++ char buf[MAX_ERR_BUF]; + uint32_t mask, ha, ia, *mask6, *ha6, *ia6; ++ int ret; + + addr = NULL; + addr6 = NULL; +@@ -170,13 +131,14 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + mask6 = NULL; + ha6 = NULL; + ia6 = NULL; ++ ha = 0; + + switch (host_addr->sa_family) { + case AF_INET: + addr = (struct sockaddr_in *) host_addr; + hst_addr = (struct in_addr *) &addr->sin_addr; + ha = ntohl((uint32_t) hst_addr->s_addr); +- addr_len = sizeof(hst_addr); ++ addr_len = sizeof(*hst_addr); + break; + + case AF_INET6: +@@ -186,7 +148,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + addr6 = (struct sockaddr_in6 *) host_addr; + hst6_addr = (struct in6_addr *) &addr6->sin6_addr; + ha6 = &hst6_addr->s6_addr32[0]; +- addr_len = sizeof(hst6_addr); ++ addr_len = sizeof(*hst6_addr); + break; + #endif + +@@ -194,36 +156,29 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + return PROXIMITY_ERROR; + } + +- sock = open_sock(AF_INET, SOCK_DGRAM, 0); +- if (sock < 0) { ++ ret = getifaddrs(&ifa); ++ if (ret) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); +- logerr("socket creation failed: %s", estr); ++ logerr("getifaddrs: %s", estr); + return PROXIMITY_ERROR; + } + +- if (!alloc_ifreq(&ifc, sock)) { +- close(sock); +- return PROXIMITY_ERROR; +- } +- +- /* For each interface */ +- +- /* Is the address a local interface */ +- i = 0; +- ptr = (char *) &ifc.ifc_buf[0]; +- +- while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { +- ifr = (struct ifreq *) ptr; ++ this = ifa; ++ while (this) { ++ if (this->ifa_flags & IFF_POINTOPOINT || ++ this->ifa_addr->sa_data == NULL) { ++ this = this->ifa_next; ++ continue; ++ } + +- switch (ifr->ifr_addr.sa_family) { ++ switch (this->ifa_addr->sa_family) { + case AF_INET: + if (host_addr->sa_family == AF_INET6) + break; +- if_addr = (struct sockaddr_in *) &ifr->ifr_addr; ++ if_addr = (struct sockaddr_in *) this->ifa_addr; + ret = memcmp(&if_addr->sin_addr, hst_addr, addr_len); + if (!ret) { +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + return PROXIMITY_LOCAL; + } + break; +@@ -234,55 +189,41 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + #else + if (host_addr->sa_family == AF_INET) + break; +- +- if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; ++ if6_addr = (struct sockaddr_in6 *) this->ifa_addr; + ret = memcmp(&if6_addr->sin6_addr, hst6_addr, addr_len); + if (!ret) { +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + return PROXIMITY_LOCAL; + } + #endif +- + default: + break; + } +- +- i++; +- ptr = (char *) &ifc.ifc_req[i]; ++ this = this->ifa_next; + } + +- i = 0; +- ptr = (char *) &ifc.ifc_buf[0]; +- +- while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { +- ifr = (struct ifreq *) ptr; +- +- nmptr = *ifr; +- ret = ioctl(sock, SIOCGIFNETMASK, &nmptr); +- if (ret == -1) { +- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); +- logerr("ioctl: %s", estr); +- close(sock); +- free(ifc.ifc_req); +- return PROXIMITY_ERROR; ++ this = ifa; ++ while (this) { ++ if (this->ifa_flags & IFF_POINTOPOINT || ++ this->ifa_addr->sa_data == NULL) { ++ this = this->ifa_next; ++ continue; + } + +- switch (ifr->ifr_addr.sa_family) { ++ switch (this->ifa_addr->sa_family) { + case AF_INET: + if (host_addr->sa_family == AF_INET6) + break; +- if_addr = (struct sockaddr_in *) &ifr->ifr_addr; ++ if_addr = (struct sockaddr_in *) this->ifa_addr; + ia = ntohl((uint32_t) if_addr->sin_addr.s_addr); + +- /* Is the address within a localiy attached subnet */ ++ /* Is the address within a localy attached subnet */ + +- msk_addr = (struct sockaddr_in *) &nmptr.ifr_netmask; ++ msk_addr = (struct sockaddr_in *) this->ifa_netmask; + mask = ntohl((uint32_t) msk_addr->sin_addr.s_addr); + + if ((ia & mask) == (ha & mask)) { +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + return PROXIMITY_SUBNET; + } + +@@ -304,8 +245,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + break; + + if ((ia & mask) == (ha & mask)) { +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + return PROXIMITY_NET; + } + break; +@@ -316,35 +256,28 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + #else + if (host_addr->sa_family == AF_INET) + break; +- +- if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; ++ if6_addr = (struct sockaddr_in6 *) this->ifa_addr; + ia6 = &if6_addr->sin6_addr.s6_addr32[0]; + + /* Is the address within the network of the interface */ + +- msk6_addr = (struct sockaddr_in6 *) &nmptr.ifr_netmask; ++ msk6_addr = (struct sockaddr_in6 *) this->ifa_netmask; + mask6 = &msk6_addr->sin6_addr.s6_addr32[0]; + + if (ipv6_mask_cmp(ha6, ia6, mask6)) { +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + return PROXIMITY_SUBNET; + } + + /* How do we define "local network" in ipv6? */ + #endif +- break; +- + default: + break; + } +- +- i++; +- ptr = (char *) &ifc.ifc_req[i]; ++ this = this->ifa_next; + } + +- close(sock); +- free(ifc.ifc_req); ++ freeifaddrs(ifa); + + return PROXIMITY_OTHER; + } diff --git a/SOURCES/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch b/SOURCES/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch new file mode 100644 index 0000000..d113eea --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch @@ -0,0 +1,21 @@ +autofs-5.0.7 - fix leaked ldap percent hack allocation in lookup_one() + +From: Ian Kent + +Fix a resource leak when calling the percent hack transforms in lookup_one(). +--- + modules/lookup_ldap.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 26481a8..35ea6ea 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -2525,6 +2525,7 @@ static int lookup_one(struct autofs_point *ap, + if (enc_len1 != 0) { + enc_len2 = encode_percent_hack(qKey, &enc_key2, 1); + if (enc_len2 < 0) { ++ free(enc_key1); + crit(ap->logopt, + "could not use percent hack encode key %s", + qKey); diff --git a/SOURCES/autofs-5.0.7-fix-libtirpc-build-option.patch b/SOURCES/autofs-5.0.7-fix-libtirpc-build-option.patch new file mode 100644 index 0000000..8ad2afa --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-libtirpc-build-option.patch @@ -0,0 +1,66 @@ +autofs-5.0.7 - fix libtirpc build option + +From: Ian Kent + + +--- + CHANGELOG | 1 + + autofs.spec | 17 ++++++++++++++++- + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index e848bcd..b6b2679 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -34,6 +34,7 @@ + - depricate nosymlink pseudo option. + - add symlink pseudo option. + - fix requires in spec file. ++- fix libtirpc build option to require libtirpc-devel if needed. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/autofs.spec b/autofs.spec +index 703f7a9..f77acc1 100644 +--- a/autofs.spec ++++ b/autofs.spec +@@ -12,6 +12,10 @@ + # disable them. + %define with_systemd %{?_without_systemd: 0} %{?!_without_systemd: 1} + ++# Use --without libtirpc in your rpmbuild command or force values to 0 to ++# disable them. ++%define with_libtirpc %{?_without_libtirpc: 0} %{?!_without_libtirpc: 1} ++ + Summary: A tool from automatically mounting and umounting filesystems. + Name: autofs + %define version 5.0.7 +@@ -25,6 +29,9 @@ Buildroot: %{_tmppath}/%{name}-tmp + %if %{with_systemd} + BuildRequires: systemd-units + %endif ++%if %{with_libtirpc} ++BuildRequires: libtirpc-devel ++%endif + BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel + Requires: chkconfig + Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps +@@ -72,9 +79,17 @@ echo %{version}-%{release} > .version + %define _unitdir %{?_unitdir:/lib/systemd/system} + %define systemd_configure_arg --with-systemd + %endif ++%if %{with_libtirpc} ++ %define libtirpc_configure_arg --with-libtirpc ++%endif + + %build +-CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:} ++CFLAGS="$RPM_OPT_FLAGS -Wall" \ ++./configure --libdir=%{_libdir} \ ++ --disable-mount-locking \ ++ --enable-ignore-busy \ ++ %{?systemd_configure_arg:} \ ++ %{?libtirpc_configure_arg:} + CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 + + %install diff --git a/SOURCES/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch b/SOURCES/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch new file mode 100644 index 0000000..126d9a2 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch @@ -0,0 +1,37 @@ +autofs-5.0.7 - fix map entry duplicate offset detection + +From: Ian Kent + +Recent changes broke the detection of duplicate offsets in map entries. +--- + + CHANGELOG | 1 + + lib/cache.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 8f6bb3a..bd0dd82 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -15,6 +15,7 @@ + - fix recursive mount deadlock. + - increase file map read buffer size. + - handle new location of systemd. ++- fix map entry duplicate offset detection. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/cache.c b/lib/cache.c +index 9179ad5..1e05a99 100644 +--- a/lib/cache.c ++++ b/lib/cache.c +@@ -659,7 +659,7 @@ int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *k + + me = cache_lookup_distinct(mc, key); + if (me && me->age == age) { +- if (me->multi != owner) ++ if (me->multi == owner) + return CHE_DUPLICATE; + } + diff --git a/SOURCES/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch b/SOURCES/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch new file mode 100644 index 0000000..7c003ff --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch @@ -0,0 +1,62 @@ +autofs-5.0.7 - fix master map bogus keywork match + +From: Ian Kent + +If we have a map name in the master map that ends with a keyword +of one of the map types or "multi" we mistakenly match the trailing +white space and include that in the map name. This has to be wrong +since we can't handle quoting in the master map and embedded white +space must be escaped. It would be good if we handled quoted strings +but that has proven a bit of a nightmare so far for the current +tokenizer. +--- + CHANGELOG | 1 + + lib/master_tok.l | 16 ++++++++++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/CHANGELOG b/CHANGELOG +index 00eaff2..e15aa1f 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -46,6 +46,7 @@ + - fix interface address null check. + - dont probe rdma mounts. + - fix master map mount options matching. ++- fix master map bogus keywork match. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master_tok.l b/lib/master_tok.l +index 8d1f1a2..a55cc76 100644 +--- a/lib/master_tok.l ++++ b/lib/master_tok.l +@@ -202,6 +202,14 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo + {MULTI} { + tlen = master_leng - 1; + if (bptr != buff && isblank(master_text[tlen])) { ++ /* ++ * We can't handle unescaped white space in map names ++ * so just eat the white space. We always have the ++ * "multi" at the beginning of the string so the while ++ * will not fall off the end. ++ */ ++ while (isblank(master_text[tlen - 1])) ++ tlen--; + strncat(buff, master_text, tlen); + bptr += tlen; + yyless(tlen); +@@ -216,6 +224,14 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo + {MTYPE}/{DNATTRSTR}= { + tlen = master_leng - 1; + if (bptr != buff && isblank(master_text[tlen])) { ++ /* ++ * We can't handle unescaped white space in map names ++ * so just eat the white space. We always have the ++ * maptype keyword at the beginning of the string so ++ * the while will not fall off the end. ++ */ ++ while (isblank(master_text[tlen - 1])) ++ tlen--; + strncat(buff, master_text, tlen); + bptr += tlen; + yyless(tlen); diff --git a/SOURCES/autofs-5.0.7-fix-master-map-mount-options-matching.patch b/SOURCES/autofs-5.0.7-fix-master-map-mount-options-matching.patch new file mode 100644 index 0000000..a360618 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-master-map-mount-options-matching.patch @@ -0,0 +1,43 @@ +autofs-5.0.7 - fix master map mount options matching + +From: Ian Kent + +The master map options pattern matching is fairly primitive since it +doesn't need to be very sophisticated. The current mount option pattern +matching can't match mount options with quotes or embedded colons and so +it can't pass these options through as a global options string. + +But it must be able to match a fairly large class of strings, including +the above case, so they can be passed through as global options. Of +course it can't try and validate them since it can't know what mount type +they may be used with. +--- + CHANGELOG | 1 + + lib/master_tok.l | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 1156cc9..00eaff2 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -45,6 +45,7 @@ + - add enable sloppy mount option to configure. + - fix interface address null check. + - dont probe rdma mounts. ++- fix master map mount options matching. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master_tok.l b/lib/master_tok.l +index f9b4e55..8d1f1a2 100644 +--- a/lib/master_tok.l ++++ b/lib/master_tok.l +@@ -91,7 +91,7 @@ OPTWS [[:blank:]]* + NL \r?\n + CONT \\\n{OPTWS} + +-OPTIONSTR ([\-]?([[:alpha:]_]([[:alnum:]_\-])*(=([[:alnum:]_\-])+)*)+) ++OPTIONSTR ([\-]?([[:alpha:]_]([[:alnum:]_\-])*(=(\"?([[:alnum:]_\-\:])+\"?))?)+) + MACROSTR (-D{OPTWS}([[:alpha:]_]([[:alnum:]_\-\.])*)=([[:alnum:]_\-\.])+) + SLASHIFYSTR (--(no-)?slashify-colons) + NUMBER [0-9]+ diff --git a/SOURCES/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch b/SOURCES/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch new file mode 100644 index 0000000..01a9236 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch @@ -0,0 +1,30 @@ +autofs-5.0.7 - fix memory leak in get_dc_list() + +From: Ian Kent + +In get_dc_list() if an invalid port is found the allocated list storage +isn't freed on the error exit. +--- + modules/dclist.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules/dclist.c b/modules/dclist.c +index d16b913..af21ce0 100644 +--- a/modules/dclist.c ++++ b/modules/dclist.c +@@ -536,6 +536,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri) + else + strcat(tmp, " "); + ++ list = NULL; + for (i = 0; i < numdcs; i++) { + if (i > 0) + strcat(tmp, " "); +@@ -549,6 +550,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri) + error(logopt, + "invalid port: %u", dcs[i].port); + free_srv_rrs(dcs, numdcs); ++ free(tmp); + goto out_error; + } + strcat(tmp, port); diff --git a/SOURCES/autofs-5.0.7-fix-nobind-man-page-description.patch b/SOURCES/autofs-5.0.7-fix-nobind-man-page-description.patch new file mode 100644 index 0000000..41328a0 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-nobind-man-page-description.patch @@ -0,0 +1,46 @@ +autofs-5.0.7 - fix nobind man page description + +From: Ian Kent + +Update auto.master(5) to better describe the behavior of the "nobind" +option when used with direct mounts maps. +--- + + CHANGELOG | 1 + + man/auto.master.5.in | 10 +++++++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 16ac2a0..7eb7235 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -17,6 +17,7 @@ + - handle new location of systemd. + - fix map entry duplicate offset detection. + - Allow nsswitch.conf to not contain "automount:" lines. ++- fix nobind man page description. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/auto.master.5.in b/man/auto.master.5.in +index 21d7544..8007542 100644 +--- a/man/auto.master.5.in ++++ b/man/auto.master.5.in +@@ -151,9 +151,13 @@ can't be mounted. + This is an autofs specific option that is a pseudo mount option and + so is given without a leading dash. It may be used either in the master + map entry (so it effects all the map entries) or with individual map +-entries to prevent bind mounting of local NFS filesystems. Bind mounting +-of NFS file systems can also be prevented for specific map entrys by +-adding the "port=" mount option to the entries. ++entries to prevent bind mounting of local NFS filesystems. For direct ++mount maps the option is only effective if specified on the first direct ++map entry and is applied to all direct mount maps in the master map. It ++is ignored if given on subsequent direct map entries. It may be used ++on individual map entries of both types. Bind mounting of NFS file ++systems can also be prevented for specific map entrys by adding the ++"port=" mount option to the entries. + .TP + .I "\-r, \-\-random-multimount-selection" + Enables the use of ramdom selection when choosing a host from a diff --git a/SOURCES/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch b/SOURCES/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch new file mode 100644 index 0000000..b5d7ad2 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch @@ -0,0 +1,47 @@ +autofs-5.0.7 - fix nobind sun escaped map entries + +From: Ian Kent + +If a map contains a Sun colon escape to indicate the mount is a local +file system and the "nobind" option is present there is no hostname in +the mount location and the mount fails. +--- + + CHANGELOG | 4 ++++ + modules/mount_nfs.c | 5 +++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 67fdcec..faf4c80 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -1,3 +1,7 @@ ++??/??/2012 autofs-5.0.8 ++======================= ++- fix nobind sun escaped map entries. ++ + 25/07/2012 autofs-5.0.7 + ======================= + - fix ipv6 name for lookup fix. +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 9b8e5f1..bbbb1de 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -263,13 +263,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + } else + strcpy(loc, n_addr); + } else { +- loc = malloc(strlen(this->name) + strlen(this->path) + 2); ++ char *host = this->name ? this->name : "localhost"; ++ loc = malloc(strlen(host) + strlen(this->path) + 2); + if (!loc) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + error(ap->logopt, "malloc: %s", estr); + goto forced_fail; + } +- strcpy(loc, this->name); ++ strcpy(loc, host); + } + strcat(loc, ":"); + strcat(loc, this->path); diff --git a/SOURCES/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/SOURCES/autofs-5.0.7-fix-null-map-entry-order-handling.patch new file mode 100644 index 0000000..610afaa --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-fix-parse-buffer-initialization.patch b/SOURCES/autofs-5.0.7-fix-parse-buffer-initialization.patch new file mode 100644 index 0000000..22bd5da --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-parse-buffer-initialization.patch @@ -0,0 +1,51 @@ +autofs-5.0.7 - fix parse buffer initialization + +From: Ian Kent + +When parsing a master map entry, if the mount point path is longer than +the following map string the lexical analyzer buffer may not have a null +terminator where it is expected. If the map name string also contains a +string that is the same as a map type at the end the map name the map +name is not constructed correctly because of this lack of a string +terminator in the buffer. +--- + + CHANGELOG | 1 + + lib/master_tok.l | 4 +++- + 2 files changed, 4 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 34c70fa..276d6ba 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -3,6 +3,7 @@ + - fix nobind sun escaped map entries. + - fix use cache entry after free in lookup_prune_one_cache(). + - fix ipv6 proximity calculation. ++- fix parse buffer initialization. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master_tok.l b/lib/master_tok.l +index 0d6edb7..30abb15 100644 +--- a/lib/master_tok.l ++++ b/lib/master_tok.l +@@ -74,7 +74,8 @@ int my_yyinput(char *, int); + #define unput(c) (*(char *) --line = c) + #endif + +-char buff[1024]; ++#define BUFF_LEN 1024 ++char buff[BUFF_LEN]; + char *bptr; + char *optr = buff; + unsigned int tlen; +@@ -174,6 +175,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo + *bptr = '\0'; + strcpy(master_lval.strtype, buff); + bptr = buff; ++ memset(buff, 0, BUFF_LEN); + return(PATH); + } + diff --git a/SOURCES/autofs-5.0.7-fix-portmap-lookup.patch b/SOURCES/autofs-5.0.7-fix-portmap-lookup.patch new file mode 100644 index 0000000..a84b4b1 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-portmap-lookup.patch @@ -0,0 +1,211 @@ +autofs-5.0.7 - fix portmap lookup + +From: Ian Kent + +The autofs RPC library has fallen behind some. + +When using IPv6 (rpbbind) version 3 or 4 is available whereas with IPv4 +(portmap) verions 2 and 3 are available. + +autofs uses the version defined by PMAPVERS in the portmap include files +whereas it should be using the RPCBVERS defines when using libtirpc. + +In addition /etc/rpc should be used for program number lookup and +/etc/services should be used to lookup rpcbind/protmap port number. + +This incompatibility only shows up when using IPv6 only. +--- + CHANGELOG | 1 + aclocal.m4 | 2 + + configure | 13 +++++++ + include/config.h.in | 6 +++ + lib/rpc_subs.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++---- + 5 files changed, 108 insertions(+), 6 deletions(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -62,6 +62,7 @@ + - try and cleanup after dumpmaps. + - teach dumpmaps to output simple key value pairs. + - fix get_nfs_info() probe. ++- fix portmap lookup. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/aclocal.m4 ++++ autofs-5.0.7/aclocal.m4 +@@ -421,6 +421,8 @@ if test "$af_have_libtirpc" = "yes"; the + TIRPCLIB="-ltirpc" + fi + ++AC_CHECK_FUNCS([getrpcbyname getservbyname]) ++ + # restore flags + CFLAGS="$af_check_libtirpc_save_cflags" + LDFLAGS="$af_check_libtirpc_save_ldflags" +--- autofs-5.0.7.orig/configure ++++ autofs-5.0.7/configure +@@ -3161,6 +3161,19 @@ $as_echo "#define TIRPC_WORKAROUND 1" >> + TIRPCLIB="-ltirpc" + fi + ++for ac_func in getrpcbyname getservbyname ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++ + # restore flags + CFLAGS="$af_check_libtirpc_save_cflags" + LDFLAGS="$af_check_libtirpc_save_ldflags" +--- autofs-5.0.7.orig/include/config.h.in ++++ autofs-5.0.7/include/config.h.in +@@ -21,6 +21,12 @@ + /* define if you have E4FSCK */ + #undef HAVE_E4FSCK + ++/* Define to 1 if you have the `getrpcbyname' function. */ ++#undef HAVE_GETRPCBYNAME ++ ++/* Define to 1 if you have the `getservbyname' function. */ ++#undef HAVE_GETSERVBYNAME ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_INTTYPES_H + +--- autofs-5.0.7.orig/lib/rpc_subs.c ++++ autofs-5.0.7/lib/rpc_subs.c +@@ -43,6 +43,14 @@ + } while (0) + #endif + ++#ifdef WITH_LIBTIRPC ++const rpcprog_t rpcb_prog = RPCBPROG; ++const rpcvers_t rpcb_version = RPCBVERS; ++#else ++const rpcprog_t rpcb_prog = PMAPPROG; ++const rpcvers_t rpcb_version = PMAPVERS; ++#endif ++ + #include "mount.h" + #include "rpc_subs.h" + #include "automount.h" +@@ -259,6 +267,9 @@ static int rpc_do_create_client(struct s + laddr = (struct sockaddr *) &in4_laddr; + in4_raddr->sin_port = htons(info->port); + slen = sizeof(struct sockaddr_in); ++ /* Use rpcbind v2 for AF_INET */ ++ if (info->program == rpcb_prog) ++ info->version = PMAPVERS; + } else if (addr->sa_family == AF_INET6) { + struct sockaddr_in6 *in6_raddr = (struct sockaddr_in6 *) addr; + in6_laddr.sin6_family = AF_INET6; +@@ -315,6 +326,63 @@ static int rpc_do_create_client(struct s + } + #endif + ++#if defined(HAVE_GETRPCBYNAME) || defined(HAVE_GETSERVBYNAME) ++static pthread_mutex_t rpcb_mutex = PTHREAD_MUTEX_INITIALIZER; ++#endif ++ ++static rpcprog_t rpc_getrpcbyname(const rpcprog_t program) ++{ ++#ifdef HAVE_GETRPCBYNAME ++ static const char *rpcb_pgmtbl[] = { ++ "rpcbind", "portmap", "portmapper", "sunrpc", NULL, ++ }; ++ struct rpcent *entry; ++ rpcprog_t prog_number; ++ unsigned int i; ++ ++ pthread_mutex_lock(&rpcb_mutex); ++ for (i = 0; rpcb_pgmtbl[i] != NULL; i++) { ++ entry = getrpcbyname(rpcb_pgmtbl[i]); ++ if (entry) { ++ prog_number = entry->r_number; ++ pthread_mutex_unlock(&rpcb_mutex); ++ return prog_number; ++ } ++ } ++ pthread_mutex_unlock(&rpcb_mutex); ++#endif ++ return program; ++} ++ ++static unsigned short rpc_getrpcbport(const int proto) ++{ ++#ifdef HAVE_GETSERVBYNAME ++ static const char *rpcb_netnametbl[] = { ++ "rpcbind", "portmapper", "sunrpc", NULL, ++ }; ++ struct servent *entry; ++ struct protoent *p_ent; ++ unsigned short port; ++ unsigned int i; ++ ++ pthread_mutex_lock(&rpcb_mutex); ++ p_ent = getprotobynumber(proto); ++ if (!p_ent) ++ goto done; ++ for (i = 0; rpcb_netnametbl[i] != NULL; i++) { ++ entry = getservbyname(rpcb_netnametbl[i], p_ent->p_name); ++ if (entry) { ++ port = entry->s_port; ++ pthread_mutex_unlock(&rpcb_mutex); ++ return port; ++ } ++ } ++done: ++ pthread_mutex_unlock(&rpcb_mutex); ++#endif ++ return (unsigned short) PMAPPORT; ++} ++ + /* + * Create an RPC client + */ +@@ -510,9 +578,15 @@ int rpc_portmap_getclient(struct conn_in + info->host = host; + info->addr = addr; + info->addr_len = addr_len; +- info->program = PMAPPROG; +- info->port = PMAPPORT; +- info->version = PMAPVERS; ++ info->program = rpc_getrpcbyname(rpcb_prog); ++ info->port = ntohs(rpc_getrpcbport(proto)); ++ /* ++ * When using libtirpc we might need to change the rpcbind version ++ * to qurey AF_INET addresses. Since we might not have an address ++ * yet set AF_INET rpcbind version in rpc_do_create_client() when ++ * we always have an address. ++ */ ++ info->version = rpcb_version; + info->proto = proto; + info->send_sz = RPCSMALLMSGSIZE; + info->recv_sz = RPCSMALLMSGSIZE; +@@ -555,9 +629,15 @@ int rpc_portmap_getport(struct conn_info + pmap_info.host = info->host; + pmap_info.addr = info->addr; + pmap_info.addr_len = info->addr_len; +- pmap_info.port = PMAPPORT; +- pmap_info.program = PMAPPROG; +- pmap_info.version = PMAPVERS; ++ pmap_info.port = ntohs(rpc_getrpcbport(info->proto)); ++ pmap_info.program = rpc_getrpcbyname(rpcb_prog); ++ /* ++ * When using libtirpc we might need to change the rpcbind ++ * version to qurey AF_INET addresses. Since we might not ++ * have an address yet set AF_INET rpcbind version in ++ * rpc_do_create_client() when we always have an address. ++ */ ++ pmap_info.version = rpcb_version; + pmap_info.proto = info->proto; + pmap_info.send_sz = RPCSMALLMSGSIZE; + pmap_info.recv_sz = RPCSMALLMSGSIZE; diff --git a/SOURCES/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch b/SOURCES/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch new file mode 100644 index 0000000..99aef1f --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch @@ -0,0 +1,21 @@ +autofs-5.0.7 - fix possible use after free in lookup_dir.c:lookup_init() + +From: Ian Kent + +Add a missing error return in lookup_dir.c:lookup_init(). +--- + modules/lookup_dir.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c +index 07471b7..cbeda1f 100644 +--- a/modules/lookup_dir.c ++++ b/modules/lookup_dir.c +@@ -98,6 +98,7 @@ int lookup_init(const char *mapfmt, int argc, const char *const *argv, void **co + free(ctxt); + warn(LOGOPT_NONE, MODPREFIX + "dir map %s, is not a directory", argv[0]); ++ return 1; + } + + *context = ctxt; diff --git a/SOURCES/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch b/SOURCES/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch new file mode 100644 index 0000000..d0b33ad --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch @@ -0,0 +1,157 @@ +autofs-5.0.7 - fix potential null dereference in lookup_mount() + +From: Ian Kent + +Updating a negative cache entry should always find an entry but the entry +lookup return isn't checked and probably should be. + +Since this code is duplicated in several modules add it as a function to +the cache handling code. +--- + include/automount.h | 1 + + lib/cache.c | 20 ++++++++++++++++++++ + modules/lookup_file.c | 11 +---------- + modules/lookup_ldap.c | 12 +----------- + modules/lookup_sss.c | 12 +----------- + modules/lookup_yp.c | 12 ++---------- + 6 files changed, 26 insertions(+), 42 deletions(-) + +diff --git a/include/automount.h b/include/automount.h +index 6ced842..71787a5 100644 +--- a/include/automount.h ++++ b/include/automount.h +@@ -189,6 +189,7 @@ struct mapent *cache_lookup_offset(const char *prefix, const char *offset, int s + struct mapent *cache_partial_match(struct mapent_cache *mc, const char *prefix); + int cache_add(struct mapent_cache *mc, struct map_source *ms, const char *key, const char *mapent, time_t age); + int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *key, const char *mapent, time_t age); ++void cache_update_negative(struct mapent_cache *mc, struct map_source *ms, const char *key, time_t timeout); + int cache_set_parents(struct mapent *mm); + int cache_update(struct mapent_cache *mc, struct map_source *ms, const char *key, const char *mapent, time_t age); + int cache_delete(struct mapent_cache *mc, const char *key); +diff --git a/lib/cache.c b/lib/cache.c +index ecace4a..be4917b 100644 +--- a/lib/cache.c ++++ b/lib/cache.c +@@ -680,6 +680,26 @@ done: + return ret; + } + ++void cache_update_negative(struct mapent_cache *mc, ++ struct map_source *ms, const char *key, ++ time_t timeout) ++{ ++ time_t now = time(NULL); ++ struct mapent *me; ++ int rv = CHE_OK; ++ ++ me = cache_lookup_distinct(mc, key); ++ if (!me) ++ rv = cache_update(mc, ms, key, NULL, now); ++ if (rv != CHE_FAIL) { ++ me = cache_lookup_distinct(mc, key); ++ if (me) ++ me->status = now + timeout; ++ } ++ return; ++} ++ ++ + static struct mapent *get_parent(const char *key, struct list_head *head, struct list_head **pos) + { + struct list_head *next; +diff --git a/modules/lookup_file.c b/modules/lookup_file.c +index 2836996..4b4ee89 100644 +--- a/modules/lookup_file.c ++++ b/modules/lookup_file.c +@@ -1130,17 +1130,8 @@ do_cache_lookup: + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { +- time_t now = time(NULL); +- int rv = CHE_OK; +- + cache_writelock(mc); +- me = cache_lookup_distinct(mc, key); +- if (!me) +- rv = cache_update(mc, source, key, NULL, now); +- if (rv != CHE_FAIL) { +- me = cache_lookup_distinct(mc, key); +- me->status = now + ap->negative_timeout; +- } ++ cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); + return NSS_STATUS_TRYAGAIN; + } +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index a59de92..26481a8 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -3011,18 +3011,8 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { +- time_t now = time(NULL); +- int rv = CHE_OK; +- +- /* Record the the mount fail in the cache */ + cache_writelock(mc); +- me = cache_lookup_distinct(mc, key); +- if (!me) +- rv = cache_update(mc, source, key, NULL, now); +- if (rv != CHE_FAIL) { +- me = cache_lookup_distinct(mc, key); +- me->status = now + ap->negative_timeout; +- } ++ cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); + return NSS_STATUS_TRYAGAIN; + } +diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c +index 5c2ed0a..1fe740b 100644 +--- a/modules/lookup_sss.c ++++ b/modules/lookup_sss.c +@@ -672,18 +672,8 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { +- time_t now = time(NULL); +- int rv = CHE_OK; +- +- /* Record the the mount fail in the cache */ + cache_writelock(mc); +- me = cache_lookup_distinct(mc, key); +- if (!me) +- rv = cache_update(mc, source, key, NULL, now); +- if (rv != CHE_FAIL) { +- me = cache_lookup_distinct(mc, key); +- me->status = now + ap->negative_timeout; +- } ++ cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); + return NSS_STATUS_TRYAGAIN; + } +diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c +index a716e1f..e99e3c0 100644 +--- a/modules/lookup_yp.c ++++ b/modules/lookup_yp.c +@@ -698,18 +698,10 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + ret = ctxt->parse->parse_mount(ap, key, key_len, + mapent, ctxt->parse->context); + if (ret) { +- time_t now = time(NULL); +- int rv = CHE_OK; +- + cache_writelock(mc); +- me = cache_lookup_distinct(mc, key); +- if (!me) +- rv = cache_update(mc, source, key, NULL, now); +- if (rv != CHE_FAIL) { +- me = cache_lookup_distinct(mc, key); +- me->status = now + ap->negative_timeout; +- } ++ cache_update_negative(mc, source, key, ap->negative_timeout); + cache_unlock(mc); ++ return NSS_STATUS_TRYAGAIN; + } + } + diff --git a/SOURCES/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch b/SOURCES/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch new file mode 100644 index 0000000..1801878 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch @@ -0,0 +1,36 @@ +autofs-5.0.7 - fix probe each nfs version in turn for singleton mounts + +From: Ian Kent + +If there aren't any hosts in the list returned from parse_location() make sure +the probe checks are skipped. +--- + CHANGELOG | 1 + + modules/mount_nfs.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 25179b1..0242c11 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -50,6 +50,7 @@ + - fix fix map entry duplicate offset detection. + - probe each nfs version in turn for singleton mounts. + - add changlog entry for coverity fixes. ++- fix probe each nfs version in turn for singleton mounts. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 81ba3ca..9de8a73 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -190,7 +190,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + * to NFSv3 (if it can). If the NFSv4 probe fails then probe as + * normal. + */ +- if (!hosts->next && ++ if ((hosts && !hosts->next) && + mount_default_proto == 4 && + vers & NFS_VERS_MASK != 0 && + vers & NFS4_VERS_MASK != 0) { diff --git a/SOURCES/autofs-5.0.7-fix-requires-in-spec-file.patch b/SOURCES/autofs-5.0.7-fix-requires-in-spec-file.patch new file mode 100644 index 0000000..404c848 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-requires-in-spec-file.patch @@ -0,0 +1,37 @@ +autofs-5.0.7 - fix requires in spec file + +From: Ian Kent + +Fix the use of depricated reqires in tar spec file. +--- + CHANGELOG | 1 + + autofs.spec | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 247d334..e848bcd 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -33,6 +33,7 @@ + - fix file descriptor leak when reloading the daemon. + - depricate nosymlink pseudo option. + - add symlink pseudo option. ++- fix requires in spec file. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/autofs.spec b/autofs.spec +index b8a3b7a..703f7a9 100644 +--- a/autofs.spec ++++ b/autofs.spec +@@ -25,8 +25,8 @@ Buildroot: %{_tmppath}/%{name}-tmp + %if %{with_systemd} + BuildRequires: systemd-units + %endif +-BuildPrereq: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel +-Prereq: chkconfig ++BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel ++Requires: chkconfig + Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps + %if %{with_systemd} + Requires(post): systemd-sysv diff --git a/SOURCES/autofs-5.0.7-fix-several-off-by-one-errors.patch b/SOURCES/autofs-5.0.7-fix-several-off-by-one-errors.patch new file mode 100644 index 0000000..bb94957 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-several-off-by-one-errors.patch @@ -0,0 +1,128 @@ +autofs-5.0.7 - fix several off by one errors + +From: Ian Kent + +Fix several off-by-one array reference errors and a couple of short allocation +errors. +--- + daemon/spawn.c | 10 +++++----- + lib/defaults.c | 2 +- + modules/lookup_ldap.c | 8 ++++---- + modules/parse_hesiod.c | 2 +- + modules/parse_sun.c | 2 +- + 5 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/daemon/spawn.c b/daemon/spawn.c +index 3b4a009..9b8d5a2 100644 +--- a/daemon/spawn.c ++++ b/daemon/spawn.c +@@ -320,7 +320,7 @@ int spawn_mount(unsigned logopt, ...) + unsigned int retries = MTAB_LOCK_RETRIES; + int update_mtab = 1, ret, printed = 0; + unsigned int wait = defaults_get_mount_wait(); +- char buf[PATH_MAX]; ++ char buf[PATH_MAX + 1]; + + /* If we use mount locking we can't validate the location */ + #ifdef ENABLE_MOUNT_LOCKING +@@ -346,7 +346,7 @@ int spawn_mount(unsigned logopt, ...) + } + + /* Alloc 1 extra slot in case we need to use the "-f" option */ +- if (!(argv = alloca(sizeof(char *) * argc + 2))) ++ if (!(argv = alloca(sizeof(char *) * (argc + 2)))) + return -1; + + argv[0] = arg0; +@@ -448,7 +448,7 @@ int spawn_bind_mount(unsigned logopt, ...) + unsigned int options; + unsigned int retries = MTAB_LOCK_RETRIES; + int update_mtab = 1, ret, printed = 0; +- char buf[PATH_MAX]; ++ char buf[PATH_MAX + 1]; + + /* If we use mount locking we can't validate the location */ + #ifdef ENABLE_MOUNT_LOCKING +@@ -477,7 +477,7 @@ int spawn_bind_mount(unsigned logopt, ...) + } + } + +- if (!(argv = alloca(sizeof(char *) * argc + 2))) ++ if (!(argv = alloca(sizeof(char *) * (argc + 2)))) + return -1; + + argv[0] = arg0; +@@ -556,7 +556,7 @@ int spawn_umount(unsigned logopt, ...) + unsigned int retries = MTAB_LOCK_RETRIES; + int update_mtab = 1, ret, printed = 0; + unsigned int wait = defaults_get_umount_wait(); +- char buf[PATH_MAX]; ++ char buf[PATH_MAX + 1]; + + #ifdef ENABLE_MOUNT_LOCKING + options = SPAWN_OPT_LOCK; +diff --git a/lib/defaults.c b/lib/defaults.c +index ae1162f..1e89509 100644 +--- a/lib/defaults.c ++++ b/lib/defaults.c +@@ -227,7 +227,7 @@ void defaults_free_uris(struct list_head *list) + static unsigned int add_uris(char *value, struct list_head *list) + { + char *str, *tok, *ptr = NULL; +- size_t len = strlen(value); ++ size_t len = strlen(value) + 1; + + str = alloca(len); + if (!str) +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 83e3215..17cbe9a 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -2234,8 +2234,8 @@ static int do_get_entries(struct ldap_search_params *sp, struct map_source *sour + mapent = new_me; + strcat(mapent, " "); + strncat(mapent, v_val, v_len); +- mapent[new_size] = '\0'; +- mapent_len = new_size; ++ mapent[new_size - 1] = '\0'; ++ mapent_len = new_size - 1; + } else { + char *estr; + estr = strerror_r(errno, buf, sizeof(buf)); +@@ -2723,8 +2723,8 @@ static int lookup_one(struct autofs_point *ap, + mapent = new_me; + strcat(mapent, " "); + strncat(mapent, v_val, v_len); +- mapent[new_size] = '\0'; +- mapent_len = new_size; ++ mapent[new_size - 1] = '\0'; ++ mapent_len = new_size - 1; + } else { + char *estr; + estr = strerror_r(errno, buf, sizeof(buf)); +diff --git a/modules/parse_hesiod.c b/modules/parse_hesiod.c +index 7a6a57d..237fd50 100644 +--- a/modules/parse_hesiod.c ++++ b/modules/parse_hesiod.c +@@ -117,7 +117,7 @@ static int parse_nfs(struct autofs_point *ap, + p++; + + /* Isolate the remote mountpoint for this NFS fs. */ +- for (i = 0; (!isspace(p[i]) && i < (int) sizeof(mount)); i++) { ++ for (i = 0; (!isspace(p[i]) && i < ((int) sizeof(mount) - 1)); i++) { + if (!p[i]) { + error(ap->logopt, MODPREFIX + "unexpeced end of input looking for NFS " +diff --git a/modules/parse_sun.c b/modules/parse_sun.c +index ae1caf7..c1fc528 100644 +--- a/modules/parse_sun.c ++++ b/modules/parse_sun.c +@@ -1135,7 +1135,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, + } + ro_len = strlen(ro_loc); + +- tmp = alloca(mnt_root_len + 1); ++ tmp = alloca(mnt_root_len + 2); + strcpy(tmp, mnt_root); + tmp[mnt_root_len] = '/'; + tmp[mnt_root_len + 1] = '\0'; diff --git a/SOURCES/autofs-5.0.7-fix-some-automount_8-typos.patch b/SOURCES/autofs-5.0.7-fix-some-automount_8-typos.patch new file mode 100644 index 0000000..5e84c6c --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-some-automount_8-typos.patch @@ -0,0 +1,45 @@ +autofs-5.0.7 - fix some automount(8) typos + +From: Ian Kent + +Fix a couple of spelling errors in the automount(8) man page +that have been around for a long time. +--- + CHANGELOG | 1 + + man/automount.8 | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index d8e4049..488ad1e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -37,6 +37,7 @@ + - fix libtirpc build option to require libtirpc-devel if needed. + - fix systemd unidir in spec file. + - document browse option in man page. ++- fix some automount(8) typos. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/automount.8 b/man/automount.8 +index dddebce..7cc32c5 100644 +--- a/man/automount.8 ++++ b/man/automount.8 +@@ -43,7 +43,7 @@ autofs managed mounts. + .TP + .I "\-d, \-\-debug" + Enables logging of general status and progress messages as well as +-debuging messages for all autofs managed mounts. ++debugging messages for all autofs managed mounts. + .TP + .I "\-Dvariable=value" + Define a global macro substitution variable. Global definitions +@@ -133,7 +133,7 @@ unused. If the force umount at exit option is used the filesystems + will be umounted but the mount will not be released by the kernel + until they are no longer in use by the processes that held them busy. + If automount managed filesystems are found mounted when autofs is +-started they will be recoverd unless they are no longer present in ++started they will be recovered unless they are no longer present in + the map in which case they need to umounted manually. + .P + If the option to disable the check to see if the daemon is already diff --git a/SOURCES/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch b/SOURCES/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch new file mode 100644 index 0000000..2d02023 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch @@ -0,0 +1,23 @@ +autofs-5.0.7 - fix spawn_umount() return check in mount_bind.c:lookup_init() + +From: Ian Kent + +Check return of spawn_umount() and report it if it fails. +--- + modules/mount_bind.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules/mount_bind.c b/modules/mount_bind.c +index 4975294..d6c6fe7 100644 +--- a/modules/mount_bind.c ++++ b/modules/mount_bind.c +@@ -57,7 +57,8 @@ int mount_init(void **context) + bind_works = 1; + } + +- spawn_umount(LOGOPT_NONE, "-n", t2_dir, NULL); ++ if (spawn_umount(LOGOPT_NONE, "-n", t2_dir, NULL) != 0) ++ debug(LOGOPT_ANY, MODPREFIX "umount failed for %s", t2_dir); + + out: + rmdir(t1_dir); diff --git a/SOURCES/autofs-5.0.7-fix-submount-offset-delete.patch b/SOURCES/autofs-5.0.7-fix-submount-offset-delete.patch new file mode 100644 index 0000000..b38e214 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-submount-offset-delete.patch @@ -0,0 +1,45 @@ +autofs-5.0.7 - fix submount offset delete + +From: Ian Kent + +As part of the implementation to allow for limited update of +the internal hosts map by using a HUP signal some code that +deleted any offset entries from the cache on lookup was removed +as it appeared to not be needed. + +There is however a case where it is needed to avoid a duplicate +cache entry failure on lookup. +--- + + CHANGELOG | 1 + + daemon/automount.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 7eb7235..76c1f73 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -18,6 +18,7 @@ + - fix map entry duplicate offset detection. + - Allow nsswitch.conf to not contain "automount:" lines. + - fix nobind man page description. ++- fix submount offset delete. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/automount.c b/daemon/automount.c +index e56f9e1..4a3eb3d 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -544,8 +544,8 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) + * If we are a submount we need to umount any offsets our + * parent may have mounted over top of us. + */ +- /*if (ap->submount) +- left += umount_subtree_mounts(ap->parent, path, is_autofs_fs);*/ ++ if (ap->submount) ++ left += umount_subtree_mounts(ap->parent, path, is_autofs_fs); + + left += umount_subtree_mounts(ap, path, is_autofs_fs); + diff --git a/SOURCES/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch b/SOURCES/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch new file mode 100644 index 0000000..09ed383 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch @@ -0,0 +1,70 @@ +autofs-5.0.7 - fix submount tree not all expiring + +From: Ian Kent + +Due to the change in the expire-specific-submount-only patch, sub-mounts +within an indirect mount that follow a submount (in the check order) won't +be expired if that submount is busy. +--- + CHANGELOG | 1 + + lib/master.c | 24 +++++++++++++++--------- + 2 files changed, 16 insertions(+), 9 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index f1ec1e5..4106e7f 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -39,6 +39,7 @@ + - document browse option in man page. + - fix some automount(8) typos. + - syncronize handle_mounts() shutdown. ++- fix submount tree not all expiring. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master.c b/lib/master.c +index a0e62f2..64dbcb1 100644 +--- a/lib/master.c ++++ b/lib/master.c +@@ -905,15 +905,24 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state + this = list_entry(p, struct autofs_point, mounts); + p = p->prev; + +- if (!master_submount_list_empty(this)) { +- mounts_mutex_unlock(ap); +- return master_notify_submount(this, path, state); +- } +- + /* path not the same */ + if (strcmp(this->path, path)) + continue; + ++ if (!master_submount_list_empty(this)) { ++ char *this_path = strdup(this->path); ++ if (this_path) { ++ mounts_mutex_unlock(ap); ++ master_notify_submount(this, path, state); ++ mounts_mutex_lock(ap); ++ if (!__master_find_submount(ap, this_path)) { ++ free(this_path); ++ continue; ++ } ++ free(this_path); ++ } ++ } ++ + /* Now we have found the submount we want to expire */ + + st_mutex_lock(); +@@ -959,10 +968,7 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state + st_mutex_lock(); + } + st_mutex_unlock(); +- mounts_mutex_unlock(ap); +- +- return ret; +- ++ break; + } + + mounts_mutex_unlock(ap); diff --git a/SOURCES/autofs-5.0.7-fix-syncronize-handle_mounts-shutdown.patch b/SOURCES/autofs-5.0.7-fix-syncronize-handle_mounts-shutdown.patch new file mode 100644 index 0000000..c6a90af --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-syncronize-handle_mounts-shutdown.patch @@ -0,0 +1,36 @@ +autofs-5.0.7 - fix syncronize handle_mounts() shutdown + +From: Ian Kent + +A recent change to fix a problem where automount would exit when re-reading +the master map if more than on entry had been removed causes automount to +ignore HUP signals if the mount list is empty. + +Removing that check and testing shows that the remainder of the change still +fixes the original problem. +--- + CHANGELOG | 1 + + daemon/automount.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -56,6 +56,7 @@ + - don't override LDFLAGS in make rules. + - fix a couple of compiler warnings. + - add after sssd dependency to unit file. ++- fix syncronize handle_mounts() shutdown. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/daemon/automount.c ++++ autofs-5.0.7/daemon/automount.c +@@ -1286,7 +1286,7 @@ static int do_hup_signal(struct master * + + master_mutex_lock(); + /* Already doing a map read or shutdown or no mounts */ +- if (master->reading || list_empty(&master->mounts)) { ++ if (master->reading) { + status = pthread_mutex_unlock(&mrc.mutex); + if (status) + fatal(status); diff --git a/SOURCES/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch b/SOURCES/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch new file mode 100644 index 0000000..d856faf --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch @@ -0,0 +1,72 @@ +autofs-5.0.7 - fix systemd unidir in spec file + +From: Ian Kent + + +--- + CHANGELOG | 1 + + autofs.spec | 16 ++++++++-------- + 2 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index b6b2679..ecdea0b 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -35,6 +35,7 @@ + - add symlink pseudo option. + - fix requires in spec file. + - fix libtirpc build option to require libtirpc-devel if needed. ++- fix systemd unidir in spec file. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/autofs.spec b/autofs.spec +index f77acc1..a768e44 100644 +--- a/autofs.spec ++++ b/autofs.spec +@@ -76,7 +76,7 @@ inkludera n + %setup -q + echo %{version}-%{release} > .version + %if %{with_systemd} +- %define _unitdir %{?_unitdir:/lib/systemd/system} ++ %define unitdir %{?_unitdir:/lib/systemd/system} + %define systemd_configure_arg --with-systemd + %endif + %if %{with_libtirpc} +@@ -95,7 +95,7 @@ CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 + %install + rm -rf $RPM_BUILD_ROOT + %if %{with_systemd} +-install -d -m 755 $RPM_BUILD_ROOT%{_unitdir} ++install -d -m 755 $RPM_BUILD_ROOT%{unitdir} + %else + mkdir -p -m755 $RPM_BUILD_ROOT/etc/rc.d/init.d + %endif +@@ -109,9 +109,13 @@ make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_R + echo make -C redhat + make -C redhat + %if %{with_systemd} +-install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{_unitdir}/autofs.service ++# Configure can get this wrong when the unit files appear under /lib and /usr/lib ++find $RPM_BUILD_ROOT -type f -name autofs.service -exec rm -f {} \; ++install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{unitdir}/autofs.service ++%define init_file_name %{unitdir}/autofs.service + %else + install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs ++%define init_file_name /etc/rc.d/init.d/autofs + %endif + install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs + +@@ -170,11 +174,7 @@ fi + %files + %defattr(-,root,root) + %doc CREDITS CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf +-%if %{with_systemd} +-%{_unitdir}/autofs.service +-%else +-%config /etc/rc.d/init.d/autofs +-%endif ++%config %{init_file_name} + %config(noreplace) /etc/auto.master + %config(noreplace,missingok) /etc/auto.misc + %config(noreplace,missingok) /etc/auto.net diff --git a/SOURCES/autofs-5.0.7-fix-typo-in-automount-8.patch b/SOURCES/autofs-5.0.7-fix-typo-in-automount-8.patch new file mode 100644 index 0000000..0dd7c2b --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-typo-in-automount-8.patch @@ -0,0 +1,33 @@ +autofs-5.0.7 - fix typo in automount(8) + +From: Ian Kent + + +--- + + CHANGELOG | 1 + + man/automount.8 | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -4,6 +4,7 @@ + - fix use cache entry after free in lookup_prune_one_cache(). + - fix ipv6 proximity calculation. + - fix parse buffer initialization. ++- fix typo in automount(8). + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/man/automount.8 ++++ autofs-5.0.7/man/automount.8 +@@ -51,7 +51,7 @@ are over-ridden macro definitions of the + mount entries. + .TP + .I "\-f, \-\-foreground" +-Run the daemon in the forground and log to stderr instead of syslog." ++Run the daemon in the foreground and log to stderr instead of syslog." + .TP + .I "\-r, \-\-random-multimount-selection" + Enables the use of ramdom selection when choosing a host from a diff --git a/SOURCES/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch b/SOURCES/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch new file mode 100644 index 0000000..a469c16 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch @@ -0,0 +1,49 @@ +autofs-5.0.7 - fix use cache entry after free mistake + +From: Ian Kent + +Fix an obvious use after free mistake in lookup_prune_one_cache(). +--- + + CHANGELOG | 1 + + daemon/lookup.c | 7 +++++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index faf4c80..dc38580 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -1,6 +1,7 @@ + ??/??/2012 autofs-5.0.8 + ======================= + - fix nobind sun escaped map entries. ++- fix use cache entry after free in lookup_prune_one_cache(). + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/lookup.c b/daemon/lookup.c +index 7909536..e3d9536 100644 +--- a/daemon/lookup.c ++++ b/daemon/lookup.c +@@ -1103,15 +1103,18 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti + if (valid) + cache_delete(mc, key); + else if (!is_mounted(_PROC_MOUNTS, path, MNTS_AUTOFS)) { ++ dev_t devid = ap->dev; + status = CHE_FAIL; ++ if (ap->type == LKP_DIRECT) ++ devid = this->dev; + if (this->ioctlfd == -1) + status = cache_delete(mc, key); + if (status != CHE_FAIL) { + if (ap->type == LKP_INDIRECT) { + if (ap->flags & MOUNT_FLAG_GHOST) +- rmdir_path(ap, path, ap->dev); ++ rmdir_path(ap, path, devid); + } else +- rmdir_path(ap, path, this->dev); ++ rmdir_path(ap, path, devid); + } + } + cache_unlock(mc); diff --git a/SOURCES/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch b/SOURCES/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch new file mode 100644 index 0000000..74ed8fa --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch @@ -0,0 +1,54 @@ +autofs-5.0.7 - fix use get_proximity() without libtirpc + +From: Ian Kent + +If autofs is not using libtirpc and there are any configured IPv6 +interfaces then get_proximity() will fail with PROXIMITY_UNSUPPORTED. + +In this case when checking interfaces the IPv6 interfaces need to be +ignored. +--- + + CHANGELOG | 1 + + modules/replicated.c | 8 ++------ + 2 files changed, 3 insertions(+), 6 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 5bcb1af..460bd27 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -20,6 +20,7 @@ + - fix nobind man page description. + - fix submount offset delete. + - fix init script status return. ++- fix use get_proximity() without libtirpc. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/replicated.c b/modules/replicated.c +index bd6003b..6b96320 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -184,9 +184,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + break; + + case AF_INET6: +-#ifndef WITH_LIBTIRPC +- return PROXIMITY_UNSUPPORTED; +-#else ++#ifdef WITH_LIBTIRPC + if (host_addr->sa_family == AF_INET) + break; + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; +@@ -251,9 +249,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + break; + + case AF_INET6: +-#ifndef WITH_LIBTIRPC +- return PROXIMITY_UNSUPPORTED; +-#else ++#ifdef WITH_LIBTIRPC + if (host_addr->sa_family == AF_INET) + break; + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; diff --git a/SOURCES/autofs-5.0.7-fix-wildcard-multi-map-regression.patch b/SOURCES/autofs-5.0.7-fix-wildcard-multi-map-regression.patch new file mode 100644 index 0000000..44e4a18 --- /dev/null +++ b/SOURCES/autofs-5.0.7-fix-wildcard-multi-map-regression.patch @@ -0,0 +1,225 @@ +autofs-5.0.7 - fix wildcard multi map regression + +From: Ian Kent + +A recent patch that removed code to add the current map entry when +being parsed if it didn't already exist cause wildcard indirect +multi-mount map entries to fail to mount. + +Indirect multi-mount map entries need the entry matched by a wildcard +lookup to be added to the map entry cache because subsequent operations +expect a distinct map entry to be present or they will fail. This is +what the code that was removed did but it did so in the wrong place +which caused a deadlock situation. +--- + CHANGELOG | 1 + + modules/lookup_file.c | 23 ++++++++++++++++------- + modules/lookup_ldap.c | 19 +++++++++++++++---- + modules/lookup_nisplus.c | 21 ++++++++++++++++----- + modules/lookup_sss.c | 17 ++++++++++++++--- + modules/lookup_yp.c | 21 ++++++++++++++++----- + 6 files changed, 78 insertions(+), 24 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 97d6f48..46ef335 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -29,6 +29,7 @@ + - modules/replicated.c: use sin6_addr.s6_addr32. + - workaround missing GNU versionsort extension. + - dont fail on master map self include. ++- fix wildcard multi map regression. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/lookup_file.c b/modules/lookup_file.c +index f37bed9..65e5ee6 100644 +--- a/modules/lookup_file.c ++++ b/modules/lookup_file.c +@@ -1040,7 +1040,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + return NSS_STATUS_UNAVAIL; + } + +- cache_readlock(mc); ++ cache_writelock(mc); + me = cache_lookup_first(mc); + if (me && st.st_mtime <= me->age) { + /* +@@ -1082,7 +1082,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + } + } + +- cache_readlock(mc); ++ cache_writelock(mc); + do_cache_lookup: + me = cache_lookup(mc, key); + /* +@@ -1098,11 +1098,20 @@ do_cache_lookup: + if (!me) + me = cache_lookup_distinct(mc, "*"); + } +- if (me && me->mapent && (me->source == source || *me->key == '/')) { +- pthread_cleanup_push(cache_lock_cleanup, mc); +- strcpy(mapent_buf, me->mapent); +- mapent = mapent_buf; +- pthread_cleanup_pop(0); ++ if (me && me->mapent) { ++ /* ++ * Add wildcard match for later validation checks and ++ * negative cache lookups. ++ */ ++ if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ ret = cache_update(mc, source, key, me->mapent, me->age); ++ if (!(ret & (CHE_OK | CHE_UPDATED))) ++ me = NULL; ++ } ++ if (me && (me->source == source || *me->key == '/')) { ++ strcpy(mapent_buf, me->mapent); ++ mapent = mapent_buf; ++ } + } + cache_unlock(mc); + +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 431e50d..83e3215 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -2969,7 +2969,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + return status; + } + +- cache_readlock(mc); ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -2979,9 +2979,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + if (!me) + me = cache_lookup_distinct(mc, "*"); + } +- if (me && me->mapent && (me->source == source || *me->key == '/')) { +- strcpy(mapent_buf, me->mapent); +- mapent = mapent_buf; ++ if (me && me->mapent) { ++ /* ++ * Add wildcard match for later validation checks and ++ * negative cache lookups. ++ */ ++ if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ ret = cache_update(mc, source, key, me->mapent, me->age); ++ if (!(ret & (CHE_OK | CHE_UPDATED))) ++ me = NULL; ++ } ++ if (me && (me->source == source || *me->key == '/')) { ++ strcpy(mapent_buf, me->mapent); ++ mapent = mapent_buf; ++ } + } + cache_unlock(mc); + +diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c +index 9fced96..8237a1e 100644 +--- a/modules/lookup_nisplus.c ++++ b/modules/lookup_nisplus.c +@@ -561,7 +561,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + return status; + } + +- cache_readlock(mc); ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -571,10 +571,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + if (!me) + me = cache_lookup_distinct(mc, "*"); + } +- if (me && me->mapent && (me->source == source || *me->key == '/')) { +- mapent_len = strlen(me->mapent); +- mapent = malloc(mapent_len + 1); +- strcpy(mapent, me->mapent); ++ if (me && me->mapent) { ++ /* ++ * Add wildcard match for later validation checks and ++ * negative cache lookups. ++ */ ++ if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ ret = cache_update(mc, source, key, me->mapent, me->age); ++ if (!(ret & (CHE_OK | CHE_UPDATED))) ++ me = NULL; ++ } ++ if (me && (me->source == source || *me->key == '/')) { ++ mapent_len = strlen(me->mapent); ++ mapent = malloc(mapent_len + 1); ++ strcpy(mapent, me->mapent); ++ } + } + cache_unlock(mc); + +diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c +index e0b84cc..5c2ed0a 100644 +--- a/modules/lookup_sss.c ++++ b/modules/lookup_sss.c +@@ -645,9 +645,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + if (!me) + me = cache_lookup_distinct(mc, "*"); + } +- if (me && me->mapent && (me->source == source || *me->key == '/')) { +- strcpy(mapent_buf, me->mapent); +- mapent = mapent_buf; ++ if (me && me->mapent) { ++ /* ++ * Add wildcard match for later validation checks and ++ * negative cache lookups. ++ */ ++ if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ ret = cache_update(mc, source, key, me->mapent, me->age); ++ if (!(ret & (CHE_OK | CHE_UPDATED))) ++ me = NULL; ++ } ++ if (me && (me->source == source || *me->key == '/')) { ++ strcpy(mapent_buf, me->mapent); ++ mapent = mapent_buf; ++ } + } + cache_unlock(mc); + +diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c +index 720df2e..a716e1f 100644 +--- a/modules/lookup_yp.c ++++ b/modules/lookup_yp.c +@@ -662,7 +662,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + return status; + } + +- cache_readlock(mc); ++ cache_writelock(mc); + me = cache_lookup(mc, key); + /* Stale mapent => check for entry in alternate source or wildcard */ + if (me && !me->mapent) { +@@ -672,10 +672,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * + if (!me) + me = cache_lookup_distinct(mc, "*"); + } +- if (me && me->mapent && (me->source == source || *me->key == '/')) { +- mapent_len = strlen(me->mapent); +- mapent = alloca(mapent_len + 1); +- strcpy(mapent, me->mapent); ++ if (me && me->mapent) { ++ /* ++ * Add wildcard match for later validation checks and ++ * negative cache lookups. ++ */ ++ if (ap->type == LKP_INDIRECT && *me->key == '*') { ++ ret = cache_update(mc, source, key, me->mapent, me->age); ++ if (!(ret & (CHE_OK | CHE_UPDATED))) ++ me = NULL; ++ } ++ if (me && (me->source == source || *me->key == '/')) { ++ mapent_len = strlen(me->mapent); ++ mapent = alloca(mapent_len + 1); ++ strcpy(mapent, me->mapent); ++ } + } + cache_unlock(mc); + diff --git a/SOURCES/autofs-5.0.7-handle-new-location-of-systemd.patch b/SOURCES/autofs-5.0.7-handle-new-location-of-systemd.patch new file mode 100644 index 0000000..1c26794 --- /dev/null +++ b/SOURCES/autofs-5.0.7-handle-new-location-of-systemd.patch @@ -0,0 +1,57 @@ +autofs-5.0.7 - Handle new location of systemd + +From: Frederic Crozat + +Some distributions are moving systemd unit files from /lib to +/usr/lib, so we need to test both directories. + +edit: imk +It occurs to me I've forgotten to check for the 64 bit variants +of the directories, so add them as well. +end edit: imk +--- + + CHANGELOG | 1 + + aclocal.m4 | 2 +- + configure | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 3bdf8a4..8f6bb3a 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -14,6 +14,7 @@ + - allow non root user to check status. + - fix recursive mount deadlock. + - increase file map read buffer size. ++- handle new location of systemd. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/aclocal.m4 b/aclocal.m4 +index 1798c8b..47bca0c 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -234,7 +234,7 @@ AC_DEFUN([AF_WITH_SYSTEMD], + [if test "$withval" = yes; then + if test -z "$systemddir"; then + AC_MSG_CHECKING([location of the systemd unit files directory]) +- for systemd_d in /lib/systemd/system; do ++ for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do + if test -z "$systemddir"; then + if test -d "$systemd_d"; then + systemddir="$systemd_d" +diff --git a/configure b/configure +index ba3bba6..3722a46 100755 +--- a/configure ++++ b/configure +@@ -2157,7 +2157,7 @@ if test "${with_systemd+set}" = set; then : + if test -z "$systemddir"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5 + $as_echo_n "checking location of the systemd unit files directory... " >&6; } +- for systemd_d in /lib/systemd/system; do ++ for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do + if test -z "$systemddir"; then + if test -d "$systemd_d"; then + systemddir="$systemd_d" diff --git a/SOURCES/autofs-5.0.7-include-usage-in-usage-message.patch b/SOURCES/autofs-5.0.7-include-usage-in-usage-message.patch new file mode 100644 index 0000000..1c8a565 --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch b/SOURCES/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch new file mode 100644 index 0000000..22e0418 --- /dev/null +++ b/SOURCES/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch @@ -0,0 +1,448 @@ +autofs-5.0.7 - lib/defaults.c: use WITH_LDAP conditional around LDAP types + +From: Chris Packham + +Wrap the inclusion of lookup_ldap.h and functions that use ldap_uri or +ldap_schema with the WITH_LDAP conditional. WITH_LDAP is set by the +configure step when LDAP support is not desired. This also allows +compilation on a system that doesn't have any LDAP libraries. +--- + + CHANGELOG | 1 + include/defaults.h | 14 +- + include/lookup_ldap.h | 1 + lib/defaults.c | 325 +++++++++++++++++++++++++------------------------ + modules/lookup_ldap.c | 1 + 5 files changed, 175 insertions(+), 167 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index ba1d65b..1130db6 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -24,6 +24,7 @@ + - don't use dirent d_type to filter out files in scandir() + - don't schedule new alarms after readmap. + - use numeric protocol ids instead of protoent structs. ++- lib/defaults.c: use WITH_LDAP conditional around LDAP types. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/include/defaults.h b/include/defaults.h +index cda2174..871e14b 100644 +--- a/include/defaults.h ++++ b/include/defaults.h +@@ -44,8 +44,16 @@ + + #define DEFAULT_MAP_HASH_TABLE_SIZE 1024 + ++#ifdef WITH_LDAP + struct ldap_schema; + struct ldap_searchdn; ++void defaults_free_uris(struct list_head *); ++struct list_head *defaults_get_uris(void); ++struct ldap_schema *defaults_get_default_schema(void); ++void defaults_free_searchdns(struct ldap_searchdn *); ++struct ldap_searchdn *defaults_get_searchdns(void); ++struct ldap_schema *defaults_get_schema(void); ++#endif + + unsigned int defaults_read_config(unsigned int); + const char *defaults_get_master_map(void); +@@ -57,12 +65,6 @@ unsigned int defaults_get_logging(void); + const char *defaults_get_ldap_server(void); + unsigned int defaults_get_ldap_timeout(void); + unsigned int defaults_get_ldap_network_timeout(void); +-struct list_head *defaults_get_uris(void); +-void defaults_free_uris(struct list_head *); +-struct ldap_schema *defaults_get_default_schema(void); +-struct ldap_schema *defaults_get_schema(void); +-struct ldap_searchdn *defaults_get_searchdns(void); +-void defaults_free_searchdns(struct ldap_searchdn *); + unsigned int defaults_get_mount_nfs_default_proto(void); + unsigned int defaults_get_append_options(void); + unsigned int defaults_get_mount_wait(void); +diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h +index e441a61..9a4ce73 100644 +--- a/include/lookup_ldap.h ++++ b/include/lookup_ldap.h +@@ -8,7 +8,6 @@ + #include + #include + #include +-#include + #include + #endif + +diff --git a/lib/defaults.c b/lib/defaults.c +index 5ce71b7..ae1162f 100644 +--- a/lib/defaults.c ++++ b/lib/defaults.c +@@ -17,9 +17,12 @@ + #include + #include + ++#include "config.h" + #include "list.h" + #include "defaults.h" ++#ifdef WITH_LDAP + #include "lookup_ldap.h" ++#endif + #include "log.h" + #include "automount.h" + +@@ -197,6 +200,7 @@ static int parse_line(char *line, char **res, char **value) + return 1; + } + ++#ifdef WITH_LDAP + void defaults_free_uris(struct list_head *list) + { + struct list_head *next; +@@ -290,166 +294,6 @@ struct list_head *defaults_get_uris(void) + return list; + } + +-/* +- * Read config env variables and check they have been set. +- * +- * This simple minded routine assumes the config file +- * is valid bourne shell script without spaces around "=" +- * and that it has valid values. +- */ +-unsigned int defaults_read_config(unsigned int to_syslog) +-{ +- FILE *f; +- char buf[MAX_LINE_LEN]; +- char *res; +- +- f = open_fopen_r(DEFAULTS_CONFIG_FILE); +- if (!f) +- return 0; +- +- while ((res = fgets(buf, MAX_LINE_LEN, f))) { +- char *key, *value; +- +- if (!parse_line(res, &key, &value)) +- continue; +- +- if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || +- check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || +- check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || +- check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || +- check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || +- check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || +- check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || +- check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || +- check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || +- check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) +- ; +- } +- +- if (!feof(f) || ferror(f)) { +- if (!to_syslog) { +- fprintf(stderr, +- "fgets returned error %d while reading %s\n", +- ferror(f), DEFAULTS_CONFIG_FILE); +- } else { +- logmsg("fgets returned error %d while reading %s", +- ferror(f), DEFAULTS_CONFIG_FILE); +- } +- fclose(f); +- return 0; +- } +- +- fclose(f); +- return 1; +-} +- +-const char *defaults_get_master_map(void) +-{ +- char *master; +- +- master = get_env_string(ENV_NAME_MASTER_MAP); +- if (!master) +- return strdup(default_master_map_name); +- +- return (const char *) master; +-} +- +-int defaults_master_set(void) +-{ +- char *val = getenv(ENV_NAME_MASTER_MAP); +- if (!val) +- return 0; +- +- return 1; +-} +- +-unsigned int defaults_get_timeout(void) +-{ +- long timeout; +- +- timeout = get_env_number(ENV_NAME_TIMEOUT); +- if (timeout < 0) +- timeout = DEFAULT_TIMEOUT; +- +- return (unsigned int) timeout; +-} +- +-unsigned int defaults_get_negative_timeout(void) +-{ +- long n_timeout; +- +- n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); +- if (n_timeout <= 0) +- n_timeout = DEFAULT_NEGATIVE_TIMEOUT; +- +- return (unsigned int) n_timeout; +-} +- +-unsigned int defaults_get_browse_mode(void) +-{ +- int res; +- +- res = get_env_yesno(ENV_NAME_BROWSE_MODE); +- if (res < 0) +- res = DEFAULT_BROWSE_MODE; +- +- return res; +-} +- +-unsigned int defaults_get_logging(void) +-{ +- char *res; +- unsigned int logging = DEFAULT_LOGGING; +- +- res = get_env_string(ENV_NAME_LOGGING); +- if (!res) +- return logging; +- +- if (!strcasecmp(res, "none")) +- logging = DEFAULT_LOGGING; +- else { +- if (!strcasecmp(res, "verbose")) +- logging |= LOGOPT_VERBOSE; +- +- if (!strcasecmp(res, "debug")) +- logging |= LOGOPT_DEBUG; +- } +- +- free(res); +- +- return logging; +-} +- +-unsigned int defaults_get_ldap_timeout(void) +-{ +- int res; +- +- res = get_env_number(ENV_LDAP_TIMEOUT); +- if (res < 0) +- res = DEFAULT_LDAP_TIMEOUT; +- +- return res; +-} +- +-unsigned int defaults_get_ldap_network_timeout(void) +-{ +- int res; +- +- res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); +- if (res < 0) +- res = DEFAULT_LDAP_NETWORK_TIMEOUT; +- +- return res; +-} +- + struct ldap_schema *defaults_get_default_schema(void) + { + struct ldap_schema *schema; +@@ -645,6 +489,167 @@ struct ldap_schema *defaults_get_schema(void) + + return schema; + } ++#endif ++ ++/* ++ * Read config env variables and check they have been set. ++ * ++ * This simple minded routine assumes the config file ++ * is valid bourne shell script without spaces around "=" ++ * and that it has valid values. ++ */ ++unsigned int defaults_read_config(unsigned int to_syslog) ++{ ++ FILE *f; ++ char buf[MAX_LINE_LEN]; ++ char *res; ++ ++ f = open_fopen_r(DEFAULTS_CONFIG_FILE); ++ if (!f) ++ return 0; ++ ++ while ((res = fgets(buf, MAX_LINE_LEN, f))) { ++ char *key, *value; ++ ++ if (!parse_line(res, &key, &value)) ++ continue; ++ ++ if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || ++ check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || ++ check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || ++ check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || ++ check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || ++ check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || ++ check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || ++ check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || ++ check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || ++ check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) ++ ; ++ } ++ ++ if (!feof(f) || ferror(f)) { ++ if (!to_syslog) { ++ fprintf(stderr, ++ "fgets returned error %d while reading %s\n", ++ ferror(f), DEFAULTS_CONFIG_FILE); ++ } else { ++ logmsg("fgets returned error %d while reading %s", ++ ferror(f), DEFAULTS_CONFIG_FILE); ++ } ++ fclose(f); ++ return 0; ++ } ++ ++ fclose(f); ++ return 1; ++} ++ ++const char *defaults_get_master_map(void) ++{ ++ char *master; ++ ++ master = get_env_string(ENV_NAME_MASTER_MAP); ++ if (!master) ++ return strdup(default_master_map_name); ++ ++ return (const char *) master; ++} ++ ++int defaults_master_set(void) ++{ ++ char *val = getenv(ENV_NAME_MASTER_MAP); ++ if (!val) ++ return 0; ++ ++ return 1; ++} ++ ++unsigned int defaults_get_timeout(void) ++{ ++ long timeout; ++ ++ timeout = get_env_number(ENV_NAME_TIMEOUT); ++ if (timeout < 0) ++ timeout = DEFAULT_TIMEOUT; ++ ++ return (unsigned int) timeout; ++} ++ ++unsigned int defaults_get_negative_timeout(void) ++{ ++ long n_timeout; ++ ++ n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); ++ if (n_timeout <= 0) ++ n_timeout = DEFAULT_NEGATIVE_TIMEOUT; ++ ++ return (unsigned int) n_timeout; ++} ++ ++unsigned int defaults_get_browse_mode(void) ++{ ++ int res; ++ ++ res = get_env_yesno(ENV_NAME_BROWSE_MODE); ++ if (res < 0) ++ res = DEFAULT_BROWSE_MODE; ++ ++ return res; ++} ++ ++unsigned int defaults_get_logging(void) ++{ ++ char *res; ++ unsigned int logging = DEFAULT_LOGGING; ++ ++ res = get_env_string(ENV_NAME_LOGGING); ++ if (!res) ++ return logging; ++ ++ if (!strcasecmp(res, "none")) ++ logging = DEFAULT_LOGGING; ++ else { ++ if (!strcasecmp(res, "verbose")) ++ logging |= LOGOPT_VERBOSE; ++ ++ if (!strcasecmp(res, "debug")) ++ logging |= LOGOPT_DEBUG; ++ } ++ ++ free(res); ++ ++ return logging; ++} ++ ++unsigned int defaults_get_ldap_timeout(void) ++{ ++ int res; ++ ++ res = get_env_number(ENV_LDAP_TIMEOUT); ++ if (res < 0) ++ res = DEFAULT_LDAP_TIMEOUT; ++ ++ return res; ++} ++ ++unsigned int defaults_get_ldap_network_timeout(void) ++{ ++ int res; ++ ++ res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); ++ if (res < 0) ++ res = DEFAULT_LDAP_NETWORK_TIMEOUT; ++ ++ return res; ++} + + unsigned int defaults_get_mount_nfs_default_proto(void) + { +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 3bc4dc5..431e50d 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #define MODULE_LOOKUP + #include "automount.h" diff --git a/SOURCES/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch b/SOURCES/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch new file mode 100644 index 0000000..a3dd3fb --- /dev/null +++ b/SOURCES/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/SOURCES/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch b/SOURCES/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch new file mode 100644 index 0000000..abadcb5 --- /dev/null +++ b/SOURCES/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch @@ -0,0 +1,64 @@ +autofs-5.0.7 - make dump maps check for duplicate indirect mounts + +From: Ian Kent + +The dumpmaps function was intended for users to find out how the configured +mounts would be seen by automount. It does a limited amount of checking and +in particular doesn't report that duplicate indirect map sources will be +ignored at runtime. +--- + CHANGELOG | 1 + + lib/master.c | 7 +++++++ + 2 files changed, 8 insertions(+) + +diff --git a/CHANGELOG b/CHANGELOG +index 4106e7f..4576d47 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -40,6 +40,7 @@ + - fix some automount(8) typos. + - syncronize handle_mounts() shutdown. + - fix submount tree not all expiring. ++- make dump maps check for duplicate indirect mounts. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master.c b/lib/master.c +index 64dbcb1..eca3523 100644 +--- a/lib/master.c ++++ b/lib/master.c +@@ -1310,6 +1310,7 @@ int master_show_mounts(struct master *master) + struct master_mapent *this; + struct autofs_point *ap; + time_t now = time(NULL); ++ unsigned int count = 0; + int i; + + this = list_entry(p, struct master_mapent, list); +@@ -1318,6 +1319,7 @@ int master_show_mounts(struct master *master) + ap = this->ap; + + printf("\nMount point: %s\n", ap->path); ++ + printf("\nsource(s):\n"); + + /* +@@ -1360,6 +1362,9 @@ int master_show_mounts(struct master *master) + printf(" map: %s\n", source->argv[0]); + i = 1; + } ++ if (count && ap->type == LKP_INDIRECT) ++ printf(" duplicate indirect map entry" ++ " will be ignored at run time\n"); + if (source->argc > 1) { + printf(" arguments: "); + for (; i < source->argc; i++) +@@ -1379,6 +1384,8 @@ int master_show_mounts(struct master *master) + } while ((me = cache_lookup_next(source->mc, me))); + } + ++ count++; ++ + source = source->next; + } + diff --git a/SOURCES/autofs-5.0.7-make-yellow-pages-support-optional.patch b/SOURCES/autofs-5.0.7-make-yellow-pages-support-optional.patch new file mode 100644 index 0000000..4199690 --- /dev/null +++ b/SOURCES/autofs-5.0.7-make-yellow-pages-support-optional.patch @@ -0,0 +1,156 @@ +autofs-5.0.7 - make yellow pages support optional + +From: Chris Packham + +If rpcsvc/ypclnt.h is not available don't compile in Yellow Pages +support. +--- + + CHANGELOG | 1 + + Makefile.conf.in | 3 +++ + configure | 16 ++++++++++++++++ + configure.in | 9 +++++++++ + include/config.h.in | 3 +++ + lib/rpc_subs.c | 1 - + modules/Makefile | 9 +++++++-- + 7 files changed, 39 insertions(+), 3 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 1130db6..ed17163 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -25,6 +25,7 @@ + - don't schedule new alarms after readmap. + - use numeric protocol ids instead of protoent structs. + - lib/defaults.c: use WITH_LDAP conditional around LDAP types. ++- make yellow pages support optional. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/Makefile.conf.in b/Makefile.conf.in +index 802318b..3766d45 100644 +--- a/Makefile.conf.in ++++ b/Makefile.conf.in +@@ -43,6 +43,9 @@ NISPLUS = @HAVE_NISPLUS@ + # SMBFS support: yes (1) no (0) + SMBFS = @HAVE_SMBMOUNT@ + ++# YellowPages support: yes (1) no (0) ++YPCLNT = @HAVE_YPCLNT@ ++ + # Support for calling e2fsck when mounting ext2 filesystems + EXT2FS = @HAVE_E2FSCK@ + +diff --git a/configure b/configure +index 3722a46..cf6428c 100755 +--- a/configure ++++ b/configure +@@ -614,6 +614,7 @@ XML_FLAGS + LIBLDAP + HAVE_LDAP + LDAP_FLAGS ++HAVE_YPCLNT + HAVE_NISPLUS + EGREP + GREP +@@ -4575,6 +4576,21 @@ fi + + + ++# YellowPages support? ++HAVE_YPCLNT=0 ++ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/ypclnt.h" "ac_cv_header_rpcsvc_ypclnt_h" "$ac_includes_default" ++if test "x$ac_cv_header_rpcsvc_ypclnt_h" = xyes; then : ++ HAVE_YPCLNT=1 ++fi ++ ++ ++ ++if test "$HAVE_YPCLNT" = "1"; then ++ ++$as_echo "#define HAVE_YPCLNT 1" >>confdefs.h ++ ++fi ++ + # + # OpenLDAP support? Expect that this may have a special directory... + # +diff --git a/configure.in b/configure.in +index 90bda62..363c376 100644 +--- a/configure.in ++++ b/configure.in +@@ -213,6 +213,15 @@ HAVE_NISPLUS=0 + AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1) + AC_SUBST(HAVE_NISPLUS) + ++# YellowPages support? ++HAVE_YPCLNT=0 ++AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1) ++AC_SUBST(HAVE_YPCLNT) ++if test "$HAVE_YPCLNT" = "1"; then ++ AC_DEFINE(HAVE_YPCLNT, 1, ++ [Define if using YellowPages]) ++fi ++ + # + # OpenLDAP support? Expect that this may have a special directory... + # +diff --git a/include/config.h.in b/include/config.h.in +index 9bdf98a..7f1c5b5 100644 +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -72,6 +72,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_UNISTD_H + ++/* Define if using YellowPages */ ++#undef HAVE_YPCLNT ++ + /* Use libxml2 tsd usage workaround */ + #undef LIBXML2_WORKAROUND + +diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c +index ad1d557..718caf9 100644 +--- a/lib/rpc_subs.c ++++ b/lib/rpc_subs.c +@@ -27,7 +27,6 @@ + #include + #include + #include +-#include + #include + #include + #include +diff --git a/modules/Makefile b/modules/Makefile +index 939da7c..c5deb24 100644 +--- a/modules/Makefile ++++ b/modules/Makefile +@@ -5,13 +5,13 @@ + -include ../Makefile.conf + include ../Makefile.rules + +-SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \ ++SRCS := lookup_file.c lookup_program.c lookup_userhome.c \ + lookup_multi.c lookup_hosts.c lookup_dir.c \ + parse_sun.c \ + mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c \ + mount_changer.c mount_bind.c + +-MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \ ++MODS := lookup_file.so lookup_program.so lookup_userhome.so \ + lookup_multi.so lookup_hosts.so lookup_dir.so \ + parse_sun.so \ + mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \ +@@ -37,6 +37,11 @@ ifeq ($(NISPLUS), 1) + MODS += lookup_nisplus.so + endif + ++ifeq ($(YPCLNT), 1) ++ SRCS += lookup_yp.c ++ MODS += lookup_yp.so ++endif ++ + ifeq ($(LDAP), 1) + SRCS += lookup_ldap.c + MODS += lookup_ldap.so diff --git a/SOURCES/autofs-5.0.7-misc-man-page-fixes.patch b/SOURCES/autofs-5.0.7-misc-man-page-fixes.patch new file mode 100644 index 0000000..3e2e1a8 --- /dev/null +++ b/SOURCES/autofs-5.0.7-misc-man-page-fixes.patch @@ -0,0 +1,73 @@ +autofs-5.0.7 - misc man page fixes + +From: Ian Kent + +- add missing long option for for macro define in automount(8). +- fix a couple of grammar mistakes in autofs(8). +- add missing force option to help. +--- + CHANGELOG | 1 + + daemon/automount.c | 1 + + man/autofs.8.in | 4 ++-- + man/automount.8 | 2 +- + 4 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 0242c11..503a21e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -51,6 +51,7 @@ + - probe each nfs version in turn for singleton mounts. + - add changlog entry for coverity fixes. + - fix probe each nfs version in turn for singleton mounts. ++- misc man page fixes. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/automount.c b/daemon/automount.c +index 3f9337f..019637f 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -1734,6 +1734,7 @@ static void usage(void) + " set daemon log verbosity\n" + " -C --dont-check-daemon\n" + " don't check if daemon is already running\n" ++ " -F --force forceably clean up known automounts at start\n" + " -V --version print version, build config and exit\n" + , program); + } +diff --git a/man/autofs.8.in b/man/autofs.8.in +index ac0670d..fae0b00 100644 +--- a/man/autofs.8.in ++++ b/man/autofs.8.in +@@ -6,7 +6,7 @@ + .I start|stop|restart|reload|status + .SH "DESCRIPTION" + .B autofs +-control the operation of the ++controls the operation of the + .BR automount (8) + daemons running on the Linux system. Usually + .B autofs +@@ -16,7 +16,7 @@ parameter and at shutdown time with the + .I stop + parameter. The + .B autofs +-script can also manually be invoked by the system administrator to shut ++script can also be manually invoked by the system administrator to shut + down, restart or reload the automounters. + .P + .SH "OPERATION" +diff --git a/man/automount.8 b/man/automount.8 +index 7cc32c5..844b876 100644 +--- a/man/automount.8 ++++ b/man/automount.8 +@@ -45,7 +45,7 @@ autofs managed mounts. + Enables logging of general status and progress messages as well as + debugging messages for all autofs managed mounts. + .TP +-.I "\-Dvariable=value" ++.I "\-Dvariable=value, --define variable=value" + Define a global macro substitution variable. Global definitions + are over-ridden macro definitions of the same name specified in + mount entries. diff --git a/SOURCES/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch b/SOURCES/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch new file mode 100644 index 0000000..4516bc5 --- /dev/null +++ b/SOURCES/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch @@ -0,0 +1,39 @@ +autofs-5.0.7 - modules/replicated.c: use sin6_addr.s6_addr32 + +From: Chris Packham + +The exported in6.h kernel header provides a convenience macro s6_addr32 +for accessing the 32bit words of an ipv6 address. Use this instead of +__in6_u.__u6_addr32. +--- + + CHANGELOG | 1 + + modules/replicated.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index ed17163..4eaa9f9 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -26,6 +26,7 @@ + - use numeric protocol ids instead of protoent structs. + - lib/defaults.c: use WITH_LDAP conditional around LDAP types. + - make yellow pages support optional. ++- modules/replicated.c: use sin6_addr.s6_addr32. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/replicated.c b/modules/replicated.c +index dbd5513..26f64b8 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -1146,7 +1146,7 @@ try_name: + rr4++; + } else if (this->ai_family == AF_INET6) { + struct sockaddr_in6 *addr = (struct sockaddr_in6 *) this->ai_addr; +- if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.__in6_u.__u6_addr32)) ++ if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.s6_addr32)) + rr6++; + } + this = this->ai_next; diff --git a/SOURCES/autofs-5.0.7-only-probe-specific-nfs-version-when-requested.patch b/SOURCES/autofs-5.0.7-only-probe-specific-nfs-version-when-requested.patch new file mode 100644 index 0000000..e70830a --- /dev/null +++ b/SOURCES/autofs-5.0.7-only-probe-specific-nfs-version-when-requested.patch @@ -0,0 +1,40 @@ +autofs-5.0.7 - only probe specific nfs version when requested + +From: Ian Kent + +If a specific NFS version is given as an option the set the probe flags +to probe only that version. +--- + CHANGELOG | 1 + + modules/mount_nfs.c | 10 +++++++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -63,6 +63,7 @@ + - teach dumpmaps to output simple key value pairs. + - fix get_nfs_info() probe. + - fix portmap lookup. ++- only probe specific nfs version if requested. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/modules/mount_nfs.c ++++ autofs-5.0.7/modules/mount_nfs.c +@@ -146,7 +146,15 @@ int mount_mount(struct autofs_point *ap, + if (strncmp("vers=4", cp, o_len) == 0 || + strncmp("nfsvers=4", cp, o_len) == 0) + vers = NFS4_VERS_MASK | TCP_SUPPORTED; +- else if (strstr(cp, "port=") == cp && ++ else if (strncmp("vers=3", cp, o_len) == 0 || ++ strncmp("nfsvers=3", cp, o_len) == 0) { ++ vers &= ~(NFS4_VERS_MASK | NFS_VERS_MASK); ++ vers |= NFS3_REQUESTED; ++ } else if (strncmp("vers=2", cp, o_len) == 0 || ++ strncmp("nfsvers=2", cp, o_len) == 0) { ++ vers &= ~(NFS4_VERS_MASK | NFS_VERS_MASK); ++ vers |= NFS2_REQUESTED; ++ } else if (strstr(cp, "port=") == cp && + o_len - 5 < 25) { + char optport[25]; + diff --git a/SOURCES/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch b/SOURCES/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch new file mode 100644 index 0000000..9b86306 --- /dev/null +++ b/SOURCES/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch @@ -0,0 +1,104 @@ +autofs-5.0.7 - probe each nfs version in turn for singleton mounts + +From: Ian Kent + + +--- + CHANGELOG | 1 + + include/replicated.h | 2 ++ + modules/mount_nfs.c | 35 ++++++++++++++++++++++++++++++++++- + modules/replicated.c | 8 ++++---- + 4 files changed, 41 insertions(+), 5 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 39d7889..48e9806 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -48,6 +48,7 @@ + - fix master map mount options matching. + - fix master map bogus keywork match. + - fix fix map entry duplicate offset detection. ++- probe each nfs version in turn for singleton mounts. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/include/replicated.h b/include/replicated.h +index ff0e7b9..728f131 100644 +--- a/include/replicated.h ++++ b/include/replicated.h +@@ -68,6 +68,8 @@ struct host { + }; + + void seed_random(void); ++struct host *new_host(const char *, struct sockaddr *, size_t, ++ unsigned int, unsigned int, unsigned int); + void free_host_list(struct host **); + int parse_location(unsigned, struct host **, const char *, unsigned int); + int prune_host_list(unsigned, struct host **, unsigned int, int); +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 5424d74..81ba3ca 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -180,9 +180,42 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + * We can't probe protocol rdma so leave it to mount.nfs(8) + * and and suffer the delay if a server isn't available. + */ +- if (!rdma) ++ if (rdma) ++ goto dont_probe; ++ ++ /* ++ * If this is a singleton mount, and NFSv4 only hasn't been asked ++ * for, and the default NFS protocol is set to v4 in the autofs ++ * configuration only probe NFSv4 and let mount.nfs(8) do fallback ++ * to NFSv3 (if it can). If the NFSv4 probe fails then probe as ++ * normal. ++ */ ++ if (!hosts->next && ++ mount_default_proto == 4 && ++ vers & NFS_VERS_MASK != 0 && ++ vers & NFS4_VERS_MASK != 0) { ++ unsigned int v4_probe_ok = 0; ++ struct host *tmp = new_host(hosts->name, ++ hosts->addr, hosts->addr_len, ++ hosts->proximity, ++ hosts->weight, hosts->options); ++ if (tmp) { ++ tmp->rr = hosts->rr; ++ prune_host_list(ap->logopt, &tmp, ++ NFS4_VERS_MASK|TCP_SUPPORTED, port); ++ /* If probe succeeds just try the mount with host in hosts */ ++ if (tmp) { ++ v4_probe_ok = 1; ++ free_host_list(&tmp); ++ } ++ } ++ if (!v4_probe_ok) ++ prune_host_list(ap->logopt, &hosts, vers, port); ++ } else { + prune_host_list(ap->logopt, &hosts, vers, port); ++ } + ++dont_probe: + if (!hosts) { + info(ap->logopt, MODPREFIX "no hosts available"); + return 1; +diff --git a/modules/replicated.c b/modules/replicated.c +index 6dbdade..0a044b9 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -280,10 +280,10 @@ static unsigned int get_proximity(struct sockaddr *host_addr) + return PROXIMITY_OTHER; + } + +-static struct host *new_host(const char *name, +- struct sockaddr *addr, size_t addr_len, +- unsigned int proximity, unsigned int weight, +- unsigned int options) ++struct host *new_host(const char *name, ++ struct sockaddr *addr, size_t addr_len, ++ unsigned int proximity, unsigned int weight, ++ unsigned int options) + { + struct host *new; + struct sockaddr *tmp2; diff --git a/SOURCES/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch b/SOURCES/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch new file mode 100644 index 0000000..c0ab30a --- /dev/null +++ b/SOURCES/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch @@ -0,0 +1,30 @@ +autofs-5.0.7 - recheck valid map entry lookup return in do_readmap_mount() + +From: Ian Kent + +After looking for an expected existing valid map entry in do_readmap_mount() +add a check in case it isn't found. + +If it actually isn't found (although it always should be) the only thing +that can be done is log an error return. +--- + daemon/state.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/daemon/state.c b/daemon/state.c +index 6e23022..ddc5556 100644 +--- a/daemon/state.c ++++ b/daemon/state.c +@@ -405,6 +405,12 @@ static void do_readmap_mount(struct autofs_point *ap, struct mnt_list *mnts, + me->key); + cache_writelock(vmc); + valid = cache_lookup_distinct(vmc, me->key); ++ if (!valid) { ++ cache_unlock(vmc); ++ error(ap->logopt, ++ "failed to find expected existing valid map entry"); ++ return; ++ } + /* Take over the mount if there is one */ + valid->ioctlfd = me->ioctlfd; + me->ioctlfd = -1; diff --git a/SOURCES/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch b/SOURCES/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch new file mode 100644 index 0000000..111e460 --- /dev/null +++ b/SOURCES/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch @@ -0,0 +1,36 @@ +autofs-5.0.7 - remove debug only code in alarm.c + +From: Ian Kent + +This code is only ever used for "on-the-fly" debugging so just remove it. +--- + lib/alarm.c | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/lib/alarm.c b/lib/alarm.c +index d5cdc05..0f04ef8 100755 +--- a/lib/alarm.c ++++ b/lib/alarm.c +@@ -40,22 +40,6 @@ do { \ + fatal(_alm_unlock); \ + } while (0) + +-void dump_alarms(void) +-{ +- struct list_head *head; +- struct list_head *p; +- +- pthread_mutex_lock(&mutex); +- head = &alarms; +- list_for_each(p, head) { +- struct alarm *this; +- +- this = list_entry(p, struct alarm, list); +- logmsg("alarm time = %d", this->time); +- } +- pthread_mutex_unlock(&mutex); +-} +- + /* Insert alarm entry on ordered list. */ + int alarm_add(struct autofs_point *ap, time_t seconds) + { diff --git a/SOURCES/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch b/SOURCES/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch new file mode 100644 index 0000000..25b40aa --- /dev/null +++ b/SOURCES/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch @@ -0,0 +1,73 @@ +autofs-5.0.7 - syncronize handle_mounts() shutdown + +From: Ian Kent + +When re-reading the master map the signal handler thread receives +a SIGTERM signal from handle_mounts_cleanup() for map entries that +have been removed. This is done to allow joining with handle_mounts() +threads before shutting down to ensure clean up has been completed +before the thread terminates. + +But, if more than one map entry is removed, multiple threads may be +cleaned up during the handling of a single signal so there can be no +work to do when a subsequent signal is received. In this case the +signal handler thread interprets the additional SIGTERM signal as a +request to shutdown and exits. +--- + CHANGELOG | 1 + + daemon/automount.c | 9 +++++++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 488ad1e..f1ec1e5 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -38,6 +38,7 @@ + - fix systemd unidir in spec file. + - document browse option in man page. + - fix some automount(8) typos. ++- syncronize handle_mounts() shutdown. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/automount.c b/daemon/automount.c +index 4c651cf..3f9337f 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -1285,7 +1285,8 @@ static int do_hup_signal(struct master *master, time_t age) + nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check); + + master_mutex_lock(); +- if (master->reading) { ++ /* Already doing a map read or shutdown or no mounts */ ++ if (master->reading || list_empty(&master->mounts)) { + status = pthread_mutex_unlock(&mrc.mutex); + if (status) + fatal(status); +@@ -1449,6 +1450,7 @@ static void handle_mounts_cleanup(void *arg) + char path[PATH_MAX + 1]; + char buf[MAX_ERR_BUF]; + unsigned int clean = 0, submount, logopt; ++ unsigned int pending = 0; + + ap = (struct autofs_point *) arg; + +@@ -1466,6 +1468,9 @@ static void handle_mounts_cleanup(void *arg) + list_del_init(&ap->mounts); + } + ++ /* Don't signal the handler if we have already done so */ ++ if (!list_empty(&master_list->completed)) ++ pending = 1; + master_remove_mapent(ap->entry); + master_source_unlock(ap->entry); + +@@ -1498,7 +1503,7 @@ static void handle_mounts_cleanup(void *arg) + * so it can join with any completed handle_mounts() threads and + * perform final cleanup. + */ +- if (!submount) ++ if (!submount && !pending) + pthread_kill(state_mach_thid, SIGTERM); + + master_mutex_unlock(); diff --git a/SOURCES/autofs-5.0.7-teach-dumpmaps-to-output-simple-key-value-pairs.patch b/SOURCES/autofs-5.0.7-teach-dumpmaps-to-output-simple-key-value-pairs.patch new file mode 100644 index 0000000..1693a70 --- /dev/null +++ b/SOURCES/autofs-5.0.7-teach-dumpmaps-to-output-simple-key-value-pairs.patch @@ -0,0 +1,366 @@ +autofs-5.0.7 - teach dumpmaps to output simple key value pairs + +From: Ian Kent + +The dumpmaps option doesn't allow maps to be output in +pairs suitable for use as a file map. + +This could be useful to save current maps as a backup for emergency +use. + +If the dumpmaps option is given and is followed by two parameters, +" " then simple pairs that would +be read in by a map read are printed to stdout if the given map type +and map name are found in the map configuration. + +If the map is an LDAP map and there is more than one map of same name +in different base dns only the first map encountered by autofs will +be listed. + +If the map type is an old style multi-map and any one of the map +names in the multi-map entry matches the given map name the entries +that would be used by autofs for the whole multi-map will be listed. +--- + CHANGELOG | 1 + daemon/automount.c | 56 ++++++++++++--- + include/master.h | 1 + lib/master.c | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + man/automount.8 | 20 +++++ + 5 files changed, 250 insertions(+), 15 deletions(-) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -60,6 +60,7 @@ + - fix fix wildcard multi map regression. + - fix dumpmaps multi output. + - try and cleanup after dumpmaps. ++- teach dumpmaps to output simple key value pairs. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/daemon/automount.c ++++ autofs-5.0.7/daemon/automount.c +@@ -1725,7 +1725,8 @@ static void usage(void) + " -f --foreground do not fork into background\n" + " -r --random-multimount-selection\n" + " use ramdom replicated server selection\n" +- " -m --dumpmaps dump automounter maps and exit\n" ++ " -m --dumpmaps [ ]\n" ++ " dump automounter maps and exit\n" + " -n --negative-timeout n\n" + " set the timeout for failed key lookups.\n" + " -O --global-options\n" +@@ -2125,22 +2126,33 @@ int main(int argc, char *argv[]) + program); + #endif + +- if (argc == 0) +- master_list = master_new(NULL, timeout, ghost); +- else +- master_list = master_new(argv[0], timeout, ghost); +- +- if (!master_list) { +- printf("%s: can't create master map %s", program, argv[0]); +- exit(1); +- } +- + if (dumpmaps) { + struct master_mapent *entry; + struct list_head *head, *p; + struct mapent_cache *nc; ++ const char *type = NULL; ++ const char *name = NULL; ++ const char *master = NULL; ++ ++ if (argc > 0) { ++ if (argc >= 2) { ++ type = argv[0]; ++ name = argv[1]; ++ } ++ if (argc == 3) ++ master = argv[2]; ++ } + +- open_log(); ++ if (master) ++ master_list = master_new(NULL, timeout, ghost); ++ else ++ master_list = master_new(master, timeout, ghost); ++ if (!master_list) { ++ printf("%s: can't create master map", program); ++ exit(1); ++ } ++ ++ log_to_stderr(); + + master_init_scan(); + +@@ -2153,7 +2165,15 @@ int main(int argc, char *argv[]) + master_list->nc = nc; + + lookup_nss_read_master(master_list, 0); +- master_show_mounts(master_list); ++ if (type) { ++ const char *map = basename(name); ++ if (!map) ++ printf("%s: invalid map name %s\n", ++ program, name); ++ else ++ dump_map(master_list, type, map); ++ } else ++ master_show_mounts(master_list); + + head = &master_list->mounts; + p = head->next; +@@ -2168,6 +2188,16 @@ int main(int argc, char *argv[]) + exit(0); + } + ++ if (argc == 0) ++ master_list = master_new(NULL, timeout, ghost); ++ else ++ master_list = master_new(argv[0], timeout, ghost); ++ ++ if (!master_list) { ++ printf("%s: can't create master map %s", program, argv[0]); ++ exit(1); ++ } ++ + become_daemon(foreground, daemon_check); + + if (pthread_attr_init(&th_attr)) { +--- autofs-5.0.7.orig/include/master.h ++++ autofs-5.0.7/include/master.h +@@ -112,6 +112,7 @@ int master_submount_list_empty(struct au + int master_notify_submount(struct autofs_point *, const char *path, enum states); + void master_notify_state_change(struct master *, int); + int master_mount_mounts(struct master *, time_t, int); ++int dump_map(struct master *, const char *, const char *); + int master_show_mounts(struct master *); + extern inline unsigned int master_get_logopt(void); + int master_list_empty(struct master *); +--- autofs-5.0.7.orig/lib/master.c ++++ autofs-5.0.7/lib/master.c +@@ -1329,6 +1329,193 @@ static void print_map_info(struct map_so + return; + } + ++static int match_type(const char *source, const char *type) ++{ ++ if (!strcmp(source, type)) ++ return 1; ++ /* Sources file and files are synonymous */ ++ if (!strncmp(source, type, 4) && (strlen(source) <= 5)) ++ return 1; ++ return 0; ++} ++ ++static char *get_map_name(const char *string) ++{ ++ char *name, *tmp; ++ char *start, *end, *base; ++ ++ tmp = strdup(string); ++ if (!tmp) { ++ printf("error: allocation failure: %s\n", strerror(errno)); ++ return NULL; ++ } ++ ++ base = basename(tmp); ++ end = strchr(base, ','); ++ if (end) ++ *end = '\0'; ++ start = strchr(tmp, '='); ++ if (start) ++ start++; ++ else { ++ char *colon = strrchr(base, ':'); ++ if (colon) ++ start = ++colon; ++ else ++ start = base; ++ } ++ ++ name = strdup(start); ++ if (!name) ++ printf("error: allocation failure: %s\n", strerror(errno)); ++ free(tmp); ++ ++ return name; ++} ++ ++static int match_name(struct map_source *source, const char *name) ++{ ++ int argc = source->argc; ++ int ret = 0; ++ int i; ++ ++ /* ++ * This can't work for old style "multi" type sources since ++ * there's no way to know from which map the cache entry came ++ * from and duplicate entries are ignored at map read time. ++ * All we can really do is list all the entries for the given ++ * multi map if one of its map names matches. ++ */ ++ for (i = 0; i < argc; i++) { ++ if (i == 0 || !strcmp(source->argv[i], "--")) { ++ if (i != 0) { ++ i++; ++ if (i >= argc) ++ break; ++ } ++ ++ if (source->argv[i] && *source->argv[i] != '-') { ++ char *map = get_map_name(source->argv[i]); ++ if (!map) ++ break; ++ if (!strcmp(map, name)) { ++ ret = 1; ++ free(map); ++ break; ++ } ++ free(map); ++ } ++ } ++ } ++ ++ return ret; ++} ++ ++int dump_map(struct master *master, const char *type, const char *name) ++{ ++ struct list_head *p, *head; ++ ++ if (list_empty(&master->mounts)) { ++ printf("no master map entries found\n"); ++ return 1; ++ } ++ ++ head = &master->mounts; ++ p = head->next; ++ while (p != head) { ++ struct map_source *source; ++ struct master_mapent *this; ++ struct autofs_point *ap; ++ time_t now = time(NULL); ++ ++ this = list_entry(p, struct master_mapent, list); ++ p = p->next; ++ ++ ap = this->ap; ++ ++ /* ++ * Ensure we actually read indirect map entries so we can ++ * list them. The map reads won't read any indirect map ++ * entries (other than those in a file map) unless the ++ * browse option is set. ++ */ ++ if (ap->type == LKP_INDIRECT) ++ ap->flags |= MOUNT_FLAG_GHOST; ++ ++ /* Read the map content into the cache */ ++ if (lookup_nss_read_map(ap, NULL, now)) ++ lookup_prune_cache(ap, now); ++ else { ++ printf("failed to read map\n"); ++ lookup_close_lookup(ap); ++ continue; ++ } ++ ++ if (!this->maps) { ++ printf("no map sources found for %s\n", ap->path); ++ lookup_close_lookup(ap); ++ continue; ++ } ++ ++ source = this->maps; ++ while (source) { ++ struct map_source *instance; ++ struct mapent *me; ++ ++ instance = NULL; ++ if (source->type) { ++ if (!match_type(source->type, type)) { ++ source = source->next; ++ continue; ++ } ++ if (!match_name(source, name)) { ++ source = source->next; ++ continue; ++ } ++ instance = source; ++ } else { ++ struct map_source *map; ++ ++ map = source->instance; ++ while (map) { ++ if (!match_type(map->type, type)) { ++ map = map->next; ++ continue; ++ } ++ if (!match_name(map, name)) { ++ map = map->next; ++ continue; ++ } ++ instance = map; ++ break; ++ } ++ } ++ ++ if (!instance) { ++ source = source->next; ++ lookup_close_lookup(ap); ++ continue; ++ } ++ ++ me = cache_lookup_first(source->mc); ++ if (!me) ++ printf("no keys found in map\n"); ++ else { ++ do { ++ if (me->source == instance) ++ printf("%s\t%s\n", me->key, me->mapent); ++ } while ((me = cache_lookup_next(source->mc, me))); ++ } ++ ++ lookup_close_lookup(ap); ++ return 1; ++ } ++ lookup_close_lookup(ap); ++ } ++ ++ return 0; ++} ++ + int master_show_mounts(struct master *master) + { + struct list_head *p, *head; +--- autofs-5.0.7.orig/man/automount.8 ++++ autofs-5.0.7/man/automount.8 +@@ -57,8 +57,24 @@ Run the daemon in the foreground and log + Enables the use of ramdom selection when choosing a host from a + list of replicated servers. + .TP +-.I "\-m, \-\-dumpmaps" +-Dump configured automounter maps, then exit. ++.I "\-m, \-\-dumpmaps [ ]" ++With no parameters, list information about the configured automounter ++maps, then exit. ++ ++If the dumpmaps option is given and is followed by two parameters, ++" " then simple "" pairs that would ++be read in by a map read are printed to stdout if the given map type ++and map name are found in the map configuration. ++ ++If the map is an LDAP map and there is more than one map of same name ++in different base dns only the first map encountered by autofs will ++be listed. Similarly, if the map is a file map and there is more than ++one map of the same name in different directories, only the first map ++encountered will be listed. ++ ++If the map type is an old style multi-map and any one of the map ++names in the multi-map entry matches the given map name the entries ++that would be used by autofs for the whole multi-map will be listed. + .TP + .I "\-O, \-\-global-options" + Allows the specification of global mount options used for all master diff --git a/SOURCES/autofs-5.0.7-try-and-cleanup-after-dumpmaps.patch b/SOURCES/autofs-5.0.7-try-and-cleanup-after-dumpmaps.patch new file mode 100644 index 0000000..d626d21 --- /dev/null +++ b/SOURCES/autofs-5.0.7-try-and-cleanup-after-dumpmaps.patch @@ -0,0 +1,63 @@ +autofs-5.0.7 - try and cleanup after dumpmaps + +From: Ian Kent + +Try and cleanup a little after dumping maps. +It's not really necessary but but can help by reducing the noise +from valgrind when checking code. +--- + CHANGELOG | 1 + + daemon/automount.c | 13 +++++++++++++ + lib/master.c | 2 ++ + 3 files changed, 16 insertions(+) + +--- autofs-5.0.7.orig/CHANGELOG ++++ autofs-5.0.7/CHANGELOG +@@ -59,6 +59,7 @@ + - fix syncronize handle_mounts() shutdown. + - fix fix wildcard multi map regression. + - fix dumpmaps multi output. ++- try and cleanup after dumpmaps. + + 25/07/2012 autofs-5.0.7 + ======================= +--- autofs-5.0.7.orig/daemon/automount.c ++++ autofs-5.0.7/daemon/automount.c +@@ -2136,6 +2136,8 @@ int main(int argc, char *argv[]) + } + + if (dumpmaps) { ++ struct master_mapent *entry; ++ struct list_head *head, *p; + struct mapent_cache *nc; + + open_log(); +@@ -2152,6 +2154,17 @@ int main(int argc, char *argv[]) + + lookup_nss_read_master(master_list, 0); + master_show_mounts(master_list); ++ ++ head = &master_list->mounts; ++ p = head->next; ++ while (p != head) { ++ entry = list_entry(p, struct master_mapent, list); ++ p = p->next; ++ master_free_mapent_sources(entry, 1); ++ master_free_mapent(entry); ++ } ++ master_kill(master_list); ++ + exit(0); + } + +--- autofs-5.0.7.orig/lib/master.c ++++ autofs-5.0.7/lib/master.c +@@ -1426,6 +1426,8 @@ int master_show_mounts(struct master *ma + source = source->next; + } + ++ lookup_close_lookup(ap); ++ + printf("\n"); + } + diff --git a/SOURCES/autofs-5.0.7-update-kernel-include-files.patch b/SOURCES/autofs-5.0.7-update-kernel-include-files.patch new file mode 100644 index 0000000..3b6bb92 --- /dev/null +++ b/SOURCES/autofs-5.0.7-update-kernel-include-files.patch @@ -0,0 +1,92 @@ +autofs-5.0.7 - update kernel include files + +From: Ian Kent + +Update autofs include files to include the latest changes. +--- + include/linux/auto_fs.h | 33 ++++++++++----------------------- + include/linux/auto_fs4.h | 3 ++- + 2 files changed, 12 insertions(+), 24 deletions(-) + +diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h +index 91d414f..64df1a6 100644 +--- a/include/linux/auto_fs.h ++++ b/include/linux/auto_fs.h +@@ -14,13 +14,8 @@ + #ifndef _LINUX_AUTO_FS_H + #define _LINUX_AUTO_FS_H + +-#ifdef __KERNEL__ +-#include +-#include + #include +-#include +-#else +-#include ++#ifndef __KERNEL__ + #include + #endif /* __KERNEL__ */ + +@@ -32,25 +27,16 @@ + #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION + + /* +- * Architectures where both 32- and 64-bit binaries can be executed +- * on 64-bit kernels need this. This keeps the structure format +- * uniform, and makes sure the wait_queue_token isn't too big to be +- * passed back down to the kernel. +- * +- * This assumes that on these architectures: +- * mode 32 bit 64 bit +- * ------------------------- +- * int 32 bit 32 bit +- * long 32 bit 64 bit +- * +- * If so, 32-bit user-space code should be backwards compatible. ++ * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed ++ * back to the kernel via ioctl from userspace. On architectures where 32- and ++ * 64-bit userspace binaries can be executed it's important that the size of ++ * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we ++ * do not break the binary ABI interface by changing the structure size. + */ +- +-#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ +- || defined(__powerpc__) || defined(__s390__) +-typedef unsigned int autofs_wqt_t; +-#else ++#if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */ + typedef unsigned long autofs_wqt_t; ++#else ++typedef unsigned int autofs_wqt_t; + #endif + + /* Packet types */ +@@ -81,6 +67,7 @@ struct autofs_packet_expire { + #define AUTOFS_IOC_FAIL _IO(0x93,0x61) + #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) + #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) ++#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) + #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) + #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) + +diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h +index 55fa478..e02982f 100644 +--- a/include/linux/auto_fs4.h ++++ b/include/linux/auto_fs4.h +@@ -12,6 +12,7 @@ + #define _LINUX_AUTO_FS4_H + + /* Include common v3 definitions */ ++#include + #include + + /* autofs v4 definitions */ +@@ -23,7 +24,7 @@ + #define AUTOFS_MIN_PROTO_VERSION 3 + #define AUTOFS_MAX_PROTO_VERSION 5 + +-#define AUTOFS_PROTO_SUBVERSION 1 ++#define AUTOFS_PROTO_SUBVERSION 2 + + /* Mask for expire behaviour */ + #define AUTOFS_EXP_IMMEDIATE 1 diff --git a/SOURCES/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch b/SOURCES/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch new file mode 100644 index 0000000..113b0a0 --- /dev/null +++ b/SOURCES/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch @@ -0,0 +1,471 @@ +autofs-5.0.7 - use numeric protocol ids instead of protoent structs + +From: Leonardo Chiquitto + +The function getprotobyname() is not reentrant, so we can't call +it simultaneously from multiple threads. Instead of switching to +the reentrant version which adds more complexity to the code, +lets use numeric protocol IDs instead of protoent structures. +--- + + CHANGELOG | 1 + + include/rpc_subs.h | 4 +-- + lib/rpc_subs.c | 80 ++++++++++++++++++-------------------------------- + modules/replicated.c | 42 +++++++++++--------------- + 4 files changed, 50 insertions(+), 77 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 4cf5621..ba1d65b 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -23,6 +23,7 @@ + - fix use get_proximity() without libtirpc. + - don't use dirent d_type to filter out files in scandir() + - don't schedule new alarms after readmap. ++- use numeric protocol ids instead of protoent structs. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/include/rpc_subs.h b/include/rpc_subs.h +index ca474d9..b6d59f9 100644 +--- a/include/rpc_subs.h ++++ b/include/rpc_subs.h +@@ -54,7 +54,7 @@ struct conn_info { + unsigned short port; + unsigned long program; + unsigned long version; +- struct protoent *proto; ++ int proto; + unsigned int send_sz; + unsigned int recv_sz; + struct timeval timeout; +@@ -66,7 +66,7 @@ int rpc_udp_getclient(struct conn_info *, unsigned int, unsigned int); + void rpc_destroy_udp_client(struct conn_info *); + int rpc_tcp_getclient(struct conn_info *, unsigned int, unsigned int); + void rpc_destroy_tcp_client(struct conn_info *); +-int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, const char *, unsigned int); ++int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, int, unsigned int); + int rpc_portmap_getport(struct conn_info *, struct pmap *, unsigned short *); + int rpc_ping_proto(struct conn_info *); + int rpc_ping(const char *, long, long, unsigned int); +diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c +index d33a3c4..ad1d557 100644 +--- a/lib/rpc_subs.c ++++ b/lib/rpc_subs.c +@@ -170,7 +170,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i + + *client = NULL; + +- proto = info->proto->p_proto; ++ proto = info->proto; + if (proto == IPPROTO_UDP) + type = SOCK_DGRAM; + else +@@ -201,7 +201,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i + in4_raddr = (struct sockaddr_in *) addr; + in4_raddr->sin_port = htons(info->port); + +- switch (info->proto->p_proto) { ++ switch (info->proto) { + case IPPROTO_UDP: + clnt = clntudp_bufcreate(in4_raddr, + info->program, info->version, +@@ -241,7 +241,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i + + *client = NULL; + +- proto = info->proto->p_proto; ++ proto = info->proto; + if (proto == IPPROTO_UDP) + type = SOCK_DGRAM; + else +@@ -292,11 +292,11 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i + nb_addr.maxlen = nb_addr.len = slen; + nb_addr.buf = addr; + +- if (info->proto->p_proto == IPPROTO_UDP) ++ if (info->proto == IPPROTO_UDP) + clnt = clnt_dg_create(*fd, &nb_addr, + info->program, info->version, + info->send_sz, info->recv_sz); +- else if (info->proto->p_proto == IPPROTO_TCP) { ++ else if (info->proto == IPPROTO_TCP) { + ret = connect_nb(*fd, addr, slen, &info->timeout); + if (ret < 0) + return ret; +@@ -355,7 +355,7 @@ static int create_client(struct conn_info *info, CLIENT **client) + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_ADDRCONFIG; + hints.ai_family = AF_UNSPEC; +- if (info->proto->p_proto == IPPROTO_UDP) ++ if (info->proto == IPPROTO_UDP) + hints.ai_socktype = SOCK_DGRAM; + else + hints.ai_socktype = SOCK_STREAM; +@@ -370,7 +370,7 @@ static int create_client(struct conn_info *info, CLIENT **client) + + haddr = ai; + while (haddr) { +- if (haddr->ai_protocol != info->proto->p_proto) { ++ if (haddr->ai_protocol != info->proto) { + haddr = haddr->ai_next; + continue; + } +@@ -417,16 +417,11 @@ out_close: + int rpc_udp_getclient(struct conn_info *info, + unsigned int program, unsigned int version) + { +- struct protoent *pe_proto; + CLIENT *client; + int ret; + + if (!info->client) { +- pe_proto = getprotobyname("udp"); +- if (!pe_proto) +- return -ENOENT; +- +- info->proto = pe_proto; ++ info->proto = IPPROTO_UDP; + info->timeout.tv_sec = RPC_TOUT_UDP; + info->timeout.tv_usec = 0; + info->send_sz = UDPMSGSIZE; +@@ -458,16 +453,11 @@ void rpc_destroy_udp_client(struct conn_info *info) + int rpc_tcp_getclient(struct conn_info *info, + unsigned int program, unsigned int version) + { +- struct protoent *pe_proto; + CLIENT *client; + int ret; + + if (!info->client) { +- pe_proto = getprotobyname("tcp"); +- if (!pe_proto) +- return -ENOENT; +- +- info->proto = pe_proto; ++ info->proto = IPPROTO_TCP; + info->timeout.tv_sec = RPC_TOUT_TCP; + info->timeout.tv_usec = 0; + info->send_sz = 0; +@@ -513,23 +503,18 @@ void rpc_destroy_tcp_client(struct conn_info *info) + + int rpc_portmap_getclient(struct conn_info *info, + const char *host, struct sockaddr *addr, size_t addr_len, +- const char *proto, unsigned int option) ++ int proto, unsigned int option) + { +- struct protoent *pe_proto; + CLIENT *client; + int ret; + +- pe_proto = getprotobyname(proto); +- if (!pe_proto) +- return -ENOENT; +- + info->host = host; + info->addr = addr; + info->addr_len = addr_len; + info->program = PMAPPROG; + info->port = PMAPPORT; + info->version = PMAPVERS; +- info->proto = pe_proto; ++ info->proto = proto; + info->send_sz = RPCSMALLMSGSIZE; + info->recv_sz = RPCSMALLMSGSIZE; + info->timeout.tv_sec = PMAP_TOUT_UDP; +@@ -537,7 +522,7 @@ int rpc_portmap_getclient(struct conn_info *info, + info->close_option = option; + info->client = NULL; + +- if (pe_proto->p_proto == IPPROTO_TCP) ++ if (info->proto == IPPROTO_TCP) + info->timeout.tv_sec = PMAP_TOUT_TCP; + + ret = create_client(info, &client); +@@ -555,7 +540,7 @@ int rpc_portmap_getport(struct conn_info *info, + struct conn_info pmap_info; + CLIENT *client; + enum clnt_stat status; +- int proto = info->proto->p_proto; ++ int proto = info->proto; + int ret; + + memset(&pmap_info, 0, sizeof(struct conn_info)); +@@ -633,13 +618,13 @@ int rpc_ping_proto(struct conn_info *info) + { + CLIENT *client; + enum clnt_stat status; +- int proto = info->proto->p_proto; ++ int proto = info->proto; + int ret; + + if (info->client) + client = info->client; + else { +- if (info->proto->p_proto == IPPROTO_UDP) { ++ if (info->proto == IPPROTO_UDP) { + info->send_sz = UDPMSGSIZE; + info->recv_sz = UDPMSGSIZE; + } +@@ -688,7 +673,7 @@ int rpc_ping_proto(struct conn_info *info) + + static unsigned int __rpc_ping(const char *host, + unsigned long version, +- char *proto, ++ int proto, + long seconds, long micros, + unsigned int option) + { +@@ -696,6 +681,7 @@ static unsigned int __rpc_ping(const char *host, + struct conn_info info; + struct pmap parms; + ++ info.proto = proto; + info.host = host; + info.addr = NULL; + info.addr_len = 0; +@@ -710,13 +696,9 @@ static unsigned int __rpc_ping(const char *host, + + status = RPC_PING_FAIL; + +- info.proto = getprotobyname(proto); +- if (!info.proto) +- return status; +- + parms.pm_prog = NFS_PROGRAM; + parms.pm_vers = version; +- parms.pm_prot = info.proto->p_proto; ++ parms.pm_prot = info.proto; + parms.pm_port = 0; + + status = rpc_portmap_getport(&info, &parms, &info.port); +@@ -734,19 +716,19 @@ int rpc_ping(const char *host, long seconds, long micros, unsigned int option) + unsigned long vers2 = NFS2_VERSION; + unsigned int status; + +- status = __rpc_ping(host, vers2, "udp", seconds, micros, option); ++ status = __rpc_ping(host, vers2, IPPROTO_UDP, seconds, micros, option); + if (status > 0) + return RPC_PING_V2 | RPC_PING_UDP; + +- status = __rpc_ping(host, vers3, "udp", seconds, micros, option); ++ status = __rpc_ping(host, vers3, IPPROTO_UDP, seconds, micros, option); + if (status > 0) + return RPC_PING_V3 | RPC_PING_UDP; + +- status = __rpc_ping(host, vers2, "tcp", seconds, micros, option); ++ status = __rpc_ping(host, vers2, IPPROTO_TCP, seconds, micros, option); + if (status > 0) + return RPC_PING_V2 | RPC_PING_TCP; + +- status = __rpc_ping(host, vers3, "tcp", seconds, micros, option); ++ status = __rpc_ping(host, vers3, IPPROTO_TCP, seconds, micros, option); + if (status > 0) + return RPC_PING_V3 | RPC_PING_TCP; + +@@ -769,7 +751,7 @@ int rpc_time(const char *host, + double taken; + struct timeval start, end; + struct timezone tz; +- char *proto = (ping_proto & RPC_PING_UDP) ? "udp" : "tcp"; ++ int proto = (ping_proto & RPC_PING_UDP) ? IPPROTO_UDP : IPPROTO_TCP; + unsigned long vers = ping_vers; + + gettimeofday(&start, &tz); +@@ -791,12 +773,12 @@ static int rpc_get_exports_proto(struct conn_info *info, exports *exp) + { + CLIENT *client; + enum clnt_stat status; +- int proto = info->proto->p_proto; ++ int proto = info->proto; + unsigned int option = info->close_option; + int vers_entry; + int ret; + +- if (info->proto->p_proto == IPPROTO_UDP) { ++ if (info->proto == IPPROTO_UDP) { + info->send_sz = UDPMSGSIZE; + info->recv_sz = UDPMSGSIZE; + } +@@ -903,11 +885,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in + parms.pm_port = 0; + + /* Try UDP first */ +- info.proto = getprotobyname("udp"); +- if (!info.proto) +- goto try_tcp; ++ info.proto = IPPROTO_UDP; + +- parms.pm_prot = info.proto->p_proto; ++ parms.pm_prot = info.proto; + + status = rpc_portmap_getport(&info, &parms, &info.port); + if (status < 0) +@@ -920,11 +900,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in + return exportlist; + + try_tcp: +- info.proto = getprotobyname("tcp"); +- if (!info.proto) +- return NULL; ++ info.proto = IPPROTO_TCP; + +- parms.pm_prot = info.proto->p_proto; ++ parms.pm_prot = info.proto; + + status = rpc_portmap_getport(&info, &parms, &info.port); + if (status < 0) +diff --git a/modules/replicated.c b/modules/replicated.c +index 6b96320..dbd5513 100644 +--- a/modules/replicated.c ++++ b/modules/replicated.c +@@ -419,7 +419,7 @@ void free_host_list(struct host **list) + + static unsigned int get_nfs_info(unsigned logopt, struct host *host, + struct conn_info *pm_info, struct conn_info *rpc_info, +- const char *proto, unsigned int version, int port) ++ int proto, unsigned int version, int port) + { + unsigned int random_selection = host->options & MOUNT_FLAG_RANDOM_SELECT; + unsigned int use_weight_only = host->options & MOUNT_FLAG_USE_WEIGHT_ONLY; +@@ -433,22 +433,18 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, + int status, count = 0; + + if (host->addr) +- debug(logopt, "called with host %s(%s) proto %s version 0x%x", ++ debug(logopt, "called with host %s(%s) proto %d version 0x%x", + host->name, get_addr_string(host->addr, buf, len), + proto, version); + else + debug(logopt, +- "called for host %s proto %s version 0x%x", ++ "called for host %s proto %d version 0x%x", + host->name, proto, version); + +- rpc_info->proto = getprotobyname(proto); +- if (!rpc_info->proto) +- return 0; +- ++ rpc_info->proto = proto; + memset(&parms, 0, sizeof(struct pmap)); +- + parms.pm_prog = NFS_PROGRAM; +- parms.pm_prot = rpc_info->proto->p_proto; ++ parms.pm_prot = proto; + + if (!(version & NFS4_REQUESTED)) + goto v3_ver; +@@ -479,7 +475,7 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, + } + } + +- if (rpc_info->proto->p_proto == IPPROTO_UDP) ++ if (rpc_info->proto == IPPROTO_UDP) + status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); + else + status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); +@@ -540,7 +536,7 @@ v3_ver: + goto v2_ver; + } + +- if (rpc_info->proto->p_proto == IPPROTO_UDP) ++ if (rpc_info->proto == IPPROTO_UDP) + status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); + else + status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); +@@ -587,7 +583,7 @@ v2_ver: + goto done_ver; + } + +- if (rpc_info->proto->p_proto == IPPROTO_UDP) ++ if (rpc_info->proto == IPPROTO_UDP) + status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); + else + status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); +@@ -618,7 +614,7 @@ v2_ver: + } + + done_ver: +- if (rpc_info->proto->p_proto == IPPROTO_UDP) { ++ if (rpc_info->proto == IPPROTO_UDP) { + rpc_destroy_udp_client(rpc_info); + rpc_destroy_udp_client(pm_info); + } else { +@@ -675,7 +671,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, + + if (version & TCP_REQUESTED) { + supported = get_nfs_info(logopt, host, +- &pm_info, &rpc_info, "tcp", vers, port); ++ &pm_info, &rpc_info, IPPROTO_TCP, vers, port); + if (IS_ERR(supported)) { + if (ERR(supported) == EHOSTUNREACH || + ERR(supported) == ETIMEDOUT) +@@ -688,7 +684,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, + + if (version & UDP_REQUESTED) { + supported = get_nfs_info(logopt, host, +- &pm_info, &rpc_info, "udp", vers, port); ++ &pm_info, &rpc_info, IPPROTO_UDP, vers, port); + if (IS_ERR(supported)) { + if (!ret && ERR(supported) == ETIMEDOUT) + return ret; +@@ -709,7 +705,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, + socklen_t len = INET6_ADDRSTRLEN; + char buf[len + 1]; + struct conn_info pm_info, rpc_info; +- const char *proto; ++ int proto; + unsigned int vers; + struct timeval start, end; + struct timezone tz; +@@ -748,10 +744,10 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, + * So, we do the conversion here. + */ + if (version & UDP_SELECTED_MASK) { +- proto = "udp"; ++ proto = IPPROTO_UDP; + version >>= 8; + } else +- proto = "tcp"; ++ proto = IPPROTO_TCP; + + switch (version) { + case NFS2_SUPPORTED: +@@ -768,9 +764,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, + return 0; + } + +- rpc_info.proto = getprotobyname(proto); +- if (!rpc_info.proto) +- return 0; ++ rpc_info.proto = proto; + + if (port > 0) + rpc_info.port = port; +@@ -786,14 +780,14 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, + + memset(&parms, 0, sizeof(struct pmap)); + parms.pm_prog = NFS_PROGRAM; +- parms.pm_prot = rpc_info.proto->p_proto; ++ parms.pm_prot = rpc_info.proto; + parms.pm_vers = vers; + ret = rpc_portmap_getport(&pm_info, &parms, &rpc_info.port); + if (ret < 0) + goto done; + } + +- if (rpc_info.proto->p_proto == IPPROTO_UDP) ++ if (rpc_info.proto == IPPROTO_UDP) + status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, vers); + else + status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, vers); +@@ -815,7 +809,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, + } + } + done: +- if (rpc_info.proto->p_proto == IPPROTO_UDP) { ++ if (rpc_info.proto == IPPROTO_UDP) { + rpc_destroy_udp_client(&rpc_info); + rpc_destroy_udp_client(&pm_info); + } else { diff --git a/SOURCES/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch b/SOURCES/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch new file mode 100644 index 0000000..6574597 --- /dev/null +++ b/SOURCES/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch @@ -0,0 +1,30 @@ +autofs-5.0.7 - use ulimit max open files if greater than internal maximum + +From: Ian Kent + +When setting the maximum number of allowed file handles the current setting +should be checked before setting it. If the ulimit command has been used to +increase the maximum to larger than what automount would ask for then honour +it. +--- + daemon/automount.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/daemon/automount.c b/daemon/automount.c +index 019637f..1d0b64e 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -2106,8 +2106,11 @@ int main(int argc, char *argv[]) + exit(1); + } + +- rlim.rlim_cur = MAX_OPEN_FILES; +- rlim.rlim_max = MAX_OPEN_FILES; ++ res = getrlimit(RLIMIT_NOFILE, &rlim); ++ if (res == -1 || rlim.rlim_max <= MAX_OPEN_FILES) { ++ rlim.rlim_cur = MAX_OPEN_FILES; ++ rlim.rlim_max = MAX_OPEN_FILES; ++ } + res = setrlimit(RLIMIT_NOFILE, &rlim); + if (res) + printf("%s: can't increase open file limit - continuing", diff --git a/SOURCES/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch b/SOURCES/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch new file mode 100644 index 0000000..6a1a49e --- /dev/null +++ b/SOURCES/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch @@ -0,0 +1,149 @@ +autofs-5.0.7 - workaround missing GNU versionsort extension + +From: Chris Packham + +alphasort() and scandir() are specified in POSIX.1-2008, versionsort() +is a GNU extension. When versionsort isn't available fallback to using +alphasort. +--- + + CHANGELOG | 1 + + configure | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.in | 6 +++++ + include/config.h.in | 3 ++ + modules/lookup_dir.c | 5 ++++ + 5 files changed, 77 insertions(+), 0 deletions(-) + + +diff --git a/CHANGELOG b/CHANGELOG +index 4eaa9f9..39388a5 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -27,6 +27,7 @@ + - lib/defaults.c: use WITH_LDAP conditional around LDAP types. + - make yellow pages support optional. + - modules/replicated.c: use sin6_addr.s6_addr32. ++- workaround missing GNU versionsort extension. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/configure b/configure +index cf6428c..c1423d8 100755 +--- a/configure ++++ b/configure +@@ -4010,6 +4010,68 @@ $as_echo "yes" >&6; } + KRB5_FLAGS=`$KRB5_CONFIG --cflags` + fi + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing versionsort" >&5 ++$as_echo_n "checking for library containing versionsort... " >&6; } ++if ${ac_cv_search_versionsort+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char versionsort (); ++int ++main () ++{ ++return versionsort (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' ; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_versionsort=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_versionsort+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_versionsort+:} false; then : ++ ++else ++ ac_cv_search_versionsort=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_versionsort" >&5 ++$as_echo "$ac_cv_search_versionsort" >&6; } ++ac_res=$ac_cv_search_versionsort ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++if test "$ac_cv_search_versionsort" = "no"; then ++ ++$as_echo "#define WITHOUT_VERSIONSORT 1" >>confdefs.h ++ ++fi ++ + # + # glibc/libc 6 new libraries + # +diff --git a/configure.in b/configure.in +index 363c376..4029375 100644 +--- a/configure.in ++++ b/configure.in +@@ -163,6 +163,12 @@ AF_SLOPPY_MOUNT() + AF_CHECK_LIBXML() + AF_CHECK_KRB5() + ++AC_SEARCH_LIBS([versionsort],[]) ++if test "$ac_cv_search_versionsort" = "no"; then ++ AC_DEFINE(WITHOUT_VERSIONSORT, 1, ++ [Define if your C library does not provide versionsort]) ++fi ++ + # + # glibc/libc 6 new libraries + # +diff --git a/include/config.h.in b/include/config.h.in +index 7f1c5b5..a2a05a8 100644 +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -135,6 +135,9 @@ + /* Define to 1 to use the libtirpc tsd usage workaround */ + #undef TIRPC_WORKAROUND + ++/* Define if your C library does not provide versionsort */ ++#undef WITHOUT_VERSIONSORT ++ + /* Define if using the dmalloc debugging malloc package */ + #undef WITH_DMALLOC + +diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c +index 33901c0..07471b7 100644 +--- a/modules/lookup_dir.c ++++ b/modules/lookup_dir.c +@@ -39,6 +39,11 @@ + #define AUTOFS_DIR_EXT ".autofs" + #define AUTOFS_DIR_EXTSIZ (sizeof(AUTOFS_DIR_EXT) - 1) + ++/* Work around non-GNU systems that don't provide versionsort */ ++#ifdef WITHOUT_VERSIONSORT ++#define versionsort alphasort ++#endif ++ + struct lookup_context { + const char *mapname; + }; diff --git a/SPECS/autofs.spec b/SPECS/autofs.spec new file mode 100644 index 0000000..3e216e1 --- /dev/null +++ b/SPECS/autofs.spec @@ -0,0 +1,2027 @@ +# +# $Id: autofs.spec,v 1.11 2003/12/04 15:41:32 raven Exp $ +# +# Use --without systemd in your rpmbuild command or force values to 0 to +# disable them. +%define with_systemd %{?_without_systemd: 0} %{?!_without_systemd: 1} + +Summary: A tool for automatically mounting and unmounting filesystems +Name: autofs +Version: 5.0.7 +Release: 32%{?dist} +Epoch: 1 +License: GPLv2+ +Group: System Environment/Daemons +Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-%{version}.tar.bz2 +Patch1: autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch +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 +Patch14: autofs-5.0.7-configure-allow-cross-compilation-update.patch +Patch15: autofs-5.0.6-fix-recursive-mount-deadlock.patch +Patch16: autofs-5.0.6-increase-file-map-read-buffer-size.patch +Patch17: autofs-5.0.7-handle-new-location-of-systemd.patch +Patch18: autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch +Patch19: autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch +Patch20: autofs-5.0.7-fix-nobind-man-page-description.patch +Patch21: autofs-5.0.7-fix-submount-offset-delete.patch +Patch22: autofs-5.0.7-fix-init-script-status-return.patch +Patch23: autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch +Patch24: autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch +Patch25: autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch +Patch26: autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch +Patch27: autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch +Patch28: autofs-5.0.7-make-yellow-pages-support-optional.patch +Patch29: autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch +Patch30: autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch +Patch31: autofs-5.0.7-dont-fail-on-master-map-self-include.patch +Patch32: autofs-5.0.7-fix-wildcard-multi-map-regression.patch +Patch33: autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch +Patch34: autofs-5.0.7-depricate-nosymlink-pseudo-option.patch +Patch35: autofs-5.0.7-add-symlink-pseudo-option.patch +Patch36: autofs-5.0.7-update-kernel-include-files.patch +Patch37: autofs-5.0.7-fix-requires-in-spec-file.patch +Patch38: autofs-5.0.7-fix-libtirpc-build-option.patch +Patch39: autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch +Patch40: autofs-5.0.7-document-browse-option-in-man-page.patch +Patch41: autofs-5.0.7-fix-automounter-support-on-parisc.patch +Patch42: autofs-5.0.7-fix-some-automount_8-typos.patch +Patch43: autofs-5.0.7-syncronize-handle_mounts-shutdown.patch +Patch44: autofs-5.0.7-fix-submount-tree-not-all-expiring.patch +Patch45: autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch +Patch46: autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch +Patch47: autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch +Patch48: autofs-5.0.7-fix-interface-address-null-check.patch +Patch49: autofs-5.0.7-dont-probe-rdma-mounts.patch +Patch50: autofs-5.0.7-fix-master-map-mount-options-matching.patch +Patch51: autofs-5.0.7-fix-master-map-bogus-keywork-match.patch +Patch52: autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch +Patch53: autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch +Patch54: autofs-5.0.7-fix-fcntl-return-check.patch +Patch55: autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch +Patch56: autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch +Patch57: autofs-5.0.7-fix-incorrect-name-in-test.patch +Patch58: autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch +Patch59: autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch +Patch60: autofs-5.0.7-fix-several-off-by-one-errors.patch +Patch61: autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch +Patch62: autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch +Patch63: autofs-5.0.7-add-null-check-in-read_one.patch +Patch64: autofs-5.0.7-add-pgrp-check-in-do_spawn.patch +Patch65: autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch +Patch66: autofs-5.0.7-add-null-check-in-extract_version.patch +Patch67: autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch +Patch68: autofs-5.0.7-add-null-check-in-parse_server_string.patch +Patch69: autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch +Patch70: autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch +Patch71: autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch +Patch72: autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch +Patch73: autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch +Patch74: autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch +Patch75: autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch +Patch76: autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch +Patch77: autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch +Patch78: autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch +Patch79: autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch +Patch80: autofs-5.0.7-misc-man-page-fixes.patch +Patch81: autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch +Patch82: autofs-5.0.7-check-for-protocol-option.patch +Patch83: autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch +Patch84: autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch +Patch85: autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch +Patch86: autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch +Patch87: autofs-5.0.7-fix-syncronize-handle_mounts-shutdown.patch +Patch88: autofs-5.0.7-fix-fix-wildcard-multi-map-regression.patch +Patch89: autofs-5.0.7-fix-dumpmaps-multi-output.patch +Patch90: autofs-5.0.7-try-and-cleanup-after-dumpmaps.patch +Patch91: autofs-5.0.7-teach-dumpmaps-to-output-simple-key-value-pairs.patch +Patch92: autofs-5.0.7-fix-get_nfs_info-probe.patch +Patch93: autofs-5.0.7-fix-portmap-lookup.patch +Patch94: autofs-5.0.7-only-probe-specific-nfs-version-when-requested.patch +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%if %{with_systemd} +BuildRequires: systemd-units +%endif +BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs libtirpc-devel +BuildRequires: libsss_autofs +Conflicts: cyrus-sasl-lib < 2.1.23-9 +Requires: kernel >= 2.6.17 +Requires: bash coreutils sed gawk textutils sh-utils grep module-init-tools /bin/ps +%if %{with_systemd} +Requires(post): systemd-sysv +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +Requires(postun): /sbin/chkconfig +%endif +Summary(de): autofs daemon +Summary(fr): démon autofs +Summary(tr): autofs sunucu süreci +Summary(sv): autofs-daemon + +%description +autofs is a daemon which automatically mounts filesystems when you use +them, and unmounts them later when you are not using them. This can +include network filesystems, CD-ROMs, floppies, and so forth. + +%description -l de +autofs ist ein Dämon, der Dateisysteme automatisch montiert, wenn sie +benutzt werden, und sie später bei Nichtbenutzung wieder demontiert. +Dies kann Netz-Dateisysteme, CD-ROMs, Disketten und ähnliches einschließen. + +%description -l fr +autofs est un démon qui monte automatiquement les systèmes de fichiers +lorsqu'on les utilise et les démonte lorsqu'on ne les utilise plus. Cela +inclus les systèmes de fichiers réseau, les CD-ROMs, les disquettes, etc. + +%description -l tr +autofs, kullanýlan dosya sistemlerini gerek olunca kendiliðinden baðlar +ve kullanýmlarý sona erince yine kendiliðinden çözer. Bu iþlem, að dosya +sistemleri, CD-ROM'lar ve disketler üzerinde yapýlabilir. + +%description -l sv +autofs är en daemon som mountar filsystem när de använda, och senare +unmountar dem när de har varit oanvända en bestämd tid. Detta kan +inkludera nätfilsystem, CD-ROM, floppydiskar, och så vidare. + +%prep +%setup -q +echo %{version}-%{release} > .version +%if %{with_systemd} + %define unitdir %{?_unitdir:/usr/lib/systemd/system} + %define systemd_configure_arg --with-systemd +%endif +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 +%patch67 -p1 +%patch68 -p1 +%patch69 -p1 +%patch70 -p1 +%patch71 -p1 +%patch72 -p1 +%patch73 -p1 +%patch74 -p1 +%patch75 -p1 +%patch76 -p1 +%patch77 -p1 +%patch78 -p1 +%patch79 -p1 +%patch80 -p1 +%patch81 -p1 +%patch82 -p1 +%patch83 -p1 +%patch84 -p1 +%patch85 -p1 +%patch86 -p1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 +%patch90 -p1 +%patch91 -p1 +%patch92 -p1 +%patch93 -p1 +%patch94 -p1 + +%build +LDFLAGS=-Wl,-z,now +%configure --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:} +make initdir=%{_initrddir} DONTSTRIP=1 + +%install +rm -rf $RPM_BUILD_ROOT +%if %{with_systemd} +install -d -m 755 $RPM_BUILD_ROOT%{unitdir} +%else +mkdir -p -m755 $RPM_BUILD_ROOT%{_initrddir} +%endif +mkdir -p -m755 $RPM_BUILD_ROOT%{_sbindir} +mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}/autofs +mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/{man5,man8} +mkdir -p -m755 $RPM_BUILD_ROOT/etc/sysconfig +mkdir -p -m755 $RPM_BUILD_ROOT/etc/auto.master.d + +make install mandir=%{_mandir} initdir=%{_initrddir} systemddir=%{unitdir} INSTALLROOT=$RPM_BUILD_ROOT +echo make -C redhat +make -C redhat +install -m 755 -d $RPM_BUILD_ROOT/misc +%if %{with_systemd} +# Configure can get this wrong when the unit files appear under /lib and /usr/lib +find $RPM_BUILD_ROOT -type f -name autofs.service -exec rm -f {} \; +install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{unitdir}/autofs.service +%define init_file_name %{unitdir}/autofs.service +%else +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.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%if %{with_systemd} +%systemd_post %{name}.service +%else +if [ $1 -eq 1 ]; then + %{_sbindir}/sbin/chkconfig --add autofs +fi +%endif + +%preun +%if %{with_systemd} +%systemd_preun %{name}.service +%else +if [ $1 -eq 0 ] ; then + %{_sbindir}/service autofs stop > /dev/null 2>&1 || : + %{_sbindir}/chkconfig --del autofs +fi +%endif + +%postun +%if %{with_systemd} +%systemd_postun_with_restart %{name}.service +%else +if [ $1 -ge 1 ] ; then + %{_sbindir}/sbin/service autofs condrestart > /dev/null 2>&1 || : +fi +%endif + +%triggerun -- %{name} < 5.0.6-5 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply %{name} +# to migrate them to systemd targets +%{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +%{_sbindir}/chkconfig --del %{name} >/dev/null 2>&1 || : +%{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || : + +%files +%defattr(-,root,root,-) +%doc CREDITS INSTALL COPY* README* patches/* samples/ldap* samples/autofs.schema +%config %{init_file_name} +%config(noreplace,missingok) /etc/auto.master +%config(noreplace,missingok) /etc/auto.misc +%config(noreplace,missingok) /etc/auto.net +%config(noreplace,missingok) /etc/auto.smb +%config(noreplace) /etc/sysconfig/autofs +%config(noreplace) /etc/autofs_ldap_auth.conf +%{_sbindir}/automount +%{_mandir}/*/* +%{_libdir}/autofs/ +%dir /etc/auto.master.d + +%changelog +* Thu Nov 7 2013 Ian Kent - 1:5.0.7-32 +- bz1011909 - NFSv4 UDP packet sent during automounting + - only probe specific nfs version if requested. +- Related: rhbz#1011909 + +* Tue Oct 22 2013 Ian Kent - 1:5.0.7-31 +- bz1011909 - NFSv4 UDP packet sent during automounting + - fix get_nfs_info() probe. + - fix portmap lookup. +- bz995979 - RFE: feature to dump automount maps in native file format + - update dumpmaps patch with latest changes from QE testing. +- Resolves: rhbz#1011909 rhbz#995979 + +* Thu Aug 22 2013 Ian Kent - 1:5.0.7-30 +- bz852327 - RFE: feature to dump automount maps in native file format + - fix dumpmaps multi output. + - try and cleanup after dumpmaps. + - teach dumpmaps to output simple key value pairs. +- Resolves: rhbz#852327 + +* Tue Aug 13 2013 Ian Kent - 1:5.0.7-29 +- bz994352 - "autofs reload" causes automount to stop running when multiple + maps are removed from auto.master + - fix syncronize handle_mounts() shutdown. +- bz994359 - Wildcard in nested mounts regression + - fix fix wildcard multi map regression. +- Resolves: rhbz#994352 rhbz#994359 + +* Sat Jul 13 2013 Ian Kent - 1:5.0.7-28 +- bz983160 Package autofs-5.0.7-22.el7 failed RHEL7 RPMdiff testing + - fix add null check in parse_server_string() (bz979155). + - check for protocol option. + - use ulimit max open files if greater than internal maximum. + - fix default path used for unitdir. + - fix changelog inconsistent dates. + - fix default path used for unitdir. + - fix changelog inconsistent dates. + - link with full reloc options. + - fix a couple of compiler warnings. + - add after sssd dependency to unit file (bz984089). +- Resolves: rhbz#983160 ++ +* Wed Jun 19 2013 Ian Kent - 1:5.0.7-22 +- misc man page fixes (bz948517). + +* Wed Jun 12 2013 Ian Kent - 1:5.0.7-21 +- fix probe each nfs version in turn for singleton mounts (bz973537). + +* Tue Jun 11 2013 Ian Kent - 1:5.0.7-20 +- fix master map mount options matching. +- fix master map bogus keywork match. +- fix fix map entry duplicate offset detection. +- add a number of fixes based on a Covarity report. + +* Mon May 27 2013 Ian Kent - 1:5.0.7-19 +- dont probe rdma mounts. + +* Fri May 24 2013 Ian Kent - 1:5.0.7-17 +- fix interface address null check. + +* Mon May 13 2013 Ian Kent - 1:5.0.7-16 +- make dump maps check for duplicate indirect mounts (bz961312). +- document allowed map sources in auto.master(5) (bz961312). +- add enable sloppy mount option to configure. + +* Sun Apr 28 2013 Ian Kent - 1:5.0.7-14 +- fix some automount(8) typos (bz664178). +- fix syncronize of handle_mounts() shutdown. +- fix submount tree not all expiring. + +* Tue Mar 12 2013 Ian Kent - 1:5.0.7-12 +- dont fail on master map self include. +- fix wildcard multi map regression. +- fix file descriptor leak when reloading the daemon. +- depricate nosymlink pseudo option. +- add symlink pseudo option. +- update kernel include files. +- fix requires in spec file. +- fix libtirpc build option. +- fix systemd unidir in spec file. +- document browse option in man page. +- fix automounter support on parisc. + +* Wed Feb 13 2013 Fedora Release Engineering - 1:5.0.7-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 21 2013 Ian Kent - 1:5.0.7-10 +- fix submount offset delete. +- fix init script status return. +- fix use get_proximity() without libtirpc. +- don't use dirent d_type to filter out files in scandir(). +- don't schedule new alarms after readmap. +- use numeric protocol ids instead of protoent structs. +- lib/defaults.c: use WITH_LDAP conditional around LDAP types. +- make yellow pages support optional. +- modules/replicated.c: use sin6_addr.s6_addr32. +- workaround missing GNU versionsort extension. + +* Tue Nov 20 2012 Ian Kent - 1:5.0.7-9 +- fix nobind man page description. + +* Tue Nov 20 2012 Ian Kent - 1:5.0.7-8 +- fix map entry duplicate offset detection. +- Allow nsswitch.conf to not contain "automount:" lines. + +* Thu Oct 18 2012 Ian Kent - 1:5.0.7-7 +- use spec file systemd unit file location. + +* Thu Oct 18 2012 Ian Kent - 1:5.0.7-6 +- fix recursive mount deadlock. +- increase file map read buffer size. +- handle new location of systemd. + +* Tue Oct 16 2012 Ian Kent - 1:5.0.7-5 +- configure: allow cross compilation update. +- fix date in changelog entry. + +* Mon Oct 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 10 2012 Ian Kent - 1:5.0.7-3 +- fix nobind sun escaped map entries. +- fix use cache entry after free mistake. +- fix ipv6 proximity calculation. +- fix parse buffer initialization. +- fix typo in automount(8). + +* Mon Aug 27 2012 Ian Kent - 1:5.0.7-2 +- update systemd scriplet macros (bz850040). + +* Wed Jul 25 2012 Ian Kent - 1:5.0.7-1 +- Update to upstream version 5.0.7. + +* Wed Jul 25 2012 Ian Kent - 1:5.0.6-24 +- fix changelog message commit dates. + +* Wed Jul 18 2012 Fedora Release Engineering - 1:5.0.6-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 16 2012 Ian Kent - 1:5.0.6-21 +- fix systemd argument passing. +- fix get_nfs_info() can incorrectly fail. +- fix offset directory removal. + +* Tue Jul 3 2012 Ian Kent - 1:5.0.6-21 +- fix fix LDAP result leaks on error paths. +- report map not read when debug logging. +- duplicate parent options for included maps. +- update ->timeout() function to not return timeout. +- move timeout to map_source. +- fix kernel verion check of version components. +- dont retry ldap connect if not required. +- check if /etc/mtab is a link to /proc/self/mounts. +- fix nfs4 contacts portmap. +- make autofs wait longer for shutdown. +- fix sss map age not updated. +- fix remount deadlock. +- fix umount recovery of busy direct mount. +- fix offset mount point directory removal. +- remove move mount code and configure option. +- fix remount of multi mount. +- fix devce ioctl alloc path check. +- refactor hosts lookup module. +- remove cache update from parse_mount(). +- add function to delete offset cache entry. +- allow update of multi mount offset entries. +- add hup signal handling to hosts map. + +* Tue May 22 2012 Ian Kent - 1:5.0.6-19 +- fix libtirpc name clash (bz821847). + +* Tue May 22 2012 Ian Kent - 1:5.0.6-18 +- update patch fix initialization in rpc create_client() (bz821847). + +* Wed May 16 2012 Ian Kent - 1:5.0.6-17 +- fix initialization in rpc create_client() (bz821847). + +* Tue May 1 2012 Ian Kent - 1:5.0.6-16 +- add libsss_autofs as a build dependency. + +* Tue May 1 2012 Ian Kent - 1:5.0.6-15 +- fix typo in libtirpc file name. +- fix rework error return handling in rpc code. +- allow MOUNT_WAIT to override probe. +- improve UDP RPC timeout handling. +- fix segfault in get_query_dn(). +- use strtok_r() in linux_version_code(). +- fix sss wildcard match. +- fix dlopen() error handling in sss module. +- fix configure string length tests for sss library. + +* Wed Feb 29 2012 Ian Kent - 1:5.0.6-14 +- fix function to check mount.nfs version. + +* Sun Feb 26 2012 Ian Kent - 1:5.0.6-13 +- fix error in %post scriplet. + +* Fri Feb 24 2012 Ian Kent - 1:5.0.6-12 +- ignore duplicate exports in auto.net. +- add kernel verion check function. +- add function to check mount.nfs version. +- reinstate singleton mount probe. +- rework error return handling in rpc code. +- catch EHOSTUNREACH and bail out early. +- systemd support fixes. +- fix segmentation fault in do_remount_indirect(). + +* Thu Feb 9 2012 Ian Kent - 1:5.0.6-11 +- fix fuzz in CHANGELOG hunk when applying patch26. + +* Tue Feb 7 2012 Ian Kent - 1:5.0.6-10 +- fix rpc build error. +- add sss lookup module. +- teach automount about sss source. + +* Mon Jan 23 2012 Ian Kent - 1:5.0.6-9 +- add correct patch for "fix improve mount location error reporting". +- add correct patch for "fix fix wait for master source mutex". + +* Mon Jan 23 2012 Ian Kent - 1:5.0.6-8 +- fix fix wait for master source mutex. +- fix improve mount location error reporting (bz783496). + +* Thu Jan 12 2012 Fedora Release Engineering - 1:5.0.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Dec 9 2011 Ian Kent - 1:5.0.6-6 +- remove empty command line arguments (passed by systemd). + +* Mon Dec 5 2011 Ian Kent - 1:5.0.6-5 +- fix ipv6 name lookup check. +- fix ipv6 rpc calls. +- fix ipv6 configure check. +- add piddir to configure. +- add systemd unit support. +- fix MNT_DETACH define. + +* Mon Dec 5 2011 Ian Kent - 1:5.0.6-4 +- fix lsb service name in init script 2 (bz712504). + +* Tue Nov 8 2011 Ian Kent - 1:5.0.6-3 +- improve mount location error reporting. +- fix paged query more results check. +- fix dumpmaps not reading maps. +- fix result null check in read_one_map(). +- Fix LDAP result leaks on error paths. +- code analysis fixes 1. +- fix not bind mounting local filesystem. +- update dir map-type patch for changed patch order. +- fix wait for master source mutex. +- fix submount shutdown race +- fix fix map source check in file lookup. +- add disable move mount configure option. + +* Wed Jul 6 2011 Ian Kent - 1:5.0.6-2 +- add missing spec file entries for dir-type change (bz719208). + +* Mon Jul 4 2011 Ian Kent - 1:5.0.6-1 +- update source to 5.0.6. +- fix ipv6 name for lookup fix. +- add dir map-type patch. + +* Tue Jun 14 2011 Ian Kent - 1:5.0.5-38 +- fix lsb service name in init script (bz692963). + +* Fri Mar 18 2011 Ian Kent - 1:5.0.5-37 +- replace GPLv3 code with GPLv2 equivalent. + +* Thu Mar 03 2011 Ian Kent - 1:5.0.5-36 +- use weight only for server selection. +- fix isspace() wild card substition. +- auto adjust ldap page size. +- fix prune cache valid check. +- fix mountd vers retry. +- fix expire race. +- add lsb force-reload and try-restart. + +* Mon Feb 07 2011 Fedora Release Engineering - 1:5.0.5-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Nov 23 2010 Ian Kent - 1:5.0.5-34.fc15 +- revert wait for master map to be available at start. + +* Mon Nov 22 2010 Ian Kent - 1:5.0.5-33.fc15 +- fix wait for master map to be available at start. + +* Mon Nov 8 2010 Ian Kent - 1:5.0.5-32.fc15 +- always read file maps mount lookup map read fix. +- fix direct map not updating on reread. +- add external bind method. +- fix add simple bind auth. +- add option to dump configured automount maps. +- wait for master map to be available at start. + +* Fri Aug 27 2010 Ian Kent - 1:5.0.5-31.fc15 +- fix status privilege error (bz627605). + +* Wed Aug 18 2010 Ian Kent - 1:5.0.5-30.fc15 +- fix restart not working (bz624694). + +* Wed Aug 11 2010 Ian Kent - 1:5.0.5-29 +- remove ERR_remove_state() openssl call. + +* Tue Aug 10 2010 Ian Kent - 1:5.0.5-28 +- remove extra read master map call. +- remove extra cache create call in master_add_map_source(). +- fix error handing in do_mount_indirect(). +- expire thread use pending mutex. +- explicity link against the Kerberos library. +- remove some log message duplication for verbose logging. + +* Mon May 24 2010 Ian Kent - 1:5.0.5-27.fc14 +- fix master map source server unavailable handling. +- add autofs_ldap_auth.conf man page. +- fix random selection for host on different network. +- make redhat init script more lsb compliant. +- don't hold lock for simple mounts. +- fix remount locking. +- fix wildcard map entry match. +- fix parse_sun() module init. +- dont check null cache on expire. +- fix null cache race. +- fix cache_init() on source re-read. +- fix mapent becomes negative during lookup. +- check each dc server individually. +- fix negative cache included map lookup. +- remove state machine timed wait. + +* Fri Apr 30 2010 Ian Kent - 1:5.0.5-26.fc14 +- remove URL tag as there is not official autofs wiki (bz529804). + +* Wed Apr 7 2010 Ian Kent - 1:5.0.5-25.fc14 +- make nfs4 default for replicated selection configuration (bz579949). +- add simple bind authentication option (bz579951). + +* Fri Mar 26 2010 Ian Kent - 1:5.0.5-24.fc14 +- fix add locality as valid ldap master map attribute (bz575863). + +* Wed Mar 17 2010 Ian Kent - 1:5.0.5-22 +- fix get query dn failure. +- fix ampersand escape in auto.smb. +- add locality as valid ldap master map attribute. + +* Wed Mar 17 2010 Ian Kent - 1:5.0.5-22 +- add Conflicts to ensure we get fixed cyrus-sasl-lib for rev 21 change. + +* Tue Feb 23 2010 Ian Kent - 1:5.0.5-21 +- add missing sasl mutex callbacks. + +* Thu Feb 11 2010 Ian Kent - 1:5.0.5-19 +- fix segfault upon reconnect cannot find valid base dn. + +* Mon Feb 1 2010 Ian Kent - 1:5.0.5-17 +- dont connect at ldap lookup module init. +- fix random selection option. +- fix disable timeout. +- fix strdup() return value check. + +* Tue Dec 8 2009 Ian Kent - 1:5.0.5-16 +- fix memory leak on reload (bz545137). + +* Fri Dec 4 2009 Ian Kent - 1:5.0.5-14 +- fix rpc fail on large export list (bz543023). + +* Mon Nov 30 2009 Ian Kent - 1:5.0.5-12 +- check for path mount location in generic module. +- dont fail mount on access fail. + +* Tue Nov 24 2009 Ian Kent - 1:5.0.5-10 +- fix pidof init script usage. + +* Mon Nov 23 2009 Ian Kent - 1:5.0.5-8 +- fix timeout in connect_nb(). + +* Mon Nov 16 2009 Ian Kent - 1:5.0.5-6 +- don't use master_lex_destroy() to clear parse buffer. +- make documentation for set-log-priority clearer. + +* Tue Nov 10 2009 Ian Kent - 1:5.0.5-5 +- fix ext4 "preen" fsck at mount. + +* Mon Nov 9 2009 Ian Kent - 1:5.0.5-4 +- fix stale initialization for file map instance patch was not applied. + +* Tue Nov 3 2009 Ian Kent - 1:5.0.5-3 +- fix stale initialization for file map instance. + +* Tue Oct 6 2009 Ian Kent - 1:5.0.5-2 +- fix included map read fail handling. +- refactor ldap sasl authentication bind to eliminate extra connect + causing some servers to reject the request. +- add mount wait parameter to allow timeout of mount requests to + unresponsive servers. +- special case cifs escape handling. +- fix libxml2 workaround configure. +- more code analysis corrections (and fix a typo in an init script). +- fix backwards #ifndef INET6. + +* Fri Sep 4 2009 Ian Kent - 1:5.0.5-1 +- update source to latest upstream version. + - this is essentially a consolidation of the patches already in this rpm. +- add dist tag to match latest RHEL-5 package tag format. + +* Thu Sep 3 2009 Ian Kent - 1:5.0.4-39 +- fix libxml2 non-thread-safe calls. +- fix direct map cache locking. +- fix patch "dont umount existing direct mount on reread" deadlock. + +* Fri Jul 24 2009 Fedora Release Engineering - 1:5.0.4-37 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Jul 17 2009 Ian Kent - 1:5.0.4-34 +- fix typo in patch to allow dumping core. + +* Wed Jul 15 2009 Ian Kent - 1:5.0.4-32 +- fix an RPC fd leak. +- don't block signals we expect to dump core. +- fix pthread push order in expire_proc_direct(). + +* Fri Jun 12 2009 Ian Kent - 1:5.0.4-30 +- fix incorrect dclist free. +- srv lookup handle endianness. +- fix bug introduced by library reload changes which causes autofs to + not release mount thread resources when using submounts. +- fix notify mount message path. +- try harder to work out if we created mount point at remount. +- fix double free in do_sasl_bind(). +- manual umount recovery fixes. +- fix map type info parse error. + +* Mon May 18 2009 Ian Kent - 1:5.0.4-28 +- use intr option as hosts mount default. +- sync kernel includes with upstream kernel. +- dont umount existing direct mount on master re-read. +- fix incorrect shutdown introduced by library relaod fixes. +- improve manual umount recovery. +- dont fail on ipv6 address when adding host. +- always read file maps multi map fix. +- always read file maps key lookup fixes. +- add support for LDAP_URI="ldap:///" SRV RR lookup. + +* Thu Apr 16 2009 Ian Kent - 1:5.0.4-26 +- fix lsb init script header. +- fix memory leak reading ldap master map. +- fix st_remove_tasks() locking. +- reset flex scanner when setting buffer. +- zero s_magic is valid. + +* Mon Mar 30 2009 Ian Kent - 1:5.0.4-24 +- clear rpc client on lookup fail. + +* Fri Mar 20 2009 Ian Kent - 1:5.0.4-23 +- fix call restorecon when misc device file doesn't exist. + +* Wed Mar 18 2009 Ian Kent - 1:5.0.4-22 +- use misc device ioctl interface by default, if available. + +* Tue Mar 17 2009 Ian Kent - 1:5.0.4-21 +- fix file map lookup when reading included or nsswitch sources. + - a regression introduced by file map lookup optimisation in rev 9. + +* Fri Mar 13 2009 Ian Kent - 1:5.0.4-20 +- add LSB init script parameter block. + +* Fri Mar 13 2009 Ian Kent - 1:5.0.4-19 +- another easy alloca replacements fix. + +* Thu Mar 12 2009 Ian Kent - 1:5.0.4-18 +- fix return start status on fail. +- fix double free in expire_proc(). + +* Wed Feb 25 2009 Ian Kent - 1:5.0.4-17 +- fix bad token declaration in master map parser. + +* Wed Feb 25 2009 Ian Kent - 1:5.0.4-16 +- correct mkdir command in %%install section, bz481132. + +* Tue Feb 24 2009 Ian Kent - 1:5.0.4-15 +- fix array out of bounds accesses and cleanup couple of other alloca() calls. +- Undo mistake in copy order for submount path introduced by rev 11 patch. +- add check for alternate libxml2 library for libxml2 tsd workaround. +- add check for alternate libtirpc library for libtirpc tsd workaround. +- cleanup configure defines for libtirpc. +- add WITH_LIBTIRPC to -V status report. +- add libtirpc-devel to BuildRequires. +- add nfs mount protocol default configuration option. + +* Mon Feb 23 2009 Fedora Release Engineering - 1:5.0.4-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Feb 19 2009 Ian Kent - 5.0.4-10 +- fix mntent.h not included before use of setmntent_r(). + +* Mon Feb 16 2009 Ian Kent - 5.0.4-9 +- fix hosts map use after free. +- fix uri list locking (again). +- check for stale SASL credentials upon connect fail. +- add "forcestart" and "forcerestart" init script options to allow + use of 5.0.3 strartup behavior if required. +- always read entire file map into cache to speed lookups. +- make MAX_ERR_BUF and PARSE_MAX_BUF use easier to audit. +- make some easy alloca replacements. +- update to configure libtirpc if present. +- update to provide ipv6 name and address support. +- update to provide ipv6 address parsing. + +* Thu Feb 5 2009 Ian Kent - 5.0.4-8 +- rename program map parsing bug fix patch. +- use CLOEXEC flag functionality for setmntent also, if present. + +* Wed Jan 21 2009 Jeff Moyer - 5.0.4-6 +- fix a bug in the program map parsing routine + +* Thu Jan 15 2009 Ian Kent - 5.0.4-5 +- fix negative caching of non-existent keys. +- fix ldap library detection in configure. +- use CLOEXEC flag functionality if present. +- fix select(2) fd limit. +- make hash table scale to thousands of entries. + +* Wed Dec 3 2008 Ian Kent - 5.0.4-4 +- fix nested submount expire deadlock. + +* Wed Nov 19 2008 Ian Kent - 5.0.4-3 +- fix libxml2 version check for deciding whether to use workaround. + +* Tue Nov 11 2008 Ian Kent - 5.0.4-2 +- Fix tag confusion. + +* Tue Nov 11 2008 Ian Kent - 5.0.4-1 +- Upstream source version 5.0.4. + +* Tue Nov 11 2008 Ian Kent - 5.0.3-32 +- correct buffer length setting in autofs-5.0.3-fix-ifc-buff-size-fix.patch. + +* Sun Nov 2 2008 Ian Kent - 5.0.3-30 +- fix segv during library re-open. +- fix incorrect pthreads condition handling for expire requests. +- fix master map lexer eval order. +- fix bad alloca usage. + +* Thu Oct 23 2008 Ian Kent - 5.0.3-28 +- don't close file handle for rootless direct mounti-mount at mount. +- wait submount expire thread completion when expire successful. +- add inadvertantly ommitted server list locking in LDAP module. + +* Fri Oct 10 2008 Ian Kent - 5.0.3-26 +- add map-type-in-map-name fix patch to sync with upstream and RHEL. +- don't readmap on HUP for new mount. +- add NIS_PARTIAL to map entry not found check and fix use after free bug. + +* Fri Sep 26 2008 Ian Kent - 5.0.3-25 +- fix fd leak at multi-mount non-fatal mount fail. +- fix incorrect multi-mount mountpoint calcualtion. + +* Fri Sep 19 2008 Ian Kent - 5.0.3-23 +- add upstream bug fixes + - bug fix for mtab check. + - bug fix for zero length nis key. + - update for ifc buffer handling. + - bug fix for kernel automount handling. +- warning: I found a bunch of patches that were present but not + being applied. + +* Mon Aug 25 2008 Ian Kent - 5.0.3-21 +- add upstream bug fix patches + - add command line option to override is running check. + - don't use proc fs for is running check. + - fix fail on included browse map not found. + - fix incorrect multi source messages. + - clear stale flag on map read. + - fix proximity other rpc ping timeout. + - refactor mount request vars code. + - make handle_mounts startup condition distinct. + - fix submount shutdown handling. + - try not to block on expire. + - add configuration paramter UMOUNT_WAIT. + - fix multi mount race. + - fix nfs4 colon escape handling. + - check replicated list after probe. + - add replicated server selection debug logging. + - update replicated server selection documentation. + - use /dev/urandom instead of /dev/random. + - check for mtab pointing to /proc/mounts. + - fix interface config buffer size. + - fix percent hack heap corruption. + +* Mon Jul 14 2008 Tom "spot" Callaway - 5.0.3-19 +- change conflicts to requires +- fix license tag + +* Mon Jun 30 2008 Ian Kent - 5.0.3-18 +- don't abuse the ap->ghost field on NFS mount. +- multi-map doesn't pickup NIS updates automatically. +- eliminate redundant DNS name lookups. +- mount thread create condition handling fix. +- allow directory create on NFS root. +- check direct mount path length. +- fix incorrect in check in get user info. +- fix a couple of memory leaks. + +* Wed May 14 2008 Ian Kent - 5.0.3-16 +- update patches, documentation and comments only change. +- rename patch and add to CVS. + +* Mon May 12 2008 Ian Kent - 5.0.3-14 +- check for nohide mounts (bz 442618). +- ignore nsswitch sources that aren't supported (bz 445880). + +* Thu Apr 17 2008 Ian Kent - 5.0.3-13 +- fix typo in patch for incorrect pthreads condition handling patch. + +* Mon Apr 14 2008 Ian Kent - 5.0.3-12 +- fix incorrect pthreads condition handling for mount requests. + +* Tue Apr 1 2008 Ian Kent - 5.0.3-11 +- and another try at fixing lexer matching map type in map name. + +* Sun Mar 30 2008 Ian Kent - 5.0.3-10 +- another try a fixing lexer matching map type in map name. + +* Wed Mar 26 2008 Ian Kent - 5.0.3-9 +- fix lexer ambiguity in match when map type name is included in map name. + +* Mon Mar 24 2008 Ian Kent - 5.0.3-8 +- revert miscellaneous device node related patches. +- add missing check for zero length NIS key. +- fix incorrect match of map type name when included in map name. +- update rev 7 sasl callbacks patch. + +* Thu Mar 20 2008 Ian Kent - 5.0.3-7 +- add patch to initialize sasl callbacks unconditionally on autofs + LDAP lookup library load. + +* Mon Feb 25 2008 Ian Kent - 5.0.3-6 +- fix expire calling kernel more often than needed. +- fix unlink of mount tree incorrectly causing autofs mount fail. +- add miscellaneous device node interface library. +- use miscellaneous device node, if available, for active restart. +- device node and active restart fixes. +- update is_mounted to use device node ioctl, if available. + +* Fri Feb 1 2008 Ian Kent - 5.0.3-5 +- another fix for don't fail on empty master map. + +* Fri Jan 25 2008 Ian Kent - 5.0.3-4 +- correction to the correction for handling of LDAP base dns with spaces. +- avoid using UDP for probing NFSv4 mount requests. +- use libldap instead of libldap_r. + +* Mon Jan 21 2008 Ian Kent - 5.0.3-3 +- catch "-xfn" map type and issue "no supported" message. +- another correction for handling of LDAP base dns with spaces. + +* Mon Jan 14 2008 Ian Kent - 5.0.3-2 +- correct configure test for ldap page control functions. + +* Mon Jan 14 2008 Ian Kent - 5.0.3-1 +- update source to version 5.0.3. + +* Fri Dec 21 2007 Ian Kent - 5.0.2-25 +- Bug 426401: CVE-2007-6285 autofs default doesn't set nodev in /net [rawhide] + - use mount option "nodev" for "-hosts" map unless "dev" is explicily specified. + +* Tue Dec 18 2007 Ian Kent - 5.0.2-23 +- Bug 397591 SELinux is preventing /sbin/rpc.statd (rpcd_t) "search" to (sysctl_fs_t). + - prevent fork between fd open and setting of FD_CLOEXEC. + +* Thu Dec 13 2007 Ian Kent - 5.0.2-21 +- Bug 421371: CVE-2007-5964 autofs defaults don't restrict suid in /net [rawhide] + - use mount option "nosuid" for "-hosts" map unless "suid" is explicily specified. + +* Thu Dec 6 2007 Jeremy Katz - 1:5.0.2-19 +- rebuild for new ldap + +* Tue Nov 20 2007 Ian Kent - 5.0.2-18 +- fix schema selection in LDAP schema discovery. +- check for "*" when looking up wildcard in LDAP. +- fix couple of edge case parse fails of timeout option. +- add SEARCH_BASE configuration option. +- add random selection as a master map entry option. +- re-read config on HUP signal. +- add LDAP_URI, LDAP_TIMEOUT and LDAP_NETWORK_TIMEOUT configuration options. +- fix deadlock in submount mount module. +- fix lack of ferror() checking when reading files. +- fix typo in autofs(5) man page. +- fix map entry expansion when undefined macro is present. +- remove unused export validation code. +- add dynamic logging (adapted from v4 patch from Jeff Moyer). +- fix recursive loopback mounts (Matthias Koenig). +- add map re-load to verbose logging. +- fix handling of LDAP base dns with spaces. +- handle MTAB_NOTUPDATED status return from mount. +- when default master map, auto.master, is used also check for auto_master. +- update negative mount timeout handling. +- fix large group handling (Ryan Thomas). +- fix for dynamic logging breaking non-sasl build (Guillaume Rousse). +- eliminate NULL proc ping for singleton host or local mounts. + +* Mon Sep 24 2007 Ian Kent - 5.0.2-16 +- add descriptive comments to config about LDAP schema discovery. +- work around segfault at exit caused by libxml2. +- fix foreground logging (also fixes shutdown needing extra signal bug). + +* Wed Sep 5 2007 Ian Kent - 5.0.2-15 +- fix LDAP schema discovery. + +* Tue Aug 28 2007 Ian Kent - 5.0.2-14 +- update patch to prevent failure on empty master map. +- if there's no "automount" entry in nsswitch.conf use "files" source. +- add LDAP schema discovery if no schema is configured. + +* Wed Aug 22 2007 Ian Kent - 5.0.2-13 +- fix "nosymlink" option handling and add desription to man page. + +* Tue Aug 21 2007 Ian Kent - 5.0.2-12 +- change random multiple server selection option name to be consistent + with upstream naming. + +* Tue Aug 21 2007 Ian Kent - 5.0.2-11 +- don't fail on empty master map. +- add support for the "%" hack for case insensitive attribute schemas. + +* Mon Jul 30 2007 Ian Kent - 5.0.2-10 +- mark map instances stale so they aren't "cleaned" during updates. +- fix large file compile time option. + +* Fri Jul 27 2007 Ian Kent - 5.0.2-9 +- fix version passed to get_supported_ver_and_cost (bz 249574). + +* Tue Jul 24 2007 Ian Kent - 5.0.2-8 +- fix parse confusion between attribute and attribute value. + +* Fri Jul 20 2007 Ian Kent - 5.0.2-7 +- fix handling of quoted slash alone (bz 248943). + +* Wed Jul 18 2007 Ian Kent - 5.0.2-6 +- fix wait time resolution in alarm and state queue handlers (bz 247711). + +* Mon Jul 16 2007 Ian Kent - 5.0.2-5 +- fix mount point directory creation for bind mounts. +- add quoting for exports gathered by hosts map. + +* Mon Jun 25 2007 Ian Kent - 5.0.2-4 +- update multi map nsswitch patch. + +* Mon Jun 25 2007 Ian Kent - 5.0.2-3 +- add missing "multi" map support. +- add multi map nsswitch lookup. + +* Wed Jun 20 2007 Ian Kent - 5.0.2-2 +- include krb5.h in lookup_ldap.h (some openssl doesn't implicitly include it). +- correct initialization of local var in parse_server_string. + +* Mon Jun 18 2007 Ian Kent - 5.0.2-1 +- Update to upstream release 5.0.2. + +* Tue Jun 12 2007 Ian Kent - 5.0.1-16 +- add ldaps support. + - note: it's no longer possible to have multiple hosts in an ldap map spec. + - note: to do this you need to rely on the ldap client config. + +* Thu Jun 7 2007 Ian Kent - 5.0.1-14 +- fix deadlock in alarm manager module. + +* Sun Jun 3 2007 Ian Kent - 5.0.1-12 +- correct mistake in logic test in wildcard lookup. + +* Mon May 7 2007 Ian Kent - 5.0.1-10 +- fix master map lexer to admit "." in macro values. + +* Tue Apr 17 2007 Ian Kent - 5.0.1-9 +- upstream fix for filesystem is local check. +- disable exports access control check (bz 203277). +- fix patch to add command option for set a global mount options (bz 214684). + +* Mon Apr 16 2007 Ian Kent - 5.0.1-8 +- add configuration variable to control appending of global options (bz 214684). +- add command option to set a global mount options string (bz 214684). + +* Tue Apr 3 2007 Ian Kent - 5.0.1-7 +- fix "null" domain netgroup match for "-hosts" map. + +* Thu Mar 29 2007 Ian Kent - 5.0.1-6 +- fix directory creation for browse mounts. +- fix wildcard map handling and improve nsswitch source map update. + +* Fri Mar 16 2007 Ian Kent - 5.0.1-5 +- drop "DEFAULT_" prefix from configuration names. +- add option to select replicated server at random (instead of + ping response time) (bz 227604). +- fix incorrect cast in directory cleanup routines (bz 231864). + +* Thu Mar 8 2007 Ian Kent - 5.0.1-4 +- fixed numeric export match (bz 231188). + +* Thu Mar 1 2007 Ian Kent - 5.0.1-3 +- change file map lexer to allow white-space only blank lines (bz 229434). + +* Fri Feb 23 2007 Ian Kent - 5.0.1-2 +- update "@network" matching patch. + +* Thu Feb 22 2007 Ian Kent - 5.0.1-1 +- update to release tar. +- fix return check for getpwuid_r and getgrgid_r. +- patch to give up trying to update exports list while host is mounted. +- fix to "@network" matching. +- patch to check for fstab update and retry if not updated. + +* Tue Feb 20 2007 Ian Kent - 5.0.1-0.rc3.24 +- add "condrestart" to init script (bz 228860). +- add "@network" and .domain.name export check. +- fix display map name in mount entry for "-hosts" map. + +* Fri Feb 16 2007 Ian Kent - 5.0.1-0.rc3.22 +- fix localhost replicated mounts not working (bz 208757). + +* Wed Feb 14 2007 Ian Kent - 5.0.1-0.rc3.20 +- correct return status from do_mkdir (bz 223480). + +* Sat Feb 10 2007 Ian Kent - 5.0.1-0.rc3.18 +- update the "task done race" patch to fix a deadlock. +- added URL tag. +- removed obsoletes autofs-ldap. +- replaced init directory paths with %%{_initrddir} macro. + +* Fri Feb 9 2007 Ian Kent - 5.0.1-0.rc3.17 +- make use of spaces and tabs in spec file consistent. +- escape embedded macro text in %%changelog. +- eliminate redundant %%version and %%release. +- remove redundant conditional check from %%clean. +- remove redundant exit from %%preun. +- correct %%defattr spec. +- remove empty %%doc and redundant %%dir misc lines. +- combine program module spec lines into simpler one line form. + +* Tue Feb 6 2007 Ian Kent - 5.0.1-0.rc3.15 +- fix race when setting task done (bz 227268). + +* Mon Jan 29 2007 Ian Kent - 5.0.1-0.rc3.13 +- make double quote handing consistent (at least as much as we can). +- fix handling of trailing white space in wildcard lookup (forward port bz 199720). +- check fqdn of each interface when matching export access list (bz 213700). + +* Thu Jan 18 2007 Ian Kent - 5.0.1-0.rc3.11 +- correct check for busy offset mounts before offset umount (bz 222872). + +* Wed Jan 17 2007 Ian Kent - 5.0.1-0.rc3.9 +- fix another expire regression introduced in the "mitigate manual umount" + patch (bz 222872). + +* Mon Jan 15 2007 Ian Kent - 5.0.1-0.rc3.7 +- ignore "winbind" if it appears in "automount" nsswitch.conf (bz 214632). + +* Wed Jan 10 2007 Ian Kent - 5.0.1-0.rc3.5 +- remove fullstop from Summary tag. +- change Buildroot to recommended form. +- replace Prereq with Requires. + +* Tue Jan 9 2007 Ian Kent - 5.0.1-0.rc3.3 +- remove redundant rpath link option (prep for move to Extras). + +* Tue Jan 9 2007 Ian Kent - 5.0.1-0.rc3.1 +- consolidate to rc3. +- fix typo in Fix typo in var when removing temp directory (bz 221847). + +* Wed Dec 27 2006 Ian Kent - 5.0.1-0.rc2.41 +- fix nonstrict multi-mount handling (bz 219383). +- correct detection of duplicate indirect mount entries (bz 220799). + +* Thu Dec 14 2006 Ian Kent - 5.0.1-0.rc2.38 +- update master map tokenizer to admit "slasify-colons" option. +- update location validation to accept "_" (bz 219445). +- set close-on-exec flag on open sockets (bz 215757). + +* Mon Dec 11 2006 Ian Kent - 5.0.1-0.rc2.35 +- update "replace-tempnam" patch to create temp files in sane location. + +* Mon Dec 11 2006 Ian Kent - 5.0.1-0.rc2.34 +- change mount "device" from "automount" to the map name. +- check for buffer overflow in mount_afs.c. +- replace tempnam with mkdtemp. + +* Sun Dec 10 2006 Ian Kent - 5.0.1-0.rc2.33 +- expand export access checks to include missing syntax options. +- make "-hosts" module try to be sensitive to exports list changes. + +* Thu Dec 7 2006 Ian Kent - 5.0.1-0.rc2.32 +- remove ability to use multiple indirect mount entries in master + map (bz 218616). + +* Wed Dec 6 2006 Ian Kent - 5.0.1-0.rc2.29 +- alter nfs4 host probing to not use portmap lookup and add options + check for "port=" parameter (bz 208757). +- correct semantics of "-null" map handling (bzs 214800, 208091). + +* Sat Nov 25 2006 Ian Kent - 5.0.1-0.rc2.26 +- fix parsing of bad mount mount point in master map (bz 215620). +- fix use after free memory access in cache.c and lookup_yp.c (bz 208091). +- eliminate use of pthread_kill to detect task completion (bz 208091). + +* Sun Nov 12 2006 Ian Kent - 5.0.1-0.rc2.23 +- fix tokenizer to distinguish between global option and dn string (bz 214684). +- fix incorrect return from spawn. + +* Wed Nov 8 2006 Ian Kent - 5.0.1-0.rc2.21 +- mitigate manual umount of automounts where possible. +- fix multiply recursive bind mounts. +- check kernel module version and require 5.00 or above. +- fix expire regression introduced in the "mitigate manual umount" patch. +- still more on multiply recursive bind mounts. + +* Mon Oct 30 2006 Ian Kent - 5.0.1-0.rc2.20 +- Update patch for changed semantics of mkdir in recent kernels. +- fix macro table locking (bz 208091). +- fix nsswitch parser locking (bz 208091). +- allow only one master map read task at a time. +- fix misc memory leaks. + +* Wed Oct 25 2006 Ian Kent - 5.0.1-0.rc2.19 +- deal with changed semantics of mkdir in recent kernels. + +* Fri Oct 20 2006 Ian Kent - 5.0.1-0.rc2.16 +- fix get_query_dn not looking in subtree for LDAP search (missed + econd occurance). +- allow additional common LDAP attributes in map dn. +- Resolves: rhbz#205997 + +* Mon Oct 16 2006 Ian Kent - 5.0.1-0.rc2.13 +- fix parsing of numeric host names in LDAP map specs (bz 205997). + +* Mon Oct 16 2006 Ian Kent - 5.0.1-0.rc2.12 +- fix "-fstype=nfs4" server probing (part 2 of bz 208757). +- set close-on-exec flag on open files where possible (bz 207678). + +* Fri Oct 13 2006 Ian Kent - 5.0.1-0.rc2.11 +- fix file handle leak in nsswitch parser (bz 207678). +- fix memory leak in mount and expire request processing (bz 207678). +- add additional check to prevent running of cancelled tasks. +- fix potential file handle leakage in rpc_subs.c for some failure + cases (bz 207678). +- fix file handle leak in included map lookup (bz 207678). + +* Sat Oct 7 2006 Ian Kent - 5.0.1-0.rc2.10 +- fix get_query_dn not looking in subtree for LDAP search. +- allow syntax "--timeout " for backward compatibility + (bz 193948). +- make masked_match independent of hostname for exports comparison + (bz 209638). + +* Thu Oct 5 2006 Ian Kent - 5.0.1-0.rc2.9 +- fix "-fstype=nfs4" handling (bz 208757). + +* Wed Sep 27 2006 Ian Kent - 5.0.1-0.rc2.8 +- review and fix master map options update for map reload. + +* Wed Sep 27 2006 Ian Kent - 5.0.1-0.rc2.7 +- make default installed master map for /net use "-hosts" instead + of auto.net. +- fix included map recursive map key lookup. + +* Mon Sep 25 2006 Ian Kent - 5.0.1-0.rc2.6 +- remove unused option UNDERSCORETODOT from default config files. + +* Mon Sep 25 2006 Ian Kent - 5.0.1-0.rc2.5 +- fix LDAP lookup delete cache entry only if entry doesn't exist. +- add missing socket close in replicated host check (Jeff Moyer). + +* Wed Sep 20 2006 Ian Kent - 5.0.1-0.rc2.4 +- fix cache entrys not being cleaned up on submount expire. + +* Sun Sep 17 2006 Ian Kent - 5.0.1-0.rc2.3 +- fix include check full patch for file map of same name. + +* Wed Sep 13 2006 Ian Kent - 5.0.1-0.rc2.2 +- fix handling of autofs specific mount options (bz 199777). + +* Fri Sep 1 2006 Ian Kent - 5.0.1-0.rc2.1 +- consolidate to rc2. +- fix colon escape handling. +- fix recusively referenced bind automounts. +- update kernel patches. + +* Fri Aug 25 2006 Ian Kent - 5.0.1-0.rc1.17 +- fix task cancelation at shutdown (more) +- fix concurrent mount and expire race with nested submounts. + +* Sun Aug 20 2006 Ian Kent - 5.0.1-0.rc1.16 +- fix included map lookup. +- fix directory cleanup on expire. +- fix task cancelation at shutdown. +- fix included map wild card key lookup. + +* Wed Aug 16 2006 Ian Kent - 5.0.1-0.rc1.15 +- expire individual submounts. +- add ino_index locking. +- fix nested submount expiring away when pwd is base of submount. +- more expire re-work to cope better with shutdown following cthon tests. +- allow hostname to start with numeric when validating. + +* Mon Aug 7 2006 Ian Kent - 5.0.1-0.rc1.14 +- remove SIGCHLD handler because it is no longer needed and was + causing expire problems. +- alter expire locking of multi-mounts to lock sub-tree instead of + entire tree. +- review verbose message feedback and update. +- correction for expire of multi-mounts. +- spelling corrections to release notes (Jeff Moyer). +- add back sloppy mount option, removed for Connectathon testing. +- disable mtab locking again. + +* Fri Aug 4 2006 Ian Kent - 5.0.1-0.rc1.13 +- tidy up directory cleanup and add validation check to rmdir_path. + +* Fri Aug 4 2006 Ian Kent - 5.0.1-0.rc1.12 +- enable mtab locking until I can resolve the race with it. + +* Fri Aug 4 2006 Ian Kent - 5.0.1-0.rc1.11 +- cthon fix expire of wildcard and program mounts broken by recent + patches. + +* Thu Aug 3 2006 Ian Kent - 5.0.1-0.rc1.10 +- cthon corrections for shutdown patch below and fix shutdown expire. + +* Wed Aug 2 2006 Ian Kent - 5.0.1-0.rc1.9 +- cthon fix some shutdown races. + +* Thu Jul 27 2006 Ian Kent - 5.0.1-0.rc1.8 +- Fix compile error. + +* Thu Jul 27 2006 Ian Kent - 5.0.1-0.rc1.7 +- cthon fix expire of various forms of nested mounts. + +* Mon Jul 24 2006 Ian Kent - 5.0.1-0.rc1.6 +- cthon more parser corrections and attempt to fix multi-mounts + with various combinations of submounts (still not right). + +* Wed Jul 19 2006 Ian Kent - 5.0.1-0.rc1.5 +- Add conflicts kernel < 2.6.17. +- Fix submount operation broken by connectathon updates. + +* Wed Jul 19 2006 Ian Kent - 5.0.1-0.rc1.4 +- Correction to host name validation test for connectathon tests. + +* Wed Jul 19 2006 Ian Kent - 5.0.1-0.rc1.3 +- More code cleanup and corrections for connectathon tests. + +* Wed Jul 19 2006 Ian Kent - 5.0.1-0.rc1.2 +- Code cleanup and fixes for connectathon tests. + +* Thu Jul 13 2006 Ian Kent - 5.0.1-0.rc1.1 +- Update version label to avoid package update problems. + +* Thu Jul 13 2006 Ian Kent - 5.0.0_beta6-8 +- add cacheing of negative lookups to reduce unneeded map + lookups (bz 197746 part 2). + +* Wed Jul 12 2006 Jesse Keating - 1:5.0.0_beta6-7.1 +- rebuild + +* Tue Jul 11 2006 Ian Kent - 5.0.0_beta6-7 +- correct directory cleanup in mount modules. +- merge key and wildcard LDAP query for lookups (bz 197746). + +* Sat Jul 8 2006 Ian Kent - 5.0.0_beta6-6 +- correct test for libhesiod. + +* Fri Jul 7 2006 Ian Kent - 5.0.0_beta6-5 +- correct auto.net installed as auto.smb. +- update LDAP auth - add autodectect option. + +* Wed Jul 5 2006 Ian Kent - 5.0.0_beta6-4 +- correct shutdown log message print. +- correct auth init test when no credentials required. + +* Tue Jul 4 2006 Ian Kent - 5.0.0_beta6-3 +- correct test for existence of auth config file. + +* Mon Jul 3 2006 Ian Kent - 5.0.0_beta6-2 +- merge LDAP authentication update for GSSAPI (Jeff Moyer). +- update default auth config to add options documenetation (Jeff Moyer). +- workaround segfaults at exit after using GSSAPI library. +- fix not checking return in init_ldap_connection (jeff Moyer). + +* Thu Jun 29 2006 Ian Kent - 5.0.0_beta6-1 +- consolidate to beta6, including: + - mode change update for config file. + - correction to get_query_dn fix from beta5-4. + +* Wed Jun 28 2006 Ian Kent - 5.0.0_beta5-6 +- cleanup defaults_read_config (Jeff Moyer). + +* Tue Jun 27 2006 Ian Kent - 5.0.0_beta5-5 +- allow global macro defines to override system macros. +- correct spelling error in default config files missed by + previous update. +- misc correctness and a memory leak fix. + +* Mon Jun 26 2006 Ian Kent - 5.0.0_beta5-4 +- correct spelling error in default config. +- fix default auth config not being installed. +- change LDAP query method as my test db was incorrect. +- change ldap defaults code to handle missing auth config. +- fix mistake in parsing old style LDAP specs. +- update LDAP so that new query method also works for old syntax. + +* Fri Jun 23 2006 Ian Kent - 5.0.0_beta5-3 +- lookup_init cleanup and fix missed memory leak. +- use nis map order to check if update is needed. +- fix couple of memory leaks in lookup_yp.c. +- fix pasre error in replicated server module. + +* Wed Jun 21 2006 Ian Kent - 5.0.0_beta5-2 +- Add openssl-devel to the BuildRequires, as it is needed for the LDAP + authentication bitsi also. + +* Tue Jun 20 2006 Ian Kent - 5.0.0_beta5-1 +- promote to beta5. + +* Tue Jun 20 2006 Ian Kent - 5.0.0_beta4-14 +- fix directory cleanup at exit. + +* Mon Jun 19 2006 Ian Kent - 5.0.0_beta4-13 +- Change LDAP message severity from crit to degug (bz# 183893). +- Corrections to INSTALL and README.v5.release. +- Add patch to fix segv on overlength map keys in file maps (Jeff Moter). +- Add patch to restrict scanning of /proc to pid directories only (Jeff Moyer). + +* Thu Jun 15 2006 Jeff Moyer - 5.0.0_beta4-12 +- Change BuildPrereq to BuildRequires as per the package guidelines. +- Add libxml2-devel to the BuildRequires, as it is needed for the LDAP + authentication bits. + +* Wed Jun 14 2006 Ian Kent - 5.0.0_beta4-11 +- add export access list matching to "hosts" lookup module (bz # 193585). + +* Tue Jun 13 2006 Jeff Moyer - 5.0.0_beta4-10 +- Add a BuildPrereq for cyrus-sasl-devel + +* Tue Jun 13 2006 Ian Kent - 5.0.0_beta4-9 +- move autofs4 module loading back to init script (part bz # 194061). + +* Mon Jun 12 2006 Ian Kent - 5.0.0_beta4-8 +- fix handling of master map entry update (bz # 193718). +- fix program map handling of invalid multi-mount offsets. + +* Sat Jun 10 2006 Ian Kent - 5.0.0_beta4-7 +- fix context init error (introduced by memory leak patch). + +* Fri Jun 9 2006 Ian Kent - 5.0.0_beta4-6 +- add free for working var in get_default_logging. +- add inialisation for kver in autofs_point struct. +- fix sources list corruption in check_update_map_sources. +- fix memory leak in walk_tree. +- fix memory leak in rpc_portmap_getport and rpc_ping_proto. +- fix memory leak in initialisation of lookup modules. + +* Thu Jun 8 2006 Ian Kent - 5.0.0_beta4-5 +- misc fixes for things found while investigating map re-read problem. + +* Wed Jun 7 2006 Ian Kent - 5.0.0_beta4-4 +- check base of offset mount tree is not a mount before umounting + its offsets. +- fix replicated mount parse for case where last name in list + fails lookup. +- correct indirect mount expire broken by the wildcard lookup fix. +- fix up multi-mount handling when wildcard map entry present. + +* Mon Jun 5 2006 Ian Kent - 5.0.0_beta4-3 +- correct config names in default.c (jpro@bas.ac.uk). + +* Mon Jun 5 2006 Ian Kent - 5.0.0_beta4-2 +- re-instate v4 directory cleanup (bz# 193832 again). +- backout master map lookup changes made to beta3. +- change default master map from /etc/auto.master to auto.master + so that we always use nsswitch to locate master map. +- change default installed master map to include "+auto.master" + to pickup NIS master map (all bz# 193831 again). + +* Fri Jun 2 2006 Ian Kent - 5.0.0_beta4-1 +- update to beta4. +- should address at least bzs 193798, 193770, 193831 and + possibly 193832. + +* Mon May 29 2006 Ian Kent - 5.0.0_beta3-6 +- add back test for nested mount in program map lookup. + - I must have commented this out for a reason. I guess we'll + find out soon enough. + +* Mon May 29 2006 Ian Kent - 5.0.0_beta3-5 +- fix handling of autofs filesystem mount fail on init. + +* Sat May 27 2006 Ian Kent - 5.0.0_beta3-4 +- updated hesiod patch. + +* Sat May 27 2006 Ian Kent - 5.0.0_beta3-3 +- update hesiod module (Jeff Moyer). + - add mutex to protect against overlapping mount requests. + - update return from mount request to give more sensible NSS_* + values. + +* Fri May 26 2006 Jeff Moyer - 1:5.0.0_beta3-2 +- Fix the install permissions for auto.master and auto.misc. + +* Thu May 25 2006 Ian Kent - 5.0.0_beta3-1 +- update source to version 5.0.0_beta3. +- add patch to remove extra debug print. +- add patch to + - fix memory alloc error in nis lookup module. + - add "_" to "." mapname translation to nis lookup module. +- add patch to add owner pid to mount list struct. +- add patch to disable NFSv4 when probing hosts (at least foe now). +- add patch to fix white space handling in replicated server selection code. +- add patch to prevent striping of debug info macro patch (Jeff Moyer). +- add patch to add sanity checks on rmdir_path and unlink (Jeff Moyer). +- add patch to fix e2fsck error code check (Jeff Moyer). + +* Tue May 16 2006 Ian Kent - 1:4.1.4-23 +- add patch to ignore the "bg" and "fg" mount options as they + aren't relevant for autofs mounts (bz #184386). + +* Tue May 2 2006 Ian Kent - 1:4.1.4-20 +- add patch to use "cifs" instead of smbfs and escape speces + in share names (bz #163999, #187732). + +* Tue Apr 11 2006 Ian Kent - 1:4.1.4-18 +- Add patch to allow customization of arguments to the + autofs-ldap-auto-master program (bz #187525). +- Add patch to escap "#" characters in exports from auto.net + program mount (bz#178304). + +* Fri Feb 10 2006 Jesse Keating - 1:4.1.4-16.2.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1:4.1.4-16.2.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Wed Feb 1 2006 Ian Kent - 1:4.1.4-16.2 +- Add more general patch to translate "_" to "." in map names. (bz #147765) + +* Wed Jan 25 2006 Ian Kent - 1:4.1.4-16.1 +- Add patch to use LDAP_DEPRICATED compile option. (bz #173833) + +* Tue Jan 17 2006 Ian Kent - 1:4.1.4-16 +- Replace check-is-multi with more general multi-parse-fix. +- Add fix for premature return when waiting for lock file. +- Update copyright declaration for reentrant-syslog source. +- Add patch for configure option to disable locking during mount. + But don't disable locking by default. +- Add ability to handle automount schema used in Sun directory server. +- Quell compiler warning about getsockopt parameter. +- Quell compiler warning about yp_order parameter. + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Nov 17 2005 Jeff Moyer - 1:4.1.4-14 +- Removed the /misc entry from the default auto.master. auto.misc has + an entry for the cdrom device, and the preferred method of mounting the + cd is via udev/hal. + +* Mon Nov 7 2005 Jeff Moyer - 1:4.1.4-13 +- Changed to sort -k 1, since that should be the same as +0. + +* Thu Nov 3 2005 Jeff Moyer - 1:4.1.4-12 +- The sort command no longer accepts options of the form "+0". This broke + auto.net, so the option was removed. Fixes bz #172111. + +* Wed Oct 26 2005 - 1:4.1.4-11 +- Check the return code of is_local_addr in get_best_mount. (bz #169523) + +* Wed Oct 26 2005 - 1:4.1.4-10 +- Fix some bugs in the parser +- allow -net instead of /etc/auto.net +- Fix a buffer overflow with large key lengths +- Don't allow autofs to unlink files, only to remove directories +- change to the upstream reentrant syslog patch from the band-aid deferred + syslog patch. +- Get rid of the init script patch that hard-coded the release to redhat. + This should be handled properly by all red hat distros. + +* Wed May 4 2005 Jeff Moyer - 1:4.1.4-8 +- Add in the deferred syslog patch. This fixes a hung automounter issue + related to unsafe calls to syslog in signal handler context. + +* Tue May 3 2005 Jeff Moyer - 1:4.1.4-7 +- I reversed the checking for multimount entries, breaking those configs! + This update puts the code back the way it was before I broke it. + +* Tue Apr 26 2005 Jeff Moyer - 1:4.1.4-6 +- Fix a race between mounting a share and updating the cache in the parent + process. If the mount completed first, the parent would not expire the + stale entry, leaving it first on the list. This causes map updates to not + be recognized (well, worse, they are recognized after the first expire, but + not subsequent ones). Fixes a regression, bug #137026 (rhel3 bug). + +* Fri Apr 15 2005 Chris Feist - 1:4.1.4-5 +- Fixed regression with -browse not taking effect. + +* Wed Apr 13 2005 Jeff Moyer - 1:4.1.4-4 +- Finish up with the merge breakage. +- Temporary fix for the multimount detection code. It seems half-baked. + +* Wed Apr 13 2005 Jeff Moyer - 1:4.1.4-3 +- Fix up the one-auto-master patch. My "improvements" had side-effects. + +* Wed Apr 13 2005 Jeff Moyer - 1:4.1.4-2 +- Import 4.1.4 and merge. + +* Mon Apr 4 2005 Jeff Moyer - 1:4.1.3-123 +- Add in an error case that was omitted in the multi-over patch. +- Update our auto.net to reflect the changes that went into 4.1.4_beta2. + This fixes a problem seen by at least one customer where a malformed entry + appeared first in the multimount list, thus causing the entire multimount + to be ignored. This new auto.net places that entry at the end, purely by + luck, but it fixes the problem in this one case. + +* Thu Mar 31 2005 Jeff Moyer - 1:4.1.3-119 +- Merge in the multi-over patch. This resolves an issue whereby multimounts + (such as those used for /net) could be processed in the wrong order, + resulting in directories not showing up in a multimount tree. The fix + is to process these directories in order, shortest to longer path. + +* Wed Mar 23 2005 Chris Feist - 1:4.1.3-115 +- Fixed regression causing any entries after a wildcard in an + indirect map to be ignored. (bz #151668). +- Fixed regression which caused local hosts to be mount instead + of --bind local directories. (bz #146887) + +* Thu Mar 17 2005 Chris Feist - 1:4.1.3-111 +- Fixed one off bug in the submount-variable-propagation patch. + (bz #143074) +- Fixed a bug in the init script which wouldn't find the -browse + option if it was preceded by another option. (fz #113494) + +* Mon Feb 28 2005 Chris Feist - 1:4.1.3-100 +- When using ldap if auto.master doesn't exist we now check for auto_master. + Addresses bz #130079 +- When using an auto.smb map we now remove the leading ':' from the path which + caused mount to fail in the past. Addresses bz #147492 +- Autofs now checks /etc/nsswitch.conf to determine in what order files & nis + are checked when looking up autofs submount maps which don't specify a + maptype. Addresses IT #57612. + +* Mon Feb 14 2005 Jeff Moyer - 1:4.1.3-99 +- Change Copyright to License in the spec file so it will build. + +* Fri Feb 11 2005 Jeff Moyer - 1:4.1.3-98 +- Program maps can repeat the last character of output. Fix this. + Addresses bz #138606 +- Return first entry when there are duplicate keys in a map. Addresses + bz #140108. +- Propagate custom map variables to submounts. Fixes bz #143074. +- Create a sysconfig variable to control whether we source only one master + map (the way sun does), or source all maps found (which is the default for + backwards compatibility). Addresses bz #143126. +- Revised version of the get_best_mount patch. (#146887) cfeist@redhat.com + The previous patch introduced a regression. Non-replicated mounts would + not have the white space stripped from the entry and the mount would fail. +- Handle comment characters in the middle of the automount line in + /etc/nsswitch.conf. Addresses bz #127457. + +* Wed Feb 2 2005 Chris Feist - 1:4.1.3-94 +- Stop automount from pinging hosts if there is only one host (#146887) + +* Wed Feb 2 2005 Jeff Moyer - 1:4.1.3-90 +- Fix potential double free in cache_release. This bug showed up in a + multi-map setup. Two calls to cache_release would result in a SIGSEGV, + and the automount process would never exit. + +* Mon Jan 24 2005 Chris Feist - 1:4.3-82 +- Fixed documentation so users know that any local mounts override + any other weighted mount. + +* Mon Jan 24 2005 Chris Feist - 1:4.3-80 +- Added a variable to determine if we created the directory or not + so we don't accidently remove a directory that we didn't create when + we stop autofs. (bz #134399) + +* Tue Jan 11 2005 Jeff Moyer - 1:4.1.3-76 +- Fix the large program map patch. + +* Tue Jan 11 2005 Jeff Moyer - 1:4.1.3-75 +- Fix some merging breakages that caused the package not to build. + +* Thu Jan 6 2005 - 1:4.1.3-74 +- Add in the map expiry patch +- Bring in other patches that have been committed to other branches. This + version should now contain all fixes we have to date +- Merge conflicts due to map expiry changes + +* Fri Nov 19 2004 Jeff Moyer - 1:4.1.3-57 +- Pass a socket into clntudp_bufcreate so that we don't use up additional + reserved ports. This patch, along with the socket leak fix, addresses + bz #128966. + +* Wed Nov 17 2004 - 1:4.1.3-56 +- Somehow the -browse patch either didn't get committed or got reverted. + Fixed. + +* Tue Nov 16 2004 Jeff Moyer - 1:4.1.3-55 +- Fix program maps so that they can have gt 4k characters. (Neil Horman) + Addresses bz #138994. +- Add a space after the colon here "Starting automounter:" in init script. + Fixes bz #138513. + +* Mon Nov 15 2004 Jeff Moyer - 1:4.1.3-53 +- Make autofs understand -[no]browse. Addresses fz #113494. + +* Thu Nov 11 2004 Jeff Moyer - 1:4.1.3-48 +- Fix the umount loop device function in the init script. + +* Wed Oct 27 2004 Chris Feist - 1:4.1.3-34 +- Added a patch to fix the automounter failing on ldap maps + when it couldn't get the whole map. (ie. when the search + limit was lower than the number of results) + +* Thu Oct 21 2004 Chris Feist - 1:4.1.3-32 +- Fixed the use of +ypmapname so the maps included with +ypmapname + are used in the correct order. (In the past the '+' entries + were always processed after local entries.) + +* Thu Oct 21 2004 Chris Feist - 1:4.1.3-31 +- Fixed the duplicate map detection code to detect if maps try + to mount on top of existing maps. + +* Wed Oct 20 2004 Chris Feist - 1:4.1.3-29 +- Fixed a problem with backwards compatability. Specifying local + maps without '/etc/' prepended to them now works. (bz #136038) + +* Fri Oct 15 2004 Chris Feist - 1:4.1.3-28 +- Fixed a bug which caused directories to never be unmounted. (bz #134403) + +* Thu Oct 14 2004 Chris Feist - 1:4.1.3-27 +- Fixed an error in the init script which caused duplicate entries to be + displayed when asking for autofs status. + +* Fri Oct 1 2004 Jeff Moyer - 1:4.1.3-22 +- Comment out map expiry (and related) patch for an FC3 build. + +* Thu Sep 23 2004 Jeff Moyer - 1:4.1.3-21 +- Make local options apply to all maps in a multi-map entry. + +* Tue Sep 21 2004 Jeff Moyer - 1:4.1.3-20 +- Merged my and Ian's socket leak fixes into one, smaller patch. Only + partially addresses bz #128966. +- Fix some more echo lines for internationalization. bz #77820 +- Revert the only one auto.master patch until we implement the +auto_master + syntax. Temporarily addresses bz #133055. + +* Thu Sep 2 2004 Jeff Moyer - 1:4.1.3-18 +- Umount loopback filesystems under automount points when stopping the + automounter. +- Uncomment the map expiry patch. +- change a close to an fclose in lookup_file.c + +* Tue Aug 31 2004 Jeff Moyer - 1:4.1.3-17 +- Add patch to support parsing nsswitch.conf to determine map sources. +- Disable this patch, and Ian's map expiry patch for a FC build. + +* Tue Aug 24 2004 Jeff Moyer - 1:4.1.3-16 +- Version 3 of Ian's map expiry changes. + +* Wed Aug 18 2004 Jeff Moyer - 1:4.1.3-15 +- Fix a socket leak in the rpc_subs, causing mounts to fail since we are + running out of port space fairly quickly. + +* Wed Aug 18 2004 Jeff Moyer - 1:4.1.3-14 +- New map expiry patch from Ian. +- Fix a couple signal races. No known problem reports of these, but they + are holes, none-the-less. + +* Tue Aug 10 2004 Jeff Moyer - 1:4.1.3-13 +- Only read one auto.master map (instead of concatenating all found sources). +- Uncomment Ian's experimental mount expiry patch. + +* Fri Aug 6 2004 Jeff Moyer - 1:4.1.3-12 +- Add a sysconfig entry to disable direct map support, and set this to + 1 by default. +- Disable the beta map expiry logic so I can build into a stable distro. +- Add defaults for all of the sysconfig variables to the init script so + we don't trip over user errors (i.e. deleting /etc/sysconfig/autofs). + +* Wed Aug 4 2004 Jeff Moyer - 1:4.1.3-11 +- Add beta map expiry code for wider testing. (Ian Kent) +- Fix check for ghosting option. I forgot to check for it in DAEMONOPTIONS. +- Remove STRIPDASH from /etc/sysconfig/autofs + +* Mon Jul 12 2004 Jeff Moyer - 1:4.1.3-10 +- Add bad chdir patch from Ian Kent. +- Add a typo fix for the mtab lock file. +- Nuke the stripdash patch. It didn't solve a problem. + +* Tue Jun 22 2004 Jeff Moyer - 1:4.1.3-9 +- Bump revison for inclusion in RHEL 3. + +* Mon Jun 21 2004 Jeff Moyer - 1:4.1.3-8 +- Change icmp ping to an rpc ping. (Ian Kent) +- Fix i18n patch + o Remove the extra \" from one echo line. + o Use echo -e if we are going to do a \n in the echo string. + +* Mon Jun 21 2004 Alan Cox +- Fixed i18n bug #107463 + +* Mon Jun 21 2004 Alan Cox +- Fixed i18n bug #107461 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Sat Jun 5 2004 Jeff Moyer - 1:4.1.3-4 +- Perform an icmp ping request before rpc_pings, since the rpc clnt_create + function has a builtin default timeout of 60 seconds. This could result + in a long delay when a server in a replicated mount setup is down. +- For non-replicated server entries, ping a host before attempting to mount. + (Ian Kent) +- Change to %%configure. +- Put version-release into .version to allow for automount --version to + print exact info. +- Nuke my get-best-mount patch which always uses the long timeout. This + should no longer be needed. +- Put name into changelog entries to make them consistent. Add e:n-v-r + into Florian's entry. +- Stop autofs before uninstalling + +* Sat Jun 05 2004 Florian La Roche - 1:4.1.3-3 +- add a preun script to remove autofs + +* Tue Jun 1 2004 Jeff Moyer - 1:4.1.3-2 +- Incorporate patch from Ian which fixes an infinite loop seen by those + running older versions of the kernel patches (triggered by non-strict mounts + being the default). + +* Tue Jun 1 2004 Jeff Moyer - 1:4.1.3-1 +- Update to upstream 4.1.3. + +* Thu May 6 2004 Jeff Moyer - 1:4.1.2-6 +- The lookup_yp module only dealt with YPERR_KEY, all other errors were + treated as success. As a result, if the ypdomain was not bound, the + subprocess that starts mounts would SIGSEGV. This is now fixed. +- Option parsing in the init script was not precise enough, sometimes matching + filesystem options to one of --ghost, --timeout, --verbose, or --debug. + The option-parsing patch addresses this issue by making the regexp's much + more precise. +- Ian has rolled a third version of the replicated mount fixes. + +* Tue May 4 2004 Jeff Moyer - 1:4.1.2-5 +- Ian has a new fix for replicated server and multi-mounts. Updated the + patch for testing. Still beta. (Ian Kent) + +* Mon May 3 2004 Jeff Moyer - 1:4.1.2-4 +- Fix broken multi-mounts. test patch. (Ian Kent) + +* Tue Apr 20 2004 Jeff Moyer - 1:4.1.2-3 +- Fix a call to spawnl which forgot to specify a lock file. (nphilipp) + +* Wed Apr 14 2004 - 1:4.1.2-2 +- Pass --libdir= to ./configure so we get this right on 64 bit platforms that + support backwards compat. + +* Wed Apr 14 2004 Jeff Moyer - 1:4.1.2-1 +- Change hard-coded paths in the spec file to the %%{_xxx} variety. +- Update to upstream 4.1.2. +- Add a STRIPDASH option to /etc/sysconfig/autofs which allows for + compatibility with the Sun automounter options specification syntax in + auto.master. See /etc/sysconfig/autofs for more information. Addresses + bug 113950. + +* Tue Apr 6 2004 Jeff Moyer - 1:4.1.1-6 +- Add the /etc/sysconfig/autofs file, and supporting infrastructure in + the init script. +- Add support for UNDERSCORE_TO_DOT for those who want it. +- We no longer own /net. Move it to the filesystem package. + +* Tue Mar 30 2004 Jeff Moyer - 1:4.1.1-5 +- Clarify documentation on direct maps. +- Send automount daemons a HUP signal during reload. This tells them to + re-read maps (otherwise they use a cached version. Patch from the autofs + maintainer. + +* Mon Mar 22 2004 Jeff Moyer - 1:4.1.1-4 +- Fix init script to print out failures where appropriate. +- Build the automount daemon as a PIE. + +* Thu Mar 18 2004 Jeff Moyer - 1:4.1.1-3 +- Fix bug in get_best_mount, whereby if there is only one option, we + choose nothing. This is primarily due to the fact that we pass 0 in to + the get_best_mount function for the long timeout parameter. So, we + timeout trying to contact our first and only server, and never retry. + +* Thu Mar 18 2004 Jeff Moyer - 1:4.1.1-2 +- Prevent startup if a mountpoint is already mounted. + +* Thu Mar 18 2004 Jeff Moyer - 1:4.1.1-1 +- Update to 4.1.1, as it fixes problems with wildcards that people are + seeing quite a bit. + +* Wed Mar 17 2004 Jeff Moyer - 1:4.1.0-8 +- Fix ldap init code to parse server name and options correctly. + +* Tue Mar 16 2004 Jeff Moyer - 1:4.1.0-7 +- Moved the freeing of ap.path to cleanup_exit, as we would otherwise + reference an already-freed variable. + +* Mon Mar 15 2004 Jeff Moyer - 1:4.1.0-6 +- add %%config(noreplace) for auto.* config files. + +* Wed Mar 10 2004 Jeff Moyer 1:4.1.0-5 +- make the init script only recognize redhat systems. Nalin seems to remember + some arcane build system error that can be caused if we don't do this. + +* Wed Mar 10 2004 Jeff Moyer 1:4.1.0-4 +- comment out /net and /misc from the default auto.master. /net is important + since in a default shipping install, we can neatly co-exist with amd. + +* Wed Mar 10 2004 Jeff Moyer 1:4.1.0-3 +- Ported forward Red Hat's patches from 3.1.7 that were not already present + in 4.1.0. +- Moving autofs from version 3.1.7 to 4.1.0 + +* Mon Sep 29 2003 Ian Kent +- Added work around for O(1) patch oddity. + +* Sat Aug 16 2003 Ian Kent +- Fixed tree mounts. +- Corrected transciption error in autofs4-2.4.18 kernel module + +* Sun Aug 10 2003 Ian Kent +- Checked and merged most of the RedHat v3 patches +- Fixed kernel module handling wu-ftpd login problem (again) + +* Thu Aug 7 2003 Ian Kent +- Removed ineffective lock stuff +- Added -n to bind mount to prevent mtab update error +- Added retry to autofs umount to clean matb after fail +- Redirected messages from above to debug log and added info message +- Fixed autofs4 module reentrancy, pwd and chroot handling + +* Wed Jul 30 2003 Ian Kent +- Fixed autofs4 ghosting patch for 2.4.19 and above (again) +- Fixed autofs directory removal on failure of autofs mount +- Fixed lock file wait function overlapping calls to (u)mount + +* Sun Jul 27 2003 Ian Kent +- Implemented LDAP direct map handling for nisMap and automountMap schema +- Fixed autofs4 ghosting patch for 2.4.19 and above (again) +- Added locking to fix overlapping internal calls to (u)mount +- Added wait for mtab~ to improve tolerance of overlapping external calls to (u)mount +- Fixed ghosted directory removal after failed mount attempt + +* Wed May 28 2003 Ian Kent +- Cleaned up an restructured my added code +- Corrected ghosting problem with 2.4.19 and above +- Added autofs4 ghosting patch for 2.4.19 and above +- Implemented HUP signal to force update of ghosted maps + +* Sat Mar 23 2002 Ian Kent +- Add patch to implement directory ghosting and direct mounts +- Add patch to for autofs4 module to support ghosting + +* Wed Jan 17 2001 Nalin Dahyabhai +- use -fPIC instead of -fpic for modules and honor other RPM_OPT_FLAGS + +* Tue Feb 29 2000 Nalin Dahyabhai +- enable hesiod support over libbind + +* Fri Aug 13 1999 Cristian Gafton +- add patch from rth to avoid an infinite loop