From 634bf334994c269fa625ef209398638f5e0576e9 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Aug 10 2010 08:51:22 +0000 Subject: * 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. --- diff --git a/autofs-5.0.5-expire-thread-use-pending-mutex.patch b/autofs-5.0.5-expire-thread-use-pending-mutex.patch new file mode 100644 index 0000000..13e6753 --- /dev/null +++ b/autofs-5.0.5-expire-thread-use-pending-mutex.patch @@ -0,0 +1,486 @@ +autofs-5.0.5 - expire thread use pending mutex + +From: Ian Kent + +Some time ago the mount request thread creation was changed to +use its own mutex for its condition handling due to execution +order problems under heavy mount request pressure. When there +are a large number of master map entries we see the same problem +with expire thread creation. This patch changes the expire thread +creation to use the same approach as the mount thread creation. +--- + + CHANGELOG | 1 + daemon/direct.c | 76 +++++++++++----------------------------------------- + daemon/indirect.c | 76 +++++++++++----------------------------------------- + include/automount.h | 41 ++++++++++++++++++++++++++++ + 4 files changed, 76 insertions(+), 118 deletions(-) + + +--- autofs-5.0.5.orig/CHANGELOG ++++ autofs-5.0.5/CHANGELOG +@@ -45,6 +45,7 @@ + - remove state machine timed wait. + - remove extra read master map call. + - fix error handing in do_mount_indirect(). ++- expire thread use pending mutex. + + 03/09/2009 autofs-5.0.5 + ----------------------- +--- autofs-5.0.5.orig/daemon/direct.c ++++ autofs-5.0.5/daemon/direct.c +@@ -35,6 +35,7 @@ + #include + #include + ++#define INCLUDE_PENDING_FUNCTIONS + #include "automount.h" + + /* Attribute to create detached thread */ +@@ -48,8 +49,6 @@ pthread_key_t key_mnt_direct_params; + pthread_key_t key_mnt_offset_params; + pthread_once_t key_mnt_params_once = PTHREAD_ONCE_INIT; + +-static pthread_mutex_t ea_mutex = PTHREAD_MUTEX_INITIALIZER; +- + static void key_mnt_params_destroy(void *arg) + { + struct mnt_params *mp; +@@ -952,17 +951,6 @@ void *expire_proc_direct(void *arg) + return NULL; + } + +-static void pending_cond_destroy(void *arg) +-{ +- struct pending_args *mt; +- int status; +- +- mt = (struct pending_args *) arg; +- status = pthread_cond_destroy(&mt->cond); +- if (status) +- fatal(status); +-} +- + static void expire_send_fail(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -972,19 +960,6 @@ static void expire_send_fail(void *arg) + mt->ioctlfd, mt->wait_queue_token, -ENOENT); + } + +-static void free_pending_args(void *arg) +-{ +- struct pending_args *mt = arg; +- free(mt); +-} +- +-static void expire_mutex_unlock(void *arg) +-{ +- int status = pthread_mutex_unlock(&ea_mutex); +- if (status) +- fatal(status); +-} +- + static void *do_expire_direct(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -995,9 +970,7 @@ static void *do_expire_direct(void *arg) + + args = (struct pending_args *) arg; + +- status = pthread_mutex_lock(&ea_mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(args); + + memcpy(&mt, args, sizeof(struct pending_args)); + +@@ -1008,7 +981,7 @@ static void *do_expire_direct(void *arg) + if (status) + fatal(status); + +- expire_mutex_unlock(NULL); ++ pending_mutex_unlock(args); + + pthread_cleanup_push(expire_send_fail, &mt); + +@@ -1124,7 +1097,7 @@ int handle_packet_expire_direct(struct a + if (status) + fatal(status); + +- status = pthread_mutex_lock(&ea_mutex); ++ status = pthread_mutex_init(&mt->mutex, NULL); + if (status) + fatal(status); + +@@ -1140,6 +1113,8 @@ int handle_packet_expire_direct(struct a + debug(ap->logopt, "token %ld, name %s", + (unsigned long) pkt->wait_queue_token, mt->name); + ++ pending_mutex_lock(mt); ++ + status = pthread_create(&thid, &th_attr_detached, do_expire_direct, mt); + if (status) { + error(ap->logopt, "expire thread create failed"); +@@ -1147,8 +1122,9 @@ int handle_packet_expire_direct(struct a + mt->ioctlfd, pkt->wait_queue_token, -status); + cache_unlock(mc); + master_source_unlock(ap->entry); +- expire_mutex_unlock(NULL); ++ pending_mutex_unlock(mt); + pending_cond_destroy(mt); ++ pending_mutex_destroy(mt); + free_pending_args(mt); + pthread_setcancelstate(state, NULL); + return 1; +@@ -1158,8 +1134,9 @@ int handle_packet_expire_direct(struct a + master_source_unlock(ap->entry); + + pthread_cleanup_push(free_pending_args, mt); ++ pthread_cleanup_push(pending_mutex_destroy, mt); + pthread_cleanup_push(pending_cond_destroy, mt); +- pthread_cleanup_push(expire_mutex_unlock, NULL); ++ pthread_cleanup_push(pending_mutex_unlock, mt); + pthread_setcancelstate(state, NULL); + + mt->signaled = 0; +@@ -1167,7 +1144,7 @@ int handle_packet_expire_direct(struct a + gettimeofday(&now, NULL); + wait.tv_sec = now.tv_sec + 2; + wait.tv_nsec = now.tv_usec * 1000; +- status = pthread_cond_wait(&mt->cond, &ea_mutex); ++ status = pthread_cond_timedwait(&mt->cond, &mt->mutex, &wait); + if (status && status != ETIMEDOUT) + fatal(status); + } +@@ -1175,6 +1152,7 @@ int handle_packet_expire_direct(struct a + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); ++ pthread_cleanup_pop(1); + + return 0; + } +@@ -1188,22 +1166,6 @@ static void mount_send_fail(void *arg) + ops->close(ap->logopt, mt->ioctlfd); + } + +-static void pending_mutex_destroy(void *arg) +-{ +- struct pending_args *mt = (struct pending_args *) arg; +- int status = pthread_mutex_destroy(&mt->mutex); +- if (status) +- fatal(status); +-} +- +-static void mount_mutex_unlock(void *arg) +-{ +- struct pending_args *mt = (struct pending_args *) arg; +- int status = pthread_mutex_unlock(&mt->mutex); +- if (status) +- fatal(status); +-} +- + static void *do_mount_direct(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -1214,9 +1176,7 @@ static void *do_mount_direct(void *arg) + + args = (struct pending_args *) arg; + +- status = pthread_mutex_lock(&args->mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(args); + + memcpy(&mt, args, sizeof(struct pending_args)); + +@@ -1227,7 +1187,7 @@ static void *do_mount_direct(void *arg) + if (status) + fatal(status); + +- mount_mutex_unlock(args); ++ pending_mutex_unlock(args); + + pthread_cleanup_push(mount_send_fail, &mt); + +@@ -1434,9 +1394,7 @@ int handle_packet_missing_direct(struct + if (status) + fatal(status); + +- status = pthread_mutex_lock(&mt->mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(mt); + + mt->ap = ap; + mt->ioctlfd = ioctlfd; +@@ -1458,7 +1416,7 @@ int handle_packet_missing_direct(struct + cache_unlock(mc); + master_source_unlock(ap->entry); + master_mutex_unlock(); +- mount_mutex_unlock(mt); ++ pending_mutex_unlock(mt); + pending_cond_destroy(mt); + pending_mutex_destroy(mt); + free_pending_args(mt); +@@ -1474,7 +1432,7 @@ int handle_packet_missing_direct(struct + pthread_cleanup_push(free_pending_args, mt); + pthread_cleanup_push(pending_mutex_destroy, mt); + pthread_cleanup_push(pending_cond_destroy, mt); +- pthread_cleanup_push(mount_mutex_unlock, mt); ++ pthread_cleanup_push(pending_mutex_unlock, mt); + pthread_setcancelstate(state, NULL); + + mt->signaled = 0; +--- autofs-5.0.5.orig/daemon/indirect.c ++++ autofs-5.0.5/daemon/indirect.c +@@ -34,13 +34,12 @@ + #include + #include + ++#define INCLUDE_PENDING_FUNCTIONS + #include "automount.h" + + /* Attribute to create detached thread */ + extern pthread_attr_t th_attr_detached; + +-static pthread_mutex_t ea_mutex = PTHREAD_MUTEX_INITIALIZER; +- + static int unlink_mount_tree(struct autofs_point *ap, struct mnt_list *mnts) + { + struct mnt_list *this; +@@ -587,17 +586,6 @@ void *expire_proc_indirect(void *arg) + return NULL; + } + +-static void pending_cond_destroy(void *arg) +-{ +- struct pending_args *mt; +- int status; +- +- mt = (struct pending_args *) arg; +- status = pthread_cond_destroy(&mt->cond); +- if (status) +- fatal(status); +-} +- + static void expire_send_fail(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -607,19 +595,6 @@ static void expire_send_fail(void *arg) + ap->ioctlfd, mt->wait_queue_token, -ENOENT); + } + +-static void free_pending_args(void *arg) +-{ +- struct pending_args *mt = arg; +- free(mt); +-} +- +-static void expire_mutex_unlock(void *arg) +-{ +- int status = pthread_mutex_unlock(&ea_mutex); +- if (status) +- fatal(status); +-} +- + static void *do_expire_indirect(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -629,9 +604,7 @@ static void *do_expire_indirect(void *ar + + args = (struct pending_args *) arg; + +- status = pthread_mutex_lock(&ea_mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(args); + + memcpy(&mt, args, sizeof(struct pending_args)); + +@@ -642,7 +615,7 @@ static void *do_expire_indirect(void *ar + if (status) + fatal(status); + +- expire_mutex_unlock(NULL); ++ pending_mutex_unlock(args); + + pthread_cleanup_push(expire_send_fail, &mt); + +@@ -690,7 +663,7 @@ int handle_packet_expire_indirect(struct + if (status) + fatal(status); + +- status = pthread_mutex_lock(&ea_mutex); ++ status = pthread_mutex_init(&mt->mutex, NULL); + if (status) + fatal(status); + +@@ -700,21 +673,25 @@ int handle_packet_expire_indirect(struct + mt->len = pkt->len; + mt->wait_queue_token = pkt->wait_queue_token; + ++ pending_mutex_lock(mt); ++ + status = pthread_create(&thid, &th_attr_detached, do_expire_indirect, mt); + if (status) { + error(ap->logopt, "expire thread create failed"); + ops->send_fail(ap->logopt, + ap->ioctlfd, pkt->wait_queue_token, -status); +- expire_mutex_unlock(NULL); ++ pending_mutex_unlock(mt); + pending_cond_destroy(mt); ++ pending_mutex_destroy(mt); + free_pending_args(mt); + pthread_setcancelstate(state, NULL); + return 1; + } + + pthread_cleanup_push(free_pending_args, mt); ++ pthread_cleanup_push(pending_mutex_destroy, mt); + pthread_cleanup_push(pending_cond_destroy, mt); +- pthread_cleanup_push(expire_mutex_unlock, NULL); ++ pthread_cleanup_push(pending_mutex_unlock, mt); + pthread_setcancelstate(state, NULL); + + mt->signaled = 0; +@@ -722,7 +699,7 @@ int handle_packet_expire_indirect(struct + gettimeofday(&now, NULL); + wait.tv_sec = now.tv_sec + 2; + wait.tv_nsec = now.tv_usec * 1000; +- status = pthread_cond_timedwait(&mt->cond, &ea_mutex, &wait); ++ status = pthread_cond_timedwait(&mt->cond, &mt->mutex, &wait); + if (status && status != ETIMEDOUT) + fatal(status); + } +@@ -730,6 +707,7 @@ int handle_packet_expire_indirect(struct + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); ++ pthread_cleanup_pop(1); + + return 0; + } +@@ -743,22 +721,6 @@ static void mount_send_fail(void *arg) + ap->ioctlfd, mt->wait_queue_token, -ENOENT); + } + +-static void pending_mutex_destroy(void *arg) +-{ +- struct pending_args *mt = (struct pending_args *) arg; +- int status = pthread_mutex_destroy(&mt->mutex); +- if (status) +- fatal(status); +-} +- +-static void mount_mutex_unlock(void *arg) +-{ +- struct pending_args *mt = (struct pending_args *) arg; +- int status = pthread_mutex_unlock(&mt->mutex); +- if (status) +- fatal(status); +-} +- + static void *do_mount_indirect(void *arg) + { + struct ioctl_ops *ops = get_ioctl_ops(); +@@ -770,9 +732,7 @@ static void *do_mount_indirect(void *arg + + args = (struct pending_args *) arg; + +- status = pthread_mutex_lock(&args->mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(args); + + memcpy(&mt, args, sizeof(struct pending_args)); + +@@ -783,7 +743,7 @@ static void *do_mount_indirect(void *arg + if (status) + fatal(status); + +- mount_mutex_unlock(args); ++ pending_mutex_unlock(args); + + pthread_cleanup_push(mount_send_fail, &mt); + +@@ -879,9 +839,7 @@ int handle_packet_missing_indirect(struc + if (status) + fatal(status); + +- status = pthread_mutex_lock(&mt->mutex); +- if (status) +- fatal(status); ++ pending_mutex_lock(mt); + + mt->ap = ap; + strncpy(mt->name, pkt->name, pkt->len); +@@ -898,7 +856,7 @@ int handle_packet_missing_indirect(struc + ops->send_fail(ap->logopt, + ap->ioctlfd, pkt->wait_queue_token, -status); + master_mutex_unlock(); +- mount_mutex_unlock(mt); ++ pending_mutex_unlock(mt); + pending_cond_destroy(mt); + pending_mutex_destroy(mt); + free_pending_args(mt); +@@ -911,7 +869,7 @@ int handle_packet_missing_indirect(struc + pthread_cleanup_push(free_pending_args, mt); + pthread_cleanup_push(pending_mutex_destroy, mt); + pthread_cleanup_push(pending_cond_destroy, mt); +- pthread_cleanup_push(mount_mutex_unlock, mt); ++ pthread_cleanup_push(pending_mutex_unlock, mt); + pthread_setcancelstate(state, NULL); + + mt->signaled = 0; +--- autofs-5.0.5.orig/include/automount.h ++++ autofs-5.0.5/include/automount.h +@@ -375,6 +375,47 @@ struct pending_args { + unsigned long wait_queue_token; /* Associated kernel wait token */ + }; + ++#ifdef INCLUDE_PENDING_FUNCTIONS ++static void pending_cond_destroy(void *arg) ++{ ++ struct pending_args *mt = (struct pending_args *) arg; ++ int status; ++ status = pthread_cond_destroy(&mt->cond); ++ if (status) ++ fatal(status); ++} ++ ++static void pending_mutex_destroy(void *arg) ++{ ++ struct pending_args *mt = (struct pending_args *) arg; ++ int status = pthread_mutex_destroy(&mt->mutex); ++ if (status) ++ fatal(status); ++} ++ ++static void free_pending_args(void *arg) ++{ ++ struct pending_args *mt = (struct pending_args *) arg; ++ free(mt); ++} ++ ++static void pending_mutex_lock(void *arg) ++{ ++ struct pending_args *mt = (struct pending_args *) arg; ++ int status = pthread_mutex_lock(&mt->mutex); ++ if (status) ++ fatal(status); ++} ++ ++static void pending_mutex_unlock(void *arg) ++{ ++ struct pending_args *mt = (struct pending_args *) arg; ++ int status = pthread_mutex_unlock(&mt->mutex); ++ if (status) ++ fatal(status); ++} ++#endif ++ + struct thread_stdenv_vars { + uid_t uid; + gid_t gid; diff --git a/autofs-5.0.5-fix-error-handing-in-do_mount_indirect.patch b/autofs-5.0.5-fix-error-handing-in-do_mount_indirect.patch new file mode 100644 index 0000000..4346424 --- /dev/null +++ b/autofs-5.0.5-fix-error-handing-in-do_mount_indirect.patch @@ -0,0 +1,43 @@ +autofs-5.0.5 - fix error handing in do_mount_indirect() + +From: Ian Kent + +A couple of error returns in do_mount_indirect() fail to notify +the kernel of request status before terminating. +--- + + CHANGELOG | 1 + + daemon/indirect.c | 4 ++++ + 2 files changed, 5 insertions(+) + + +--- autofs-5.0.5.orig/CHANGELOG ++++ autofs-5.0.5/CHANGELOG +@@ -44,6 +44,7 @@ + - fix negative cache included map lookup. + - remove state machine timed wait. + - remove extra read master map call. ++- fix error handing in do_mount_indirect(). + + 03/09/2009 autofs-5.0.5 + ----------------------- +--- autofs-5.0.5.orig/daemon/indirect.c ++++ autofs-5.0.5/daemon/indirect.c +@@ -792,6 +792,9 @@ static void *do_mount_indirect(void *arg + len = ncat_path(buf, sizeof(buf), ap->path, mt.name, mt.len); + if (!len) { + crit(ap->logopt, "path to be mounted is to long"); ++ ops->send_fail(ap->logopt, ++ ap->ioctlfd, mt.wait_queue_token, ++ -ENAMETOOLONG); + pthread_setcancelstate(state, NULL); + pthread_exit(NULL); + } +@@ -800,6 +803,7 @@ static void *do_mount_indirect(void *arg + if (status != -1 && !(S_ISDIR(st.st_mode) && st.st_dev == mt.dev)) { + error(ap->logopt, + "indirect trigger not valid or already mounted %s", buf); ++ ops->send_ready(ap->logopt, ap->ioctlfd, mt.wait_queue_token); + pthread_setcancelstate(state, NULL); + pthread_exit(NULL); + } diff --git a/autofs-5.0.5-fix-fix-cache_init-on-source-re-read.patch b/autofs-5.0.5-fix-fix-cache_init-on-source-re-read.patch new file mode 100644 index 0000000..8d304f4 --- /dev/null +++ b/autofs-5.0.5-fix-fix-cache_init-on-source-re-read.patch @@ -0,0 +1,28 @@ +autofs-5.0.5 - fix "fix cache_init() on source re-read" + +From: Ian Kent + +Remove extra cache create call in master_add_map_source(). +--- + + lib/master.c | 6 ------ + 1 files changed, 0 insertions(+), 6 deletions(-) + + +diff --git a/lib/master.c b/lib/master.c +index 03d8f77..12f2d22 100644 +--- a/lib/master.c ++++ b/lib/master.c +@@ -188,12 +188,6 @@ master_add_map_source(struct master_mapent *entry, + source->argc = argc; + source->argv = tmpargv; + +- source->mc = cache_init(entry->ap, source); +- if (!source->mc) { +- master_free_map_source(source, 0); +- return NULL; +- } +- + master_source_writelock(entry); + + if (!entry->maps) { diff --git a/autofs-5.0.5-include-krb5-library.patch b/autofs-5.0.5-include-krb5-library.patch new file mode 100644 index 0000000..71d8cc6 --- /dev/null +++ b/autofs-5.0.5-include-krb5-library.patch @@ -0,0 +1,204 @@ +autofs-5.0.5 - include krb5 library + +From: Ian Kent + +Since the Cyrus SASL module calls Kerberos directly we should be +linking against the Kerberos librarys. +--- + + Makefile.conf.in | 2 ++ + aclocal.m4 | 19 +++++++++++++++ + configure | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++- + configure.in | 5 +++- + modules/Makefile | 4 ++- + 5 files changed, 93 insertions(+), 4 deletions(-) + + +diff --git a/Makefile.conf.in b/Makefile.conf.in +index 7670364..80093c1 100644 +--- a/Makefile.conf.in ++++ b/Makefile.conf.in +@@ -31,6 +31,8 @@ XML_FLAGS = @XML_FLAGS@ + SASL = @HAVE_SASL@ + LIBSASL= @LIBSASL@ + SASL_FLAGS = @SASL_FLAGS@ ++KRB5_LIBS=@KRB5_LIBS@ ++KRB5_FLAGS=@KRB5_FLAGS@ + + # NIS+ support: yes (1) no (0) + NISPLUS = @HAVE_NISPLUS@ +diff --git a/aclocal.m4 b/aclocal.m4 +index e7f1a30..750a159 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -215,6 +215,25 @@ else + fi]) + + dnl -------------------------------------------------------------------------- ++dnl AF_CHECK_KRB5 ++dnl ++dnl Check for Kerberos 5 ++dnl -------------------------------------------------------------------------- ++AC_DEFUN([AF_CHECK_KRB5], ++[AC_PATH_PROGS(KRB5_CONFIG, krb5-config, no) ++AC_MSG_CHECKING(for Kerberos library) ++if test "$KRB5_CONFIG" = "no" ++then ++ AC_MSG_RESULT(no) ++ HAVE_KRB5=0 ++else ++ AC_MSG_RESULT(yes) ++ HAVE_KRB5=1 ++ KRB5_LIBS=`$KRB5_CONFIG --libs` ++ KRB5_FLAGS=`$KRB5_CONFIG --cflags` ++fi]) ++ ++dnl -------------------------------------------------------------------------- + dnl AF_CHECK_LIBHESIOD + dnl + dnl Check for lib hesiod +diff --git a/configure b/configure +index f5b7d07..352b0d6 100755 +--- a/configure ++++ b/configure +@@ -640,6 +640,8 @@ ac_subst_vars='LTLIBOBJS + LIBOBJS + DAEMON_LDFLAGS + DAEMON_CFLAGS ++KRB5_FLAGS ++KRB5_LIBS + LIBSASL + HAVE_SASL + SASL_FLAGS +@@ -657,6 +659,7 @@ LIBHESIOD + HAVE_HESIOD + LIBRESOLV + LIBNSL ++KRB5_CONFIG + XML_CONFIG + PATH_RPCGEN + RPCGEN +@@ -3786,7 +3789,7 @@ $as_echo "no" >&6; } + fi + fi + +-# LDAP SASL auth need libxml ++# LDAP SASL auth needs libxml and Kerberos + for ac_prog in xml2-config + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -3864,6 +3867,66 @@ _ACEOF + fi + fi + fi ++for ac_prog in krb5-config ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++else ++ case $KRB5_CONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++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 ++ ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG ++if test -n "$KRB5_CONFIG"; then ++ { $as_echo "$as_me:$LINENO: result: $KRB5_CONFIG" >&5 ++$as_echo "$KRB5_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:$LINENO: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$KRB5_CONFIG" && break ++done ++test -n "$KRB5_CONFIG" || KRB5_CONFIG="no" ++ ++{ $as_echo "$as_me:$LINENO: checking for Kerberos library" >&5 ++$as_echo_n "checking for Kerberos library... " >&6; } ++if test "$KRB5_CONFIG" = "no" ++then ++ { $as_echo "$as_me:$LINENO: result: no" >&5 ++$as_echo "no" >&6; } ++ HAVE_KRB5=0 ++else ++ { $as_echo "$as_me:$LINENO: result: yes" >&5 ++$as_echo "yes" >&6; } ++ HAVE_KRB5=1 ++ KRB5_LIBS=`$KRB5_CONFIG --libs` ++ KRB5_FLAGS=`$KRB5_CONFIG --cflags` ++fi + + # + # glibc/libc 6 new libraries +@@ -5241,6 +5304,8 @@ fi + + + ++ ++ + LDFLAGS="${AF_tmp_ldflags}" + + # +diff --git a/configure.in b/configure.in +index 78085bd..233edab 100644 +--- a/configure.in ++++ b/configure.in +@@ -145,8 +145,9 @@ AF_CHECK_PROG(RPCGEN, rpcgen, , $searchpath) + # + AF_SLOPPY_MOUNT() + +-# LDAP SASL auth need libxml ++# LDAP SASL auth needs libxml and Kerberos + AF_CHECK_LIBXML() ++AF_CHECK_KRB5() + + # + # glibc/libc 6 new libraries +@@ -275,6 +276,8 @@ AC_SUBST(XML_LIBS) + AC_SUBST(SASL_FLAGS) + AC_SUBST(HAVE_SASL) + AC_SUBST(LIBSASL) ++AC_SUBST(KRB5_LIBS) ++AC_SUBST(KRB5_FLAGS) + LDFLAGS="${AF_tmp_ldflags}" + + # +diff --git a/modules/Makefile b/modules/Makefile +index 0bb9464..164d412 100644 +--- a/modules/Makefile ++++ b/modules/Makefile +@@ -42,8 +42,8 @@ ifeq ($(LDAP), 1) + MODS += lookup_ldap.so + ifeq ($(SASL), 1) + SASL_OBJ = cyrus-sasl.o +- LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) -DLDAP_THREAD_SAFE +- LIBLDAP += $(LIBSASL) $(XML_LIBS) ++ LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) $(KRB5_FLAGS) -DLDAP_THREAD_SAFE ++ LIBLDAP += $(LIBSASL) $(XML_LIBS) $(KRB5_LIBS) + endif + endif + diff --git a/autofs-5.0.5-make-verbose-mode-a-little-less-verbose.patch b/autofs-5.0.5-make-verbose-mode-a-little-less-verbose.patch new file mode 100644 index 0000000..3e0602d --- /dev/null +++ b/autofs-5.0.5-make-verbose-mode-a-little-less-verbose.patch @@ -0,0 +1,94 @@ +autofs-5.0.5 - Make "verbose" mode a little less verbose + +From: Leonardo Chiquitto + +Remove some log message duplication for verbose logging. +--- + + daemon/automount.c | 2 +- + daemon/lookup.c | 2 +- + modules/mount_changer.c | 2 +- + modules/mount_ext2.c | 2 +- + modules/mount_generic.c | 2 +- + modules/mount_nfs.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + + +diff --git a/daemon/automount.c b/daemon/automount.c +index 206734b..9939a25 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -512,7 +512,7 @@ static int umount_subtree_mounts(struct autofs_point *ap, const char *path, unsi + * it already to ensure it's ok to remove any offset triggers. + */ + if (!is_mm_root && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) { +- info(ap->logopt, "unmounting dir = %s", path); ++ debug(ap->logopt, "unmounting dir = %s", path); + if (umount_ent(ap, path)) { + warn(ap->logopt, "could not umount dir %s", path); + left++; +diff --git a/daemon/lookup.c b/daemon/lookup.c +index f5d9da8..a4bd07f 100644 +--- a/daemon/lookup.c ++++ b/daemon/lookup.c +@@ -688,7 +688,7 @@ static int lookup_name_file_source_instance(struct autofs_point *ap, struct map_ + char *type, *format; + + if (stat(map->argv[0], &st) == -1) { +- warn(ap->logopt, "file map not found"); ++ debug(ap->logopt, "file map not found"); + return NSS_STATUS_NOTFOUND; + } + +diff --git a/modules/mount_changer.c b/modules/mount_changer.c +index f4d82dd..d7bfa09 100644 +--- a/modules/mount_changer.c ++++ b/modules/mount_changer.c +@@ -129,7 +129,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + + return 1; + } else { +- info(ap->logopt, MODPREFIX "mounted %s type %s on %s", ++ debug(ap->logopt, MODPREFIX "mounted %s type %s on %s", + what, fstype, fullpath); + return 0; + } +diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c +index 26d59d1..1edf347 100644 +--- a/modules/mount_ext2.c ++++ b/modules/mount_ext2.c +@@ -140,7 +140,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + + return 1; + } else { +- info(ap->logopt, ++ debug(ap->logopt, + MODPREFIX "mounted %s type %s on %s", + what, fstype, fullpath); + return 0; +diff --git a/modules/mount_generic.c b/modules/mount_generic.c +index da85d1a..79e3d32 100644 +--- a/modules/mount_generic.c ++++ b/modules/mount_generic.c +@@ -122,7 +122,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + + return 1; + } else { +- info(ap->logopt, MODPREFIX "mounted %s type %s on %s", ++ debug(ap->logopt, MODPREFIX "mounted %s type %s on %s", + loc, fstype, fullpath); + free(loc); + return 0; +diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c +index 21e1929..9110eba 100644 +--- a/modules/mount_nfs.c ++++ b/modules/mount_nfs.c +@@ -251,7 +251,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int + } + + if (!err) { +- info(ap->logopt, MODPREFIX "mounted %s on %s", loc, fullpath); ++ debug(ap->logopt, MODPREFIX "mounted %s on %s", loc, fullpath); + free(loc); + free_host_list(&hosts); + return 0; diff --git a/autofs-5.0.5-remove-extra-read-master-map-call.patch b/autofs-5.0.5-remove-extra-read-master-map-call.patch new file mode 100644 index 0000000..e7df68a --- /dev/null +++ b/autofs-5.0.5-remove-extra-read-master-map-call.patch @@ -0,0 +1,33 @@ +autofs-5.0.5 - remove extra read master map call + +From: Ian Kent + +Fix a mistake with a recent patch where a call to lookup_read_master() +which should have been removed wasn't. +--- + + CHANGELOG | 1 + + lib/master.c | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + + +--- autofs-5.0.5.orig/CHANGELOG ++++ autofs-5.0.5/CHANGELOG +@@ -43,6 +43,7 @@ + - check each dc server individually. + - fix negative cache included map lookup. + - remove state machine timed wait. ++- remove extra read master map call. + + 03/09/2009 autofs-5.0.5 + ----------------------- +--- autofs-5.0.5.orig/lib/master.c ++++ autofs-5.0.5/lib/master.c +@@ -840,7 +840,6 @@ int master_read_master(struct master *ma + lookup_nss_read_master(master, age); + cache_unlock(nc); + +- lookup_nss_read_master(master, age); + if (!master->read_fail) + master_mount_mounts(master, age, readall); + else { diff --git a/autofs.spec b/autofs.spec index a2f60e7..8db5e52 100644 --- a/autofs.spec +++ b/autofs.spec @@ -4,7 +4,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.5 -Release: 27%{?dist} +Release: 28%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -53,6 +53,12 @@ Patch41: autofs-5.0.5-mapent-becomes-negative-during-lookup.patch Patch42: autofs-5.0.5-check-each-dc-server.patch Patch43: autofs-5.0.5-fix-negative-cache-included-map-lookup.patch Patch44: autofs-5.0.5-remove-state-machine-timed-wait.patch +Patch45: autofs-5.0.5-remove-extra-read-master-map-call.patch +Patch46: autofs-5.0.5-fix-fix-cache_init-on-source-re-read.patch +Patch47: autofs-5.0.5-fix-error-handing-in-do_mount_indirect.patch +Patch48: autofs-5.0.5-expire-thread-use-pending-mutex.patch +Patch49: autofs-5.0.5-include-krb5-library.patch +Patch50: autofs-5.0.5-make-verbose-mode-a-little-less-verbose.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 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 Conflicts: cyrus-sasl-lib < 2.1.23-9 @@ -139,6 +145,12 @@ echo %{version}-%{release} > .version %patch42 -p1 %patch43 -p1 %patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -191,6 +203,14 @@ fi %{_libdir}/autofs/ %changelog +* 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.