diff --git a/autofs-5.0.6-add-dir-map-type.patch b/autofs-5.0.6-add-dir-map-type.patch deleted file mode 100644 index f4977de..0000000 --- a/autofs-5.0.6-add-dir-map-type.patch +++ /dev/null @@ -1,393 +0,0 @@ -autofs-5.0.5 - dir map-type patch v2 - -From: Masatake YAMATO - -This is the second post of "dir map-type" patch. - -Changes since last post: - - - Don't use auto. as prefix for included map. - Use .autofs suffix instead. Suggested by Steve Linn. - - - Use scandir instead of using opendir/readdir/closedir. - - -What is dir map-type? - - -`dir' map-type is for including files under a directory into master -map. -`file' map-type can be used for including a file with + notation like: - - +/etc/auto.mine - -in auto.master. However, for specifying a new file to be included you -have to edit auto.master file. Editing is also needed when you want to -remove the included file. When you have to do this with your shell -script you may have to use sed or awk. - -`dir' map-type permits you adding new master map entries with cp -command and removing the entries with rm command. `dir' map-type is -inspired from /etc/httpd/conf.d and /etc/modprobe.d. - -`dir' map-type can be used for included files under a directory -(e.g. /etc/auto.master.d) with + notation like: - - +dir:/etc/auto.master.d - -in auto.master. With this notation /etc/auto.master.d/*.autofs files -are included except a file which name is started with ".". With the -name of the file you can control whether a file under the directory is -included or not: the file which name ends with ".autofs" is included. - - -Signed-off-by: Masatake YAMATO ---- - - CHANGELOG | 1 - autofs.spec | 2 - daemon/lookup.c | 3 - - man/auto.master.5.in | 10 ++ - modules/Makefile | 6 + - modules/lookup_dir.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ - samples/auto.master | 4 + - 7 files changed, 240 insertions(+), 5 deletions(-) - create mode 100644 modules/lookup_dir.c - - -diff --git a/CHANGELOG b/CHANGELOG -index 7e86c84..5b988d4 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -8,6 +8,7 @@ - - fix LDAP result leaks on error paths. - - code analysis fixes part 1. - - fix not bind mounting local filesystem. -+- add "dir" map-type. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/autofs.spec b/autofs.spec -index 91d4f8b..82edd1e 100644 ---- a/autofs.spec -+++ b/autofs.spec -@@ -67,6 +67,7 @@ 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=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_ROOT - make -C redhat -@@ -104,6 +105,7 @@ fi - %dir %{_libdir}/autofs - %{_libdir}/autofs/* - %{_mandir}/*/* -+%dir /etc/auto.master.d - - %changelog - * Tue Jun 3 2011 Ian Kent -diff --git a/daemon/lookup.c b/daemon/lookup.c -index 958d8cc..098588c 100644 ---- a/daemon/lookup.c -+++ b/daemon/lookup.c -@@ -176,7 +176,8 @@ int lookup_nss_read_master(struct master *master, time_t age) - !strncmp(name, "nis:", 4) || - !strncmp(name, "nisplus:", 8) || - !strncmp(name, "ldap:", 5) || -- !strncmp(name, "ldaps:", 6)) { -+ !strncmp(name, "ldaps:", 6) || -+ !strncmp(name, "dir:", 4)) { - strncpy(source, name, tmp - name); - - /* -diff --git a/man/auto.master.5.in b/man/auto.master.5.in -index de692d2..fff9943 100644 ---- a/man/auto.master.5.in -+++ b/man/auto.master.5.in -@@ -107,6 +107,14 @@ appropriate certificate must be configured in the LDAP client. - .B multi - This map type allows the specification of multiple maps separated - by "--". These maps are searched in order to resolve key lookups. -+.TP -+.B dir -+This map type can be used at -+.BR + -+master map including notation. The contents of files under given directory are included -+to the master map. The name of file to be included must be ended with ".autofs". A file -+will be ignored if its name is not ended with the suffix. In addition a dot file, a file -+which name is started with "." is also ignored. - .RE - .TP - \fBformat\fP -@@ -118,7 +126,7 @@ left unspecified, it defaults to \fBsun\fP for all map types except - .TP - \fBmap\fP - Name of the map to use. This is an absolute UNIX pathname --for maps of types \fBfile\fP or \fBprogram\fP, and the name of a database -+for maps of types \fBfile\fP, \fBdir\fP, or \fBprogram\fP, and the name of a database - in the case for maps of type \fByp\fP, \fBnisplus\fP, or \fBhesiod\fP or - the \fBdn\fP of an LDAP entry for maps of type \fBldap\fP. - .TP -diff --git a/modules/Makefile b/modules/Makefile -index a35c0a5..6090127 100644 ---- a/modules/Makefile -+++ b/modules/Makefile -@@ -5,14 +5,14 @@ - -include ../Makefile.conf - include ../Makefile.rules - --SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \ -- lookup_multi.c lookup_hosts.c \ -+SRCS := lookup_yp.c 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 \ -- lookup_multi.so lookup_hosts.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 \ - mount_changer.so mount_bind.so -diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c -new file mode 100644 -index 0000000..658cc29 ---- /dev/null -+++ b/modules/lookup_dir.c -@@ -0,0 +1,219 @@ -+/* ----------------------------------------------------------------------- * -+ * -+ * lookup_dir.c - module for including master files in a directory. -+ * -+ * Copyright 2011 Red Hat, Inc. All rights reserved. -+ * Copyright 2011 Masatake YAMATO -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, -+ * USA; either version 2 of the License, or (at your option) any later -+ * version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * ----------------------------------------------------------------------- */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+#define MODULE_LOOKUP -+#include "automount.h" -+#include "nsswitch.h" -+ -+#define MODPREFIX "lookup(dir): " -+ -+#define MAX_INCLUDE_DEPTH 16 -+ -+#define AUTOFS_DIR_EXT ".autofs" -+#define AUTOFS_DIR_EXTSIZ (sizeof(AUTOFS_DIR_EXT) - 1) -+ -+struct lookup_context { -+ const char *mapname; -+}; -+ -+int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */ -+ -+ -+int lookup_init(const char *mapfmt, int argc, const char *const *argv, void **context) -+{ -+ struct lookup_context *ctxt; -+ char buf[MAX_ERR_BUF]; -+ struct stat st; -+ -+ *context = NULL; -+ ctxt = malloc(sizeof(struct lookup_context)); -+ if (!ctxt) { -+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ logerr(MODPREFIX "malloc: %s", estr); -+ return 1; -+ } -+ -+ if (argc < 1) { -+ free(ctxt); -+ logerr(MODPREFIX "No map name"); -+ return 1; -+ } -+ -+ ctxt->mapname = argv[0]; -+ -+ if (ctxt->mapname[0] != '/') { -+ free(ctxt); -+ logmsg(MODPREFIX -+ "dir map %s is not an absolute pathname", argv[0]); -+ return 1; -+ } -+ -+ if (access(ctxt->mapname, R_OK)) { -+ free(ctxt); -+ warn(LOGOPT_NONE, MODPREFIX -+ "dir map %s missing or not readable", argv[0]); -+ return 1; -+ } -+ -+ if (stat(ctxt->mapname, &st)) { -+ free(ctxt); -+ warn(LOGOPT_NONE, MODPREFIX -+ "dir map %s, could not stat", argv[0]); -+ return 1; -+ } -+ -+ if ( (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)) ) { -+ free(ctxt); -+ warn(LOGOPT_NONE, MODPREFIX -+ "dir map %s, is not a directory", argv[0]); -+ } -+ -+ *context = ctxt; -+ return 0; -+} -+ -+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; -+ -+ if (e->d_name[0] == '.') -+ return 0; -+ -+ if (namesz < AUTOFS_DIR_EXTSIZ + 1 || -+ strcmp(e->d_name + (namesz - AUTOFS_DIR_EXTSIZ), -+ AUTOFS_DIR_EXT)) -+ return 0; -+ -+ return 1; -+} -+ -+ -+static int include_file(struct master *master, time_t age, struct lookup_context* ctxt, struct dirent *e) -+{ -+ unsigned int logopt = master->logopt; -+ char included_path[PATH_MAX + 1]; -+ int included_path_len; -+ char *save_name; -+ int status; -+ -+ included_path_len = snprintf(included_path, -+ PATH_MAX + 1, -+ "%s/%s", -+ ctxt->mapname, -+ e->d_name); -+ if (included_path_len > PATH_MAX) -+ return NSS_STATUS_NOTFOUND; -+ -+ save_name = master->name; -+ master->name = included_path; -+ -+ master->depth++; -+ debug(logopt, MODPREFIX "include: %s", master->name); -+ status = lookup_nss_read_master(master, age); -+ if (!status) { -+ warn(logopt, -+ MODPREFIX -+ "failed to read included master map %s", -+ master->name); -+ } -+ master->depth--; -+ -+ master->name = save_name; -+ return NSS_STATUS_SUCCESS; -+} -+ -+ -+int lookup_read_master(struct master *master, time_t age, void *context) -+{ -+ int n, i; -+ struct dirent **namelist = NULL; -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ unsigned int logopt = master->logopt; -+ char buf[MAX_ERR_BUF]; -+ -+ -+ if (master->depth > MAX_INCLUDE_DEPTH) { -+ error(logopt, MODPREFIX -+ "maximum include depth exceeded %s", master->name); -+ return NSS_STATUS_UNAVAIL; -+ } -+ -+ debug(logopt, MODPREFIX "scandir: %s", ctxt->mapname); -+ n = scandir(ctxt->mapname, &namelist, acceptable_dirent_p, versionsort); -+ if (n < 0) { -+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ -+ error(logopt, -+ MODPREFIX "could not scan master map dir %s: %s", -+ ctxt->mapname, -+ estr); -+ return NSS_STATUS_UNAVAIL; -+ } -+ -+ for (i = 0; i < n; i++) { -+ struct dirent *e = namelist[i]; -+ -+ include_file(master, age, ctxt, e); -+ free(e); -+ } -+ free(namelist); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+int lookup_read_map(struct autofs_point *ap, time_t age, void *context) -+{ -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ return NSS_STATUS_UNKNOWN; -+} -+ -+int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *context) -+{ -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ return NSS_STATUS_UNKNOWN; -+} -+ -+int lookup_done(void *context) -+{ -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ -+ free(ctxt); -+ return 0; -+} -diff --git a/samples/auto.master b/samples/auto.master -index 9fe5609..72f086c 100644 ---- a/samples/auto.master -+++ b/samples/auto.master -@@ -12,6 +12,10 @@ - # - /net -hosts - # -+# Include /etc/auto.master.d/*.autofs -+# -++dir:/etc/auto.master.d -+# - # Include central master map if it can be found using - # nsswitch sources. - # diff --git a/autofs-5.0.6-add-disable-move-mount-configure-option.patch b/autofs-5.0.6-add-disable-move-mount-configure-option.patch deleted file mode 100644 index 45c81de..0000000 --- a/autofs-5.0.6-add-disable-move-mount-configure-option.patch +++ /dev/null @@ -1,334 +0,0 @@ -autofs-5.0.6 - add disable move mount configure option - -From: Ian Kent - -With the introduction of systemd the root filesystem is now usually -marked as shared instead of private as part of the systemd sandbox -functionality. As a consequence moving a mount from one mount point -to another is not allowed. - -To resolve this a configure option (--disable-move-mount) to disable -autofs preparing mount tree and then moving it into place has been -added. The move mount use in autofs was needed for a small set of -automount types with older kernels (prior to 2.6.39). So to disable -the use of move mount it's necessary to use a recent kernel. ---- - - CHANGELOG | 1 + - autofs.spec | 2 +- - configure | 18 ++++++++++++++++++ - configure.in | 10 ++++++++++ - daemon/automount.c | 11 +++++++++++ - include/config.h.in | 3 +++ - modules/mount_nfs.c | 5 ----- - modules/parse_sun.c | 40 +++++++++++++++++++++++++++++++++++----- - 8 files changed, 79 insertions(+), 11 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 304b6a2..c682f94 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -12,6 +12,7 @@ - - fix wait for master source mutex. - - fix submount shutdown race. - - fix fix map source check in file lookup. -+- add disable move mount configure option. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/autofs.spec b/autofs.spec -index 82edd1e..510ef76 100644 ---- a/autofs.spec -+++ b/autofs.spec -@@ -57,7 +57,7 @@ inkludera n - echo %{version}-%{release} > .version - - %build --CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc -+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move - CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 - - %install -diff --git a/configure b/configure -index b5a3608..76b6d86 100755 ---- a/configure -+++ b/configure -@@ -704,6 +704,7 @@ with_openldap - with_sasl - enable_ext_env - enable_mount_locking -+enable_mount_move - enable_forced_shutdown - enable_ignore_busy - ' -@@ -1326,6 +1327,7 @@ Optional Features: - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-ext-env disable search in environment for substitution variable - --disable-mount-locking disable use of locking when spawning mount command -+ --disable-mount-move disable use of mount move when when preparing tree of mounts - --enable-force-shutdown enable USR1 signal to force unlink umount of any - busy mounts during shutdown - --enable-ignore-busy enable exit without umounting busy mounts during -@@ -5349,6 +5351,22 @@ $as_echo "#define ENABLE_MOUNT_LOCKING 1" >>confdefs.h - fi - - # -+# Disable use of mount move -+# -+# Check whether --enable-mount-move was given. -+if test "${enable_mount_move+set}" = set; then : -+ enableval=$enable_mount_move; -+else -+ enableval=yes -+fi -+ -+if test x$enable_mount_move = xyes -o x$enableval = xyes; then -+ -+$as_echo "#define ENABLE_MOUNT_MOVE 1" >>confdefs.h -+ -+fi -+ -+# - # Enable forced shutdown on USR1 signal (unlink umounts all mounts). - # - # Check whether --enable-forced-shutdown was given. -diff --git a/configure.in b/configure.in -index 46de65a..d3e4e54 100644 ---- a/configure.in -+++ b/configure.in -@@ -324,6 +324,16 @@ if test x$enable_mount_locking = xyes -o x$enableval = xyes; then - fi - - # -+# Disable use of mount move -+# -+AC_ARG_ENABLE(mount-move, -+[ --disable-mount-move disable use of mount move when when preparing tree of mounts],, -+ enableval=yes) -+if test x$enable_mount_move = xyes -o x$enableval = xyes; then -+ AC_DEFINE(ENABLE_MOUNT_MOVE, 1, [Disable use of mount move when preparing tree of mounts]) -+fi -+ -+# - # Enable forced shutdown on USR1 signal (unlink umounts all mounts). - # - AC_ARG_ENABLE(forced-shutdown, -diff --git a/daemon/automount.c b/daemon/automount.c -index 4f3151f..6bb5aa8 100644 ---- a/daemon/automount.c -+++ b/daemon/automount.c -@@ -1743,9 +1743,20 @@ static void show_build_info(void) - count = 22; - #endif - -+#ifndef ENABLE_MOUNT_MOVE -+ printf("DISABLE_MOUNT_MOVE "); -+ count = count + 19; -+#endif -+ - #ifdef ENABLE_FORCED_SHUTDOWN - printf("ENABLE_FORCED_SHUTDOWN "); - count = count + 23; -+ -+ if (count > 60) { -+ printf("\n "); -+ count = 0; -+ } -+ - #endif - - #ifdef ENABLE_IGNORE_BUSY_MOUNTS -diff --git a/include/config.h.in b/include/config.h.in -index 4a3a990..97a8d2d 100644 ---- a/include/config.h.in -+++ b/include/config.h.in -@@ -12,6 +12,9 @@ - /* Disable use of locking when spawning mount command */ - #undef ENABLE_MOUNT_LOCKING - -+/* Disable use of mount move when preparing tree of mounts */ -+#undef ENABLE_MOUNT_MOVE -+ - /* define if you have E2FSCK */ - #undef HAVE_E2FSCK - -diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c -index 8b567d2..7eab728 100644 ---- a/modules/mount_nfs.c -+++ b/modules/mount_nfs.c -@@ -163,11 +163,6 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int - if (root[len - 1] == '/') { - len = snprintf(fullpath, len, "%s", root); - } else if (*name == '/') { -- /* -- * Direct or offset mount, name is absolute path so -- * don't use root (but with move mount changes root -- * is now the same as name). -- */ - len = sprintf(fullpath, "%s", root); - } else { - len = sprintf(fullpath, "%s/%s", root, name); -diff --git a/modules/parse_sun.c b/modules/parse_sun.c -index 021850d..13b8af8 100644 ---- a/modules/parse_sun.c -+++ b/modules/parse_sun.c -@@ -1028,6 +1028,7 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char * - return (p - ent); - } - -+#ifdef ENABLE_MOUNT_MOVE - static int move_mount(struct autofs_point *ap, - const char *mm_tmp_root, const char *mm_root, - unsigned int move) -@@ -1063,6 +1064,7 @@ static int move_mount(struct autofs_point *ap, - - return 1; - } -+#endif - - static void cleanup_multi_root(struct autofs_point *ap, const char *root, - const char *path, unsigned int move) -@@ -1145,6 +1147,7 @@ static void cleanup_multi_triggers(struct autofs_point *ap, - return; - } - -+#ifdef ENABLE_MOUNT_MOVE - static int check_fstype_autofs_option(const char *options) - { - char *tok, *tokbuf; -@@ -1171,24 +1174,27 @@ static int check_fstype_autofs_option(const char *options) - - return found; - } -+#endif - - static int mount_subtree(struct autofs_point *ap, struct mapent *me, - const char *name, char *loc, char *options, void *ctxt) - { - struct mapent *mm; - struct mapent *ro; -- char t_dir[] = "/tmp/autoXXXXXX"; -- char *mnt_tmp_root, *mm_root, *mm_base, *mm_key; -+ char *mm_root, *mm_base, *mm_key; - const char *mnt_root, *target; - unsigned int mm_root_len, mnt_root_len; - int start, ret = 0, rv; -- unsigned int move; -+ unsigned int move = MOUNT_MOVE_NONE; -+#ifdef ENABLE_MOUNT_MOVE -+ char t_dir[] = "/tmp/autoXXXXXX"; -+ char *mnt_tmp_root = NULL; -+#endif - - rv = 0; - - mm = me->multi; - mm_key = mm->key; -- move = MOUNT_MOVE_NONE; - - if (*mm_key == '/') { - mm_root = mm_key; -@@ -1202,7 +1208,10 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - } - mm_root_len = strlen(mm_root); - -- mnt_tmp_root = NULL; -+#ifndef ENABLE_MOUNT_MOVE -+ mnt_root = mm_root; -+ mnt_root_len = mm_root_len; -+#else - if (ap->flags & MOUNT_FLAG_REMOUNT) { - mnt_root = mm_root; - mnt_root_len = mm_root_len; -@@ -1213,6 +1222,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - mnt_root_len = strlen(mnt_root); - mnt_tmp_root = (char *) mnt_root; - } -+#endif - - if (me == me->multi) { - /* name = NULL */ -@@ -1238,11 +1248,13 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - } - ro_len = strlen(ro_loc); - -+#ifdef ENABLE_MOUNT_MOVE - if (!(ap->flags & MOUNT_FLAG_REMOUNT)) { - move = MOUNT_MOVE_OTHER; - if (check_fstype_autofs_option(myoptions)) - move = MOUNT_MOVE_AUTOFS; - } -+#endif - - tmp = alloca(mnt_root_len + 1); - strcpy(tmp, mnt_root); -@@ -1266,7 +1278,9 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - goto error_out; - } - } else if (rv <= 0) { -+#ifdef ENABLE_MOUNT_MOVE - move = MOUNT_MOVE_NONE; -+#endif - ret = mount_multi_triggers(ap, me, mm_root, start, mm_base); - if (ret == -1) { - error(ap->logopt, MODPREFIX -@@ -1279,11 +1293,21 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - int loclen = strlen(loc); - int namelen = strlen(name); - -+#ifndef ENABLE_MOUNT_MOVE -+ /* -+ * When using move mount to mount offsets or direct mounts -+ * the base of the tree can be the base of the temporary -+ * mount point it needs to be the full path when not moving -+ * the mount after construction. -+ */ -+ mnt_root = name; -+#else - if (!(ap->flags & MOUNT_FLAG_REMOUNT)) { - move = MOUNT_MOVE_OTHER; - if (check_fstype_autofs_option(options)) - move = MOUNT_MOVE_AUTOFS; - } -+#endif - - /* name = mm_root + mm_base */ - /* destination = mm_root + mm_base = name */ -@@ -1303,7 +1327,9 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - } else if (rv < 0) { - char *mm_root_base = alloca(strlen(mm_root) + strlen(mm_base) + 1); - -+#ifdef ENABLE_MOUNT_MOVE - move = MOUNT_MOVE_NONE; -+#endif - - strcpy(mm_root_base, mm_root); - strcat(mm_root_base, mm_base); -@@ -1318,6 +1344,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - } - } - -+#ifdef ENABLE_MOUNT_MOVE - if (!move_mount(ap, mnt_root, target, move)) { - cleanup_multi_triggers(ap, me, mnt_root, start, mm_base); - cleanup_multi_root(ap, mnt_root, mm_root, move); -@@ -1326,6 +1353,7 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - - if (mnt_tmp_root) - rmdir(mnt_tmp_root); -+#endif - - /* Mount for base of tree failed */ - if (rv > 0) -@@ -1341,8 +1369,10 @@ static int mount_subtree(struct autofs_point *ap, struct mapent *me, - return rv; - - error_out: -+#ifdef ENABLE_MOUNT_MOVE - if (mnt_tmp_root) - rmdir(mnt_tmp_root); -+#endif - - return 1; - } diff --git a/autofs-5.0.6-add-function-to-check-mount-nfs-version.patch b/autofs-5.0.6-add-function-to-check-mount-nfs-version.patch deleted file mode 100644 index c95d6d1..0000000 --- a/autofs-5.0.6-add-function-to-check-mount-nfs-version.patch +++ /dev/null @@ -1,323 +0,0 @@ -autofs-5.0.6 - add function to check mount.nfs version - -From: Ian Kent - -Add a function to check if the mount.nfs version is greater than or -equal to a given version. ---- - - CHANGELOG | 1 - configure | 62 +++++++++++++++++++++ - configure.in | 1 - include/config.h.in | 6 ++ - include/mounts.h | 7 ++ - lib/mounts.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 6 files changed, 224 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -25,6 +25,7 @@ - - teach automount about sss source. - - ignore duplicate exports in auto.net. - - add kernel verion check function. -+- add function to check mount.nfs version. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -645,6 +645,8 @@ HAVE_E2FSCK - E2FSCK - HAVE_UMOUNT - UMOUNT -+HAVE_MOUNT_NFS -+MOUNT_NFS - HAVE_MOUNT - MOUNT - DMALLOCLIB -@@ -3248,6 +3250,66 @@ else - HAVE_MOUNT=0 - fi - -+for ac_prog in mount.nfs -+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:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_path_MOUNT_NFS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $MOUNT_NFS in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_MOUNT_NFS="$MOUNT_NFS" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $searchpath -+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_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 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+MOUNT_NFS=$ac_cv_path_MOUNT_NFS -+if test -n "$MOUNT_NFS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOUNT_NFS" >&5 -+$as_echo "$MOUNT_NFS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$MOUNT_NFS" && break -+done -+test -n "$MOUNT_NFS" || MOUNT_NFS="/sbin/mount.nfs " -+ -+if test -n "$MOUNT_NFS"; then -+ -+$as_echo "#define HAVE_MOUNT_NFS 1" >>confdefs.h -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define PATH_MOUNT_NFS "$MOUNT_NFS" -+_ACEOF -+ -+ HAVE_MOUNT_NFS=1 -+else -+ HAVE_MOUNT_NFS=0 -+fi -+ - for ac_prog in umount - do - # Extract the first word of "$ac_prog", so it can be a program name with args. ---- autofs-5.0.6.orig/configure.in -+++ autofs-5.0.6/configure.in -@@ -137,6 +137,7 @@ AC_SUBST(DMALLOCLIB) - # Programs needed for various system functions or modules - # - AF_PATH_INCLUDE(MOUNT, mount, /bin/mount, $searchpath) -+AF_PATH_INCLUDE(MOUNT_NFS, mount.nfs, /sbin/mount.nfs , $searchpath) - AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath) - AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath) - AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath) ---- autofs-5.0.6.orig/include/config.h.in -+++ autofs-5.0.6/include/config.h.in -@@ -45,6 +45,9 @@ - /* define if you have MOUNT */ - #undef HAVE_MOUNT - -+/* define if you have MOUNT_NFS */ -+#undef HAVE_MOUNT_NFS -+ - /* define if the mount command supports the -s option */ - #undef HAVE_SLOPPY_MOUNT - -@@ -111,6 +114,9 @@ - /* define if you have MOUNT */ - #undef PATH_MOUNT - -+/* define if you have MOUNT_NFS */ -+#undef PATH_MOUNT_NFS -+ - /* define if you have RANLIB */ - #undef PATH_RANLIB - ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -89,6 +89,13 @@ static inline unsigned int linux_version - return KERNEL_VERSION(p, q, r); - } - -+struct nfs_mount_vers { -+ unsigned int major; -+ unsigned int minor; -+ unsigned int fix; -+}; -+int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *); -+ - unsigned int query_kproto_ver(void); - unsigned int get_kver_major(void); - unsigned int get_kver_minor(void); ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -19,6 +19,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include -@@ -30,6 +32,8 @@ - #define MAX_OPTIONS_LEN 80 - #define MAX_MNT_NAME_LEN 30 - -+#define EBUFSIZ 1024 -+ - const unsigned int t_indirect = AUTOFS_TYPE_INDIRECT; - const unsigned int t_direct = AUTOFS_TYPE_DIRECT; - const unsigned int t_offset = AUTOFS_TYPE_OFFSET; -@@ -131,6 +135,149 @@ unsigned int get_kver_minor(void) - return kver.minor; - } - -+#ifdef HAVE_MOUNT_NFS -+static int extract_version(char *start, struct nfs_mount_vers *vers) -+{ -+ char *s_ver = strchr(start, ' '); -+ while (*s_ver && !isdigit(*s_ver)) { -+ s_ver++; -+ if (!*s_ver) -+ return 0; -+ break; -+ } -+ vers->major = atoi(strtok(s_ver, ".")); -+ vers->minor = (unsigned int) atoi(strtok(NULL, ".")); -+ vers->fix = (unsigned int) atoi(strtok(NULL, ".")); -+ return 1; -+} -+ -+int check_nfs_mount_version(struct nfs_mount_vers *vers, -+ struct nfs_mount_vers *check) -+{ -+ pid_t f; -+ int ret, status, pipefd[2]; -+ char errbuf[EBUFSIZ + 1], *p, *sp; -+ int errp, errn; -+ sigset_t allsigs, tmpsig, oldsig; -+ char *s_ver; -+ int cancel_state; -+ -+ if (pipe(pipefd)) -+ return -1; -+ -+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_state); -+ -+ sigfillset(&allsigs); -+ pthread_sigmask(SIG_BLOCK, &allsigs, &oldsig); -+ -+ f = fork(); -+ if (f == 0) { -+ reset_signals(); -+ close(pipefd[0]); -+ dup2(pipefd[1], STDOUT_FILENO); -+ dup2(pipefd[1], STDERR_FILENO); -+ close(pipefd[1]); -+ -+ execl(PATH_MOUNT_NFS, PATH_MOUNT_NFS, "-V", (char *) NULL); -+ _exit(255); /* execv() failed */ -+ } -+ -+ ret = 0; -+ -+ tmpsig = oldsig; -+ -+ sigaddset(&tmpsig, SIGCHLD); -+ pthread_sigmask(SIG_SETMASK, &tmpsig, NULL); -+ -+ close(pipefd[1]); -+ -+ if (f < 0) { -+ close(pipefd[0]); -+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL); -+ pthread_setcancelstate(cancel_state, NULL); -+ return -1; -+ } -+ -+ errp = 0; -+ do { -+ while (1) { -+ errn = read(pipefd[0], errbuf + errp, EBUFSIZ - errp); -+ if (errn == -1 && errno == EINTR) -+ continue; -+ break; -+ } -+ -+ if (errn > 0) { -+ errp += errn; -+ -+ sp = errbuf; -+ while (errp && (p = memchr(sp, '\n', errp))) { -+ *p++ = '\0'; -+ errp -= (p - sp); -+ sp = p; -+ } -+ -+ if (errp && sp != errbuf) -+ memmove(errbuf, sp, errp); -+ -+ if (errp >= EBUFSIZ) { -+ /* Line too long, split */ -+ errbuf[errp] = '\0'; -+ if ((s_ver = strstr(errbuf, "nfs-utils"))) { -+ if (extract_version(s_ver, vers)) -+ ret = 1; -+ } -+ errp = 0; -+ } -+ -+ if ((s_ver = strstr(errbuf, "nfs-utils"))) { -+ if (extract_version(s_ver, vers)) -+ ret = 1; -+ } -+ } -+ } while (errn > 0); -+ -+ close(pipefd[0]); -+ -+ if (errp > 0) { -+ /* End of file without \n */ -+ errbuf[errp] = '\0'; -+ if ((s_ver = strstr(errbuf, "nfs-utils"))) { -+ if (extract_version(s_ver, vers)) -+ ret = 1; -+ } -+ } -+ -+ if (ret) { -+ if (vers->major == check->major && -+ vers->minor == check->minor && -+ vers->fix == check->fix) -+ ; -+ else { -+ if (vers->major < check->major) -+ ret = 0; -+ else if (vers->minor < check->minor) -+ ret = 0; -+ else if (vers->fix < check->fix) -+ ret = 0; -+ } -+ } -+ -+ if (waitpid(f, &status, 0) != f) ; -+ -+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL); -+ pthread_setcancelstate(cancel_state, NULL); -+ -+ return ret; -+} -+#else -+int check_nfs_mount_version(struct nfs_mount_vers *vers, -+ struct nfs_mount_vers *check) -+{ -+ return 0; -+} -+#endif -+ - /* - * Make common autofs mount options string - */ diff --git a/autofs-5.0.6-add-function-to-delete-offset-cache-entry.patch b/autofs-5.0.6-add-function-to-delete-offset-cache-entry.patch deleted file mode 100644 index 977bb11..0000000 --- a/autofs-5.0.6-add-function-to-delete-offset-cache-entry.patch +++ /dev/null @@ -1,84 +0,0 @@ -autofs-5.0.6 - add function to delete offset cache entry - -From: Ian Kent - -Currently only the entire expanded list of offset cache entries may be -removed from the cache. In order to be able to update already expanded -multi map offset entries we need to be able to delete them. ---- - - include/automount.h | 1 + - lib/cache.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 48 insertions(+), 0 deletions(-) - - -diff --git a/include/automount.h b/include/automount.h -index e1246e3..40c1975 100644 ---- a/include/automount.h -+++ b/include/automount.h -@@ -192,6 +192,7 @@ int cache_add_offset(struct mapent_cache *mc, const char *mkey, const char *key, - 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); -+int cache_delete_offset(struct mapent_cache *mc, const char *key); - void cache_multi_readlock(struct mapent *me); - void cache_multi_writelock(struct mapent *me); - void cache_multi_unlock(struct mapent *me); -diff --git a/lib/cache.c b/lib/cache.c -index 3464e7d..1489273 100644 ---- a/lib/cache.c -+++ b/lib/cache.c -@@ -771,6 +771,53 @@ int cache_update(struct mapent_cache *mc, struct map_source *ms, const char *key - return ret; - } - -+/* cache_multi_lock of the multi mount owner must be held by caller */ -+int cache_delete_offset(struct mapent_cache *mc, const char *key) -+{ -+ u_int32_t hashval = hash(key, mc->size); -+ struct mapent *me = NULL, *pred; -+ int status; -+ -+ me = mc->hash[hashval]; -+ if (!me) -+ return CHE_FAIL; -+ -+ if (strcmp(key, me->key) == 0) { -+ if (me->multi && me->multi == me) -+ return CHE_FAIL; -+ mc->hash[hashval] = me->next; -+ goto delete; -+ } -+ -+ while (me->next != NULL) { -+ pred = me; -+ me = me->next; -+ if (strcmp(key, me->key) == 0) { -+ if (me->multi && me->multi == me) -+ return CHE_FAIL; -+ pred->next = me->next; -+ goto delete; -+ } -+ } -+ -+ return CHE_FAIL; -+ -+delete: -+ status = pthread_rwlock_destroy(&me->multi_rwlock); -+ if (status) -+ fatal(status); -+ list_del(&me->multi_list); -+ ino_index_lock(mc); -+ list_del(&me->ino_index); -+ ino_index_unlock(mc); -+ free(me->key); -+ if (me->mapent) -+ free(me->mapent); -+ free(me); -+ -+ return CHE_OK; -+} -+ - /* cache must be write locked by caller */ - int cache_delete(struct mapent_cache *mc, const char *key) - { diff --git a/autofs-5.0.6-add-hup-signal-handling-to-hosts-map.patch b/autofs-5.0.6-add-hup-signal-handling-to-hosts-map.patch deleted file mode 100644 index 491612c..0000000 --- a/autofs-5.0.6-add-hup-signal-handling-to-hosts-map.patch +++ /dev/null @@ -1,498 +0,0 @@ -autofs-5.0.6 - add hup signal handling to hosts map - -From: Ian Kent - -Add HUP signal handling to the internal hosts lookup module. ---- - - CHANGELOG | 1 - daemon/direct.c | 4 - - include/mounts.h | 1 - lib/mounts.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++- - man/auto.master.5.in | 5 + - man/autofs.5 | 8 +- - modules/lookup_hosts.c | 97 ++++++++++++++++++++++++----- - modules/parse_sun.c | 9 ++ - 8 files changed, 262 insertions(+), 25 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -57,6 +57,7 @@ - - fix offset mount point directory removal. - - fix remount of multi mount. - - fix devce ioctl alloc path check. -+- add hup signal handling to hosts map. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/direct.c -+++ autofs-5.0.6/daemon/direct.c -@@ -654,7 +654,9 @@ int mount_autofs_offset(struct autofs_po - ret = try_remount(ap, me, t_offset); - if (ret == 1) - return MOUNT_OFFSET_OK; -- return MOUNT_OFFSET_FAIL; -+ /* Offset mount not found, fall thru and try to mount it */ -+ if (!(ret == -1 && errno == ENOENT)) -+ return MOUNT_OFFSET_FAIL; - } else { - /* - if (is_mounted(_PROC_MOUNTS, me->key, MNTS_AUTOFS)) { ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -112,5 +112,6 @@ int try_remount(struct autofs_point *, s - int umount_ent(struct autofs_point *, const char *); - int mount_multi_triggers(struct autofs_point *, struct mapent *, const char *, unsigned int, const char *); - int umount_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *); -+int clean_stale_multi_triggers(struct autofs_point *, struct mapent *, char *, const char *); - - #endif ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1436,6 +1436,7 @@ static int remount_active_mount(struct a - - /* Re-reading the map, set timeout and return */ - if (ap->state == ST_READMAP) { -+ debug(ap->logopt, "already mounted, update timeout"); - ops->timeout(ap->logopt, fd, timeout); - ops->close(ap->logopt, fd); - return REMOUNT_READ_MAP; -@@ -1550,7 +1551,9 @@ int try_remount(struct autofs_point *ap, - * record that in the mount point struct. Otherwise we're - * re-reading the map. - */ -- if (ret == REMOUNT_SUCCESS || ret == REMOUNT_READ_MAP) { -+ if (ret == REMOUNT_READ_MAP) -+ return 1; -+ else if (ret == REMOUNT_SUCCESS) { - if (fd != -1) { - if (type == t_indirect) - ap->ioctlfd = fd; -@@ -1781,5 +1784,162 @@ int umount_multi_triggers(struct autofs_ - } - - return left; -+} -+ -+int clean_stale_multi_triggers(struct autofs_point *ap, -+ struct mapent *me, char *top, const char *base) -+{ -+ char *root; -+ char mm_top[PATH_MAX + 1]; -+ char path[PATH_MAX + 1]; -+ char buf[MAX_ERR_BUF]; -+ char *offset; -+ struct mapent *oe; -+ struct list_head *mm_root, *pos; -+ const char o_root[] = "/"; -+ const char *mm_base; -+ int left, start; -+ time_t age; -+ -+ if (top) -+ root = top; -+ else { -+ if (!strchr(me->multi->key, '/')) -+ /* Indirect multi-mount root */ -+ /* sprintf okay - if it's mounted, it's -+ * PATH_MAX or less bytes */ -+ sprintf(mm_top, "%s/%s", ap->path, me->multi->key); -+ else -+ strcpy(mm_top, me->multi->key); -+ root = mm_top; -+ } -+ -+ left = 0; -+ start = strlen(root); -+ -+ mm_root = &me->multi->multi_list; -+ -+ if (!base) -+ mm_base = o_root; -+ else -+ mm_base = base; -+ -+ pos = NULL; -+ offset = path; -+ age = me->multi->age; -+ -+ while ((offset = cache_get_offset(mm_base, offset, start, mm_root, &pos))) { -+ char *oe_base; -+ char *key; -+ int ret; -+ -+ oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list); -+ /* root offset is a special case */ -+ if (!oe || !oe->mapent || (strlen(oe->key) - start) == 1) -+ continue; -+ -+ /* Check for and umount stale subtree offsets */ -+ oe_base = oe->key + strlen(root); -+ ret = clean_stale_multi_triggers(ap, oe, root, oe_base); -+ left =+ ret; -+ if (ret) -+ continue; -+ -+ if (oe->age == age) -+ continue; -+ -+ /* -+ * If an offset that has an active mount has been removed -+ * from the multi-mount we don't want to attempt to trigger -+ * mounts for it. Obviously this is because it has been -+ * removed, but less obvious is the potential strange -+ * behaviour that can result if we do try and mount it -+ * again after it's been expired. For example, if an NFS -+ * file system is no longer exported and is later umounted -+ * it can be mounted again without any error message but -+ * shows as an empty directory. That's going to confuse -+ * people for sure. -+ * -+ * If the mount cannot be umounted (the process is now -+ * using a stale mount) the offset needs to be invalidated -+ * so no further mounts will be attempted but the offset -+ * cache entry must remain so expires can continue to -+ * attempt to umount it. If the mount can be umounted and -+ * the offset is removed, at least for NFS we will get -+ * ESTALE errors when attempting list the directory. -+ */ -+ if (oe->ioctlfd != -1 || -+ is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { -+ if (umount_ent(ap, oe->key)) { -+ debug(ap->logopt, -+ "offset %s has active mount, invalidate", -+ oe->key); -+ if (oe->mapent) { -+ free(oe->mapent); -+ oe->mapent = NULL; -+ } -+ left++; -+ continue; -+ } -+ } -+ -+ key = strdup(oe->key); -+ if (!key) { -+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ error(ap->logopt, "malloc: %s", estr); -+ left++; -+ continue; -+ } -+ -+ debug(ap->logopt, "umount offset %s", oe->key); -+ -+ if (umount_autofs_offset(ap, oe)) { -+ warn(ap->logopt, "failed to umount offset %s", key); -+ left++; -+ } else { -+ struct stat st; -+ -+ /* Mount point not ours to delete ? */ -+ if (!(oe->flags & MOUNT_FLAG_DIR_CREATED)) { -+ debug(ap->logopt, "delete offset key %s", key); -+ if (cache_delete_offset(oe->mc, key) == CHE_FAIL) -+ error(ap->logopt, -+ "failed to delete offset key %s", key); -+ free(key); -+ continue; -+ } -+ -+ /* -+ * An error due to partial directory removal is -+ * ok so only try and remount the offset if the -+ * actual mount point still exists. -+ */ -+ ret = rmdir_path(ap, oe->key, ap->dev); -+ if (ret == -1 && !stat(oe->key, &st)) { -+ ret = do_mount_autofs_offset(ap, oe, root, offset); -+ if (ret) { -+ left++; -+ free(key); -+ continue; -+ } -+ /* -+ * Fall through if the trigger can't be mounted -+ * again, since there is no offset there can't -+ * be any mount requests so remove the map -+ * entry from the cache. There's now a dead -+ * offset mount, but what else can we do .... -+ */ -+ } -+ -+ debug(ap->logopt, "delete offset key %s", key); -+ -+ if (cache_delete_offset(oe->mc, key) == CHE_FAIL) -+ error(ap->logopt, -+ "failed to delete offset key %s", key); -+ } -+ free(key); -+ } -+ -+ return left; - } - ---- autofs-5.0.6.orig/man/auto.master.5.in -+++ autofs-5.0.6/man/auto.master.5.in -@@ -220,7 +220,10 @@ set default log level "none", "verbose" - .SH BUILTIN MAP -hosts - If "-hosts" is given as the map then accessing a key under the mount point - which corresponds to a hostname will allow access to the exports of that --host. -+host. The hosts map cannot be dynamically updated and requires a HUP signal -+to be sent to the daemon for it to check hosts for an update. Due to possible -+hierarchic dependencies within a mount tree, it might not be completely -+updated during the HUP signal processing. - .P - For example, with an entry in the master map of - .nh ---- autofs-5.0.6.orig/man/autofs.5 -+++ autofs-5.0.6/man/autofs.5 -@@ -13,10 +13,10 @@ These maps describe how file systems bel - map format; if another map format is specified (e.g. \fBhesiod\fP), - this documentation does not apply. - --Indirect maps can be changed on the fly and the automouter will recognize --those changes on the next operation it performs on that map. Direct maps --require a HUP signal be sent to the daemon to refresh their contents as does --the master map. -+Indirect maps, except for the internal hosts map, can be changed on the fly -+and the automouter will recognize those changes on the next operation it -+performs on that map. Direct maps require a HUP signal be sent to the -+daemon to refresh their contents as does the master map. - .SH "FORMAT" - This is a description of the text file format. Other methods of specifying - these files may exist. All empty lines or lines beginning with # are ---- autofs-5.0.6.orig/modules/lookup_hosts.c -+++ autofs-5.0.6/modules/lookup_hosts.c -@@ -80,10 +80,11 @@ int lookup_read_master(struct master *ma - - static char *get_exports(struct autofs_point *ap, const char *host) - { -- char *mapent = NULL; -+ char buf[MAX_ERR_BUF]; -+ char *mapent; - exports exp; - -- debug(ap->logopt, MODPREFIX "fetchng export list for %s", name); -+ debug(ap->logopt, MODPREFIX "fetchng export list for %s", host); - - exp = rpc_get_exports(host, 10, 0, RPC_CLOSE_NOLINGER); - -@@ -92,20 +93,20 @@ static char *get_exports(struct autofs_p - if (mapent) { - int len = strlen(mapent) + 1; - -- len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3; -+ len += strlen(host) + 2*(strlen(exp->ex_dir) + 2) + 3; - mapent = realloc(mapent, len); - if (!mapent) { - char *estr; - estr = strerror_r(errno, buf, MAX_ERR_BUF); - error(ap->logopt, MODPREFIX "malloc: %s", estr); - rpc_exports_free(exp); -- return NSS_STATUS_UNAVAIL; -+ return NULL; - } - strcat(mapent, " \""); - strcat(mapent, exp->ex_dir); - strcat(mapent, "\""); - } else { -- int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3; -+ int len = 2*(strlen(exp->ex_dir) + 2) + strlen(host) + 3; - - mapent = malloc(len); - if (!mapent) { -@@ -113,14 +114,14 @@ static char *get_exports(struct autofs_p - estr = strerror_r(errno, buf, MAX_ERR_BUF); - error(ap->logopt, MODPREFIX "malloc: %s", estr); - rpc_exports_free(exp); -- return NSS_STATUS_UNAVAIL; -+ return NULL; - } - strcpy(mapent, "\""); - strcat(mapent, exp->ex_dir); - strcat(mapent, "\""); - } - strcat(mapent, " \""); -- strcat(mapent, name); -+ strcat(mapent, host); - strcat(mapent, ":"); - strcat(mapent, exp->ex_dir); - strcat(mapent, "\""); -@@ -130,14 +131,14 @@ static char *get_exports(struct autofs_p - rpc_exports_free(exp); - - if (!mapent) -- error(ap->logopt, "exports lookup failed for %s", name); -+ error(ap->logopt, MODPREFIX "exports lookup failed for %s", host); - - return mapent; - } - --static int do_parse_mount(struct autofs_point *ap, -+static int do_parse_mount(struct autofs_point *ap, struct map_source *source, - const char *name, int name_len, char *mapent, -- void *context) -+ struct lookup_context *ctxt) - { - int ret; - -@@ -166,8 +167,68 @@ static int do_parse_mount(struct autofs_ - return NSS_STATUS_SUCCESS; - } - -+static int update_hosts_mounts(struct autofs_point *ap, -+ struct map_source *source, time_t age, -+ struct lookup_context *ctxt) -+{ -+ struct mapent_cache *mc; -+ struct mapent *me; -+ char *mapent; -+ int ret; -+ -+ mc = source->mc; -+ -+ pthread_cleanup_push(cache_lock_cleanup, mc); -+ cache_writelock(mc); -+ me = cache_lookup_first(mc); -+ while (me) { -+ /* Hosts map entry not yet expanded or already expired */ -+ if (!me->multi) -+ goto next; -+ -+ debug(ap->logopt, MODPREFIX "get list of exports for %s", me->key); -+ -+ mapent = get_exports(ap, me->key); -+ if (mapent) { -+ cache_update(mc, source, me->key, mapent, age); -+ free(mapent); -+ } -+next: -+ me = cache_lookup_next(mc, me); -+ } -+ pthread_cleanup_pop(1); -+ -+ pthread_cleanup_push(cache_lock_cleanup, mc); -+ cache_readlock(mc); -+ me = cache_lookup_first(mc); -+ while (me) { -+ /* -+ * Hosts map entry not yet expanded, already expired -+ * or not the base of the tree -+ */ -+ if (!me->multi || me->multi != me) -+ goto cont; -+ -+ debug(ap->logopt, MODPREFIX -+ "attempt to update exports for exports for %s", me->key); -+ -+ master_source_current_wait(ap->entry); -+ ap->entry->current = source; -+ ap->flags |= MOUNT_FLAG_REMOUNT; -+ ret = ctxt->parse->parse_mount(ap, me->key, strlen(me->key), -+ me->mapent, ctxt->parse->context); -+ ap->flags &= ~MOUNT_FLAG_REMOUNT; -+cont: -+ me = cache_lookup_next(mc, me); -+ } -+ pthread_cleanup_pop(1); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ - int lookup_read_map(struct autofs_point *ap, time_t age, void *context) - { -+ struct lookup_context *ctxt = (struct lookup_context *) context; - struct map_source *source; - struct mapent_cache *mc; - struct hostent *host; -@@ -177,18 +238,23 @@ int lookup_read_map(struct autofs_point - ap->entry->current = NULL; - master_source_current_signal(ap->entry); - -+ mc = source->mc; -+ -+ debug(ap->logopt, MODPREFIX "read hosts map"); -+ - /* - * If we don't need to create directories then there's no use - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ - if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -- debug(ap->logopt, "map read not needed, so not done"); -+ debug(ap->logopt, MODPREFIX -+ "map not browsable, update existing host entries only"); -+ update_hosts_mounts(ap, source, age, ctxt); -+ source->age = age; - return NSS_STATUS_SUCCESS; - } - -- mc = source->mc; -- - status = pthread_mutex_lock(&hostent_mutex); - if (status) { - error(ap->logopt, MODPREFIX "failed to lock hostent mutex"); -@@ -209,6 +275,7 @@ int lookup_read_map(struct autofs_point - if (status) - error(ap->logopt, MODPREFIX "failed to unlock hostent mutex"); - -+ update_hosts_mounts(ap, source, age, ctxt); - source->age = age; - - return NSS_STATUS_SUCCESS; -@@ -220,11 +287,9 @@ int lookup_mount(struct autofs_point *ap - struct map_source *source; - struct mapent_cache *mc; - struct mapent *me; -- char buf[MAX_ERR_BUF]; - char *mapent = NULL; - int mapent_len; - time_t now = time(NULL); -- exports exp; - int ret; - - source = ap->entry->current; -@@ -320,7 +385,7 @@ done: - cache_unlock(mc); - } - -- ret = do_parse_mount(ap, name, name_len, mapent, ctxt->parse->context); -+ ret = do_parse_mount(ap, source, name, name_len, mapent, ctxt); - - free(mapent); - ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -1355,7 +1355,7 @@ int parse_mount(struct autofs_point *ap, - if (check_is_multi(p)) { - char *m_root = NULL; - int m_root_len; -- time_t age = time(NULL); -+ time_t age; - int l; - - /* If name starts with "/" it's a direct mount */ -@@ -1399,6 +1399,8 @@ int parse_mount(struct autofs_point *ap, - return 1; - } - -+ age = me->age; -+ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state); - cache_multi_writelock(me); - /* It's a multi-mount; deal with it */ -@@ -1472,8 +1474,11 @@ int parse_mount(struct autofs_point *ap, - - /* - * We've got the ordered list of multi-mount entries so go -- * through and set the parent entry of each -+ * through and remove any stale entries if this is the top -+ * of the multi-mount and set the parent entry of each. - */ -+ if (me == me->multi) -+ clean_stale_multi_triggers(ap, me, NULL, NULL); - cache_set_parents(me); - - rv = mount_subtree(ap, me, name, NULL, options, ctxt); diff --git a/autofs-5.0.6-add-kernel-verion-check-function.patch b/autofs-5.0.6-add-kernel-verion-check-function.patch deleted file mode 100644 index 7309178..0000000 --- a/autofs-5.0.6-add-kernel-verion-check-function.patch +++ /dev/null @@ -1,55 +0,0 @@ -autofs-5.0.6 - add kernel verion check function - -From: Ian Kent - -Add a function to check kernel version. ---- - - CHANGELOG | 1 + - include/mounts.h | 17 +++++++++++++++++ - 2 files changed, 18 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -24,6 +24,7 @@ - - add sss lookup module. - - teach automount about sss source. - - ignore duplicate exports in auto.net. -+- add kernel verion check function. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -16,6 +16,9 @@ - #ifndef MOUNTS_H - #define MOUNTS_H - -+#include -+#include -+ - #ifndef AUTOFS_TYPE_ANY - #define AUTOFS_TYPE_ANY 0x0000 - #endif -@@ -72,6 +75,20 @@ struct mnt_list { - struct list_head ordered; - }; - -+static inline unsigned int linux_version_code(void) -+{ -+ struct utsname my_utsname; -+ unsigned int p, q, r; -+ -+ if (uname(&my_utsname)) -+ return 0; -+ -+ p = (unsigned int)atoi(strtok(my_utsname.release, ".")); -+ q = (unsigned int)atoi(strtok(NULL, ".")); -+ r = (unsigned int)atoi(strtok(NULL, ".")); -+ return KERNEL_VERSION(p, q, r); -+} -+ - unsigned int query_kproto_ver(void); - unsigned int get_kver_major(void); - unsigned int get_kver_minor(void); diff --git a/autofs-5.0.6-add-piddir-to-configure.patch b/autofs-5.0.6-add-piddir-to-configure.patch deleted file mode 100644 index 9fa90a0..0000000 --- a/autofs-5.0.6-add-piddir-to-configure.patch +++ /dev/null @@ -1,145 +0,0 @@ -autofs-5.0.5 - add piddir to configure - -From: Ian Kent - -In order to accomodate possible changes or different pid file -locations add directory selection for pid file directory to -configure. Also update the fifo directory and flag file directory -configure checks. ---- - - CHANGELOG | 1 + - Makefile.conf.in | 3 +++ - aclocal.m4 | 20 ++++++++++++++++++-- - configure | 4 ++-- - redhat/Makefile | 1 + - redhat/autofs.init.in | 4 ++-- - samples/Makefile | 2 +- - 7 files changed, 28 insertions(+), 7 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -16,6 +16,7 @@ - - fix ipv6 name lookup check. - - fix ipv6 rpc calls. - - fix ipv6 configure check. -+- add piddir to configure. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/Makefile.conf.in -+++ autofs-5.0.6/Makefile.conf.in -@@ -79,6 +79,9 @@ autofsconfdir = @confdir@ - # Location for autofs maps - autofsmapdir = @mapdir@ - -+# Localtion of pid files -+autofspiddir = @piddir@ -+ - # Location for autofs fifos - autofsfifodir = @fifodir@ - ---- autofs-5.0.6.orig/aclocal.m4 -+++ autofs-5.0.6/aclocal.m4 -@@ -121,13 +121,29 @@ AC_DEFUN(AF_MAP_D, - fi]) - - dnl -------------------------------------------------------------------------- -+dnl AF_PID_D -+dnl -+dnl Check the location of the pid file directory. -+dnl -------------------------------------------------------------------------- -+AC_DEFUN(AF_PID_D, -+[if test -z "$piddir"; then -+ for pid_d in /run /var/run /tmp; do -+ if test -z "$piddir"; then -+ if test -d "$pid_d"; then -+ piddir="$pid_d" -+ fi -+ fi -+ done -+fi]) -+ -+dnl -------------------------------------------------------------------------- - dnl AF_FIFO_D - dnl - dnl Check the location of the autofs fifos directory - dnl -------------------------------------------------------------------------- - AC_DEFUN(AF_FIFO_D, - [if test -z "$fifodir"; then -- for fifo_d in /var/run /tmp; do -+ for fifo_d in /run /var/run /tmp; do - if test -z "$fifodir"; then - if test -d "$fifo_d"; then - fifodir="$fifo_d" -@@ -143,7 +159,7 @@ dnl Check the location of the autofs fla - dnl -------------------------------------------------------------------------- - AC_DEFUN(AF_FLAG_D, - [if test -z "$flagdir"; then -- for flag_d in /var/run /tmp; do -+ for flag_d in /run /var/run /tmp; do - if test -z "$flagdir"; then - if test -d "$flag_d"; then - flagdir="$flag_d" ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -2184,7 +2184,7 @@ $as_echo "$mapdir" >&6; } - # The user can specify --with-fifodir=PATH to specify where autofs fifos go - # - if test -z "$fifodir"; then -- for fifo_d in /var/run /tmp; do -+ for fifo_d in /run /var/run /tmp; do - if test -z "$fifodir"; then - if test -d "$fifo_d"; then - fifodir="$fifo_d" -@@ -2214,7 +2214,7 @@ $as_echo "$fifodir" >&6; } - # The user can specify --with-flagdir=PATH to specify where autofs flag file goes - # - if test -z "$flagdir"; then -- for flag_d in /var/run /tmp; do -+ for flag_d in /run /var/run /tmp; do - if test -z "$flagdir"; then - if test -d "$flag_d"; then - flagdir="$flag_d" ---- autofs-5.0.6.orig/redhat/Makefile -+++ autofs-5.0.6/redhat/Makefile -@@ -8,6 +8,7 @@ autofs.init: autofs.init.in - sed -e "s|@@sbindir@@|$(sbindir)|g" \ - -e "s|@@autofslibdir@@|$(autofslibdir)|g" \ - -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \ -+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \ - -e "s|@@initdir@@|$(initdir)|g" < autofs.init.in > autofs.init - - autofs.sysconfig: autofs.sysconfig.in ---- autofs-5.0.6.orig/redhat/autofs.init.in -+++ autofs-5.0.6/redhat/autofs.init.in -@@ -86,7 +86,7 @@ function start() { - fi - - echo -n $"Starting $prog: " -- $prog $OPTIONS --pid-file /var/run/autofs.pid -+ $prog $OPTIONS --pid-file @@autofspiddir@@/autofs.pid - RETVAL=$? - if [ $RETVAL -eq 0 ] ; then - success "$prog startup" -@@ -171,7 +171,7 @@ case "$1" in - stop - ;; - status) -- status -p /var/run/autofs.pid -l autofs $prog -+ status -p @@autofspiddir@@/autofs.pid -l autofs $prog - ;; - restart|force-reload) - restart ---- autofs-5.0.6.orig/samples/Makefile -+++ autofs-5.0.6/samples/Makefile -@@ -21,7 +21,7 @@ dirs: - install -d -m 755 $(INSTALLROOT)$(autofsmapdir) - install -d -m 755 $(INSTALLROOT)$(autofsconfdir) - install -d -m 755 $(INSTALLROOT)$(autofslibdir) -- install -d -m 755 $(INSTALLROOT)/var/run/autofs -+ install -d -m 755 $(INSTALLROOT)$(autofspiddir) - - .PHONY: autofs.init - autofs.init: diff --git a/autofs-5.0.6-add-sss-lookup-module.patch b/autofs-5.0.6-add-sss-lookup-module.patch deleted file mode 100644 index 8dd7b6f..0000000 --- a/autofs-5.0.6-add-sss-lookup-module.patch +++ /dev/null @@ -1,1676 +0,0 @@ -autofs-5.0.6 - add sss lookup module - -From: Ian Kent - -Add a lookup module (initial implementation) to handle lookups for -an sssd source. - -The % hack for mixed case map keys present in case insensitive schema -still needs to be implemented. ---- - - CHANGELOG | 1 - Makefile.conf.in | 6 - aclocal.m4 | 24 + - configure | 238 ++++++++++------- - configure.in | 4 - modules/Makefile | 6 - modules/lookup_sss.c | 678 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 7 files changed, 860 insertions(+), 97 deletions(-) - create mode 100644 modules/lookup_sss.c - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -21,6 +21,7 @@ - - remove empty command line arguments (passed by systemd). - - fix improve mount location error reporting. - - fix rpc build error. -+- add sss lookup module. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/Makefile.conf.in -+++ autofs-5.0.6/Makefile.conf.in -@@ -25,6 +25,9 @@ LDAP = @HAVE_LDAP@ - LIBLDAP= @LIBLDAP@ - LDAP_FLAGS = @LDAP_FLAGS@ - -+# sssd support -+SSSD = @HAVE_SSS_AUTOFS@ -+ - # SASL support: yes (1) no (0) - XML_LIBS = @XML_LIBS@ - XML_FLAGS = @XML_FLAGS@ -@@ -70,6 +73,9 @@ DMALLOCLIB = @DMALLOCLIB@ - prefix = @prefix@ - exec_prefix = @exec_prefix@ - -+# SSS library module directory -+ssslibdir=@sssldir@ -+ - # Directory for autofs modules - autofslibdir = @libdir@/autofs - ---- autofs-5.0.6.orig/aclocal.m4 -+++ autofs-5.0.6/aclocal.m4 -@@ -32,6 +32,30 @@ fi - AC_SUBST(PATH_$1)]) - - dnl -------------------------------------------------------------------------- -+dnl AF_CHECK_SSS_LIB: -+dnl -+dnl Check if a sss autofs library exists. -+dnl -------------------------------------------------------------------------- -+AC_DEFUN(AF_CHECK_SSS_LIB, -+[if test -z $sssldir; then -+ AC_MSG_CHECKING(for sssd autofs library) -+ for libd in /usr/lib64 /usr/lib; do -+ if test -z $sssldir; then -+ if test -e "$libd/sssd/modules/$2"; then -+ sssldir=$libd/sssd/modules -+ fi -+ fi -+ done -+ if test -n $sssldir; then -+ HAVE_$1=1 -+ AC_MSG_RESULT(yes) -+ else -+ HAVE_$1=0 -+ AC_MSG_RESULT(no) -+ fi -+fi]) -+ -+dnl -------------------------------------------------------------------------- - dnl AF_SLOPPY_MOUNT - dnl - dnl Check to see if mount(8) supports the sloppy (-s) option, and define ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.66. -+# Generated by GNU Autoconf 2.68. - # - # - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -@@ -89,6 +89,7 @@ fi - IFS=" "" $as_nl" - - # Find who we are. Look in the path if we contain no directory separator. -+as_myself= - case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -@@ -214,11 +215,18 @@ IFS=$as_save_IFS - # 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 -- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -+ 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+"$@"} - fi - - if test x$as_have_required = xno; then : -@@ -617,6 +625,8 @@ LIBRESOLV - LIBNSL - KRB5_CONFIG - XML_CONFIG -+sssldir -+HAVE_SSS_AUTOFS - PATH_RPCGEN - RPCGEN - PATH_RANLIB -@@ -782,8 +792,9 @@ do - fi - - case $ac_option in -- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -- *) ac_optarg=yes ;; -+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -+ *=) ac_optarg= ;; -+ *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. -@@ -1123,7 +1134,7 @@ Try \`$0 --help' for more information" - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 -- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} -+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -@@ -1430,7 +1441,7 @@ test -n "$ac_init_help" && exit $ac_stat - if $ac_init_version; then - cat <<\_ACEOF - configure --generated by GNU Autoconf 2.66 -+generated by GNU Autoconf 2.68 - - Copyright (C) 2010 Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation -@@ -1476,7 +1487,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 - fi -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - - } # ac_fn_c_try_compile -@@ -1522,7 +1533,7 @@ fi - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - - } # ac_fn_c_try_link -@@ -1548,7 +1559,7 @@ $as_echo "$ac_try_echo"; } >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; } >/dev/null && { -+ test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : -@@ -1559,7 +1570,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 - fi -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - - } # ac_fn_c_try_cpp -@@ -1572,10 +1583,10 @@ fi - ac_fn_c_check_header_mongrel () - { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- if eval "test \"\${$3+set}\"" = set; then : -+ if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 - $as_echo_n "checking for $2... " >&6; } --if eval "test \"\${$3+set}\"" = set; then : -+if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 - fi - eval ac_res=\$$3 -@@ -1611,7 +1622,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : - else - ac_header_preproc=no - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.i conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 - $as_echo "$ac_header_preproc" >&6; } - -@@ -1638,7 +1649,7 @@ $as_echo "$as_me: WARNING: $2: proceedin - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 - $as_echo_n "checking for $2... " >&6; } --if eval "test \"\${$3+set}\"" = set; then : -+if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=\$ac_header_compiler" -@@ -1647,7 +1658,7 @@ eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - fi -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - - } # ac_fn_c_check_header_mongrel - -@@ -1688,7 +1699,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status - fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - - } # ac_fn_c_try_run -@@ -1702,7 +1713,7 @@ ac_fn_c_check_header_compile () - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 - $as_echo_n "checking for $2... " >&6; } --if eval "test \"\${$3+set}\"" = set; then : -+if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -1720,7 +1731,7 @@ fi - eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } -- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - - } # ac_fn_c_check_header_compile - cat >config.log <<_ACEOF -@@ -1728,7 +1739,7 @@ This file contains any messages produced - running configure, to aid debugging if configure makes a mistake. - - It was created by $as_me, which was --generated by GNU Autoconf 2.66. Invocation command line was -+generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -@@ -2300,7 +2311,7 @@ if test -n "$ac_tool_prefix"; then - set dummy ${ac_tool_prefix}gcc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -2340,7 +2351,7 @@ if test -z "$ac_cv_prog_CC"; then - set dummy gcc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : -+if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -2393,7 +2404,7 @@ if test -z "$CC"; then - set dummy ${ac_tool_prefix}cc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -2433,7 +2444,7 @@ if test -z "$CC"; then - set dummy cc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -2492,7 +2503,7 @@ if test -z "$CC"; then - set dummy $ac_tool_prefix$ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -2536,7 +2547,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : -+if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -2819,7 +2830,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex - ac_clean_files=$ac_clean_files_save - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 - $as_echo_n "checking for suffix of object files... " >&6; } --if test "${ac_cv_objext+set}" = set; then : -+if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2870,7 +2881,7 @@ OBJEXT=$ac_cv_objext - ac_objext=$OBJEXT - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 - $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } --if test "${ac_cv_c_compiler_gnu+set}" = set; then : -+if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2907,7 +2918,7 @@ ac_test_CFLAGS=${CFLAGS+set} - ac_save_CFLAGS=$CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 - $as_echo_n "checking whether $CC accepts -g... " >&6; } --if test "${ac_cv_prog_cc_g+set}" = set; then : -+if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_save_c_werror_flag=$ac_c_werror_flag -@@ -2985,7 +2996,7 @@ else - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 - $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } --if test "${ac_cv_prog_cc_c89+set}" = set; then : -+if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_cv_prog_cc_c89=no -@@ -3183,7 +3194,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_MOUNT+set}" = set; then : -+if ${ac_cv_path_MOUNT+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $MOUNT in -@@ -3243,7 +3254,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_UMOUNT+set}" = set; then : -+if ${ac_cv_path_UMOUNT+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $UMOUNT in -@@ -3303,7 +3314,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_E2FSCK+set}" = set; then : -+if ${ac_cv_path_E2FSCK+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $E2FSCK in -@@ -3362,7 +3373,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_E3FSCK+set}" = set; then : -+if ${ac_cv_path_E3FSCK+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $E3FSCK in -@@ -3421,7 +3432,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_E4FSCK+set}" = set; then : -+if ${ac_cv_path_E4FSCK+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $E4FSCK in -@@ -3480,7 +3491,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_MODPROBE+set}" = set; then : -+if ${ac_cv_path_MODPROBE+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $MODPROBE in -@@ -3540,7 +3551,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_LEX+set}" = set; then : -+if ${ac_cv_path_LEX+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $LEX in -@@ -3596,7 +3607,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_YACC+set}" = set; then : -+if ${ac_cv_path_YACC+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $YACC in -@@ -3652,7 +3663,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_RANLIB+set}" = set; then : -+if ${ac_cv_path_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $RANLIB in -@@ -3708,7 +3719,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_RPCGEN+set}" = set; then : -+if ${ac_cv_path_RPCGEN+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $RPCGEN in -@@ -3759,6 +3770,29 @@ else - fi - - -+if test -z $sssldir; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sssd autofs library" >&5 -+$as_echo_n "checking for sssd autofs library... " >&6; } -+ for libd in /usr/lib64 /usr/lib; do -+ if test -z $sssldir; then -+ if test -e "$libd/sssd/modules/libsss_autofs.so"; then -+ sssldir=$libd/sssd/modules -+ fi -+ fi -+ done -+ if test -n $sssldir; then -+ HAVE_SSS_AUTOFS=1 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ HAVE_SSS_AUTOFS=0 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ fi -+fi -+ -+ -+ - # - # Newer mounts have the -s (sloppy) option to ignore unknown options, - # good for portability -@@ -3785,7 +3819,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_XML_CONFIG+set}" = set; then : -+if ${ac_cv_path_XML_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $XML_CONFIG in -@@ -3860,7 +3894,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then : -+if ${ac_cv_path_KRB5_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 - else - case $KRB5_CONFIG in -@@ -3920,7 +3954,7 @@ fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yp_match in -lnsl" >&5 - $as_echo_n "checking for yp_match in -lnsl... " >&6; } --if test "${ac_cv_lib_nsl_yp_match+set}" = set; then : -+if ${ac_cv_lib_nsl_yp_match+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -3954,7 +3988,7 @@ LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_match" >&5 - $as_echo "$ac_cv_lib_nsl_yp_match" >&6; } --if test "x$ac_cv_lib_nsl_yp_match" = x""yes; then : -+if test "x$ac_cv_lib_nsl_yp_match" = xyes; then : - LIBNSL="-lnsl" - fi - -@@ -3962,7 +3996,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_query in -lresolv" >&5 - $as_echo_n "checking for res_query in -lresolv... " >&6; } --if test "${ac_cv_lib_resolv_res_query+set}" = set; then : -+if ${ac_cv_lib_resolv_res_query+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -3996,7 +4030,7 @@ LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_query" >&5 - $as_echo "$ac_cv_lib_resolv_res_query" >&6; } --if test "x$ac_cv_lib_resolv_res_query" = x""yes; then : -+if test "x$ac_cv_lib_resolv_res_query" = xyes; then : - LIBRESOLV="-lresolv" - fi - -@@ -4088,7 +4122,7 @@ if test -n "$CPP" && test -d "$CPP"; the - CPP= - fi - if test -z "$CPP"; then -- if test "${ac_cv_prog_CPP+set}" = set; then : -+ if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 - else - # Double quotes because CPP needs to be expanded -@@ -4118,7 +4152,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4134,11 +4168,11 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.i conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.i conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - break - fi -@@ -4177,7 +4211,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4193,11 +4227,11 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.i conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.err conftest.$ac_ext -+rm -f conftest.i conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - - else -@@ -4216,7 +4250,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 - $as_echo_n "checking for grep that handles long lines and -e... " >&6; } --if test "${ac_cv_path_GREP+set}" = set; then : -+if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -z "$GREP"; then -@@ -4279,7 +4313,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 - $as_echo_n "checking for egrep... " >&6; } --if test "${ac_cv_path_EGREP+set}" = set; then : -+if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 - else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 -@@ -4346,7 +4380,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 - $as_echo_n "checking for ANSI C header files... " >&6; } --if test "${ac_cv_header_stdc+set}" = set; then : -+if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -4474,7 +4508,7 @@ done - - - ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/nis.h" "ac_cv_header_rpcsvc_nis_h" "$ac_includes_default" --if test "x$ac_cv_header_rpcsvc_nis_h" = x""yes; then : -+if test "x$ac_cv_header_rpcsvc_nis_h" = xyes; then : - HAVE_NISPLUS=1 - fi - -@@ -4509,7 +4543,7 @@ if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" - LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5 - $as_echo_n "checking for ldap_initialize in -lldap... " >&6; } --if test "${ac_cv_lib_ldap_ldap_initialize+set}" = set; then : -+if ${ac_cv_lib_ldap_ldap_initialize+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -4543,7 +4577,7 @@ LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5 - $as_echo "$ac_cv_lib_ldap_ldap_initialize" >&6; } --if test "x$ac_cv_lib_ldap_ldap_initialize" = x""yes; then : -+if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes; then : - HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv" - fi - -@@ -4677,7 +4711,7 @@ then - HAVE_SASL=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sasl_client_start in -lsasl2" >&5 - $as_echo_n "checking for sasl_client_start in -lsasl2... " >&6; } --if test "${ac_cv_lib_sasl2_sasl_client_start+set}" = set; then : -+if ${ac_cv_lib_sasl2_sasl_client_start+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -4711,7 +4745,7 @@ LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_sasl_client_start" >&5 - $as_echo "$ac_cv_lib_sasl2_sasl_client_start" >&6; } --if test "x$ac_cv_lib_sasl2_sasl_client_start" = x""yes; then : -+if test "x$ac_cv_lib_sasl2_sasl_client_start" = xyes; then : - HAVE_SASL=1 LIBSASL="$LIBSASL -lsasl2" - fi - -@@ -4744,7 +4778,7 @@ if test -n "$ac_tool_prefix"; then - set dummy ${ac_tool_prefix}gcc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -4784,7 +4818,7 @@ if test -z "$ac_cv_prog_CC"; then - set dummy gcc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : -+if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -4837,7 +4871,7 @@ if test -z "$CC"; then - set dummy ${ac_tool_prefix}cc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -4877,7 +4911,7 @@ if test -z "$CC"; then - set dummy cc; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -4936,7 +4970,7 @@ if test -z "$CC"; then - set dummy $ac_tool_prefix$ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_CC+set}" = set; then : -+if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -4980,7 +5014,7 @@ do - set dummy $ac_prog; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : -+if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -5064,7 +5098,7 @@ done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 - $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } --if test "${ac_cv_c_compiler_gnu+set}" = set; then : -+if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -5101,7 +5135,7 @@ ac_test_CFLAGS=${CFLAGS+set} - ac_save_CFLAGS=$CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 - $as_echo_n "checking whether $CC accepts -g... " >&6; } --if test "${ac_cv_prog_cc_g+set}" = set; then : -+if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_save_c_werror_flag=$ac_c_werror_flag -@@ -5179,7 +5213,7 @@ else - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 - $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } --if test "${ac_cv_prog_cc_c89+set}" = set; then : -+if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_cv_prog_cc_c89=no -@@ -5432,7 +5466,7 @@ LTLIBOBJS=$ac_ltlibobjs - - - --: ${CONFIG_STATUS=./config.status} -+: "${CONFIG_STATUS=./config.status}" - ac_write_fail=0 - ac_clean_files_save=$ac_clean_files - ac_clean_files="$ac_clean_files $CONFIG_STATUS" -@@ -5533,6 +5567,7 @@ fi - IFS=" "" $as_nl" - - # Find who we are. Look in the path if we contain no directory separator. -+as_myself= - case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -@@ -5840,7 +5875,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # values after options handling. - ac_log=" - This file was extended by $as_me, which was --generated by GNU Autoconf 2.66. Invocation command line was -+generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS -@@ -5902,7 +5937,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - 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.66, -+configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - - Copyright (C) 2010 Free Software Foundation, Inc. -@@ -5920,11 +5955,16 @@ ac_need_defaults=: - while test $# != 0 - do - case $1 in -- --*=*) -+ --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; -+ --*=) -+ ac_option=`expr "X$1" : 'X\([^=]*\)='` -+ ac_optarg= -+ ac_shift=: -+ ;; - *) - ac_option=$1 - ac_optarg=$2 -@@ -5946,6 +5986,7 @@ do - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; -@@ -6041,9 +6082,10 @@ fi - # after its creation but before its name has been assigned to `$tmp'. - $debug || - { -- tmp= -+ tmp= ac_tmp= - trap 'exit_status=$? -- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -+ : "${ac_tmp:=$tmp}" -+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status - ' 0 - trap 'as_fn_exit 1' 1 2 13 15 - } -@@ -6051,12 +6093,13 @@ $debug || - - { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && -- test -n "$tmp" && test -d "$tmp" -+ test -d "$tmp" - } || - { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") - } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -+ac_tmp=$tmp - - # Set up the scripts for CONFIG_FILES section. - # No need to generate them if there are no CONFIG_FILES. -@@ -6078,7 +6121,7 @@ else - ac_cs_awk_cr=$ac_cr - fi - --echo 'BEGIN {' >"$tmp/subs1.awk" && -+echo 'BEGIN {' >"$ac_tmp/subs1.awk" && - _ACEOF - - -@@ -6106,7 +6149,7 @@ done - rm -f conf$$subs.sh - - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 --cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && - _ACEOF - sed -n ' - h -@@ -6154,7 +6197,7 @@ t delim - rm -f conf$$subs.awk - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - _ACAWK --cat >>"\$tmp/subs1.awk" <<_ACAWK && -+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -@@ -6186,7 +6229,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" - else - cat --fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ -+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 - _ACEOF - -@@ -6220,7 +6263,7 @@ fi # test -n "$CONFIG_FILES" - # No need to generate them if there are no CONFIG_HEADERS. - # This happens for instance with `./config.status Makefile'. - if test -n "$CONFIG_HEADERS"; then --cat >"$tmp/defines.awk" <<\_ACAWK || -+cat >"$ac_tmp/defines.awk" <<\_ACAWK || - BEGIN { - _ACEOF - -@@ -6232,8 +6275,8 @@ _ACEOF - # handling of long lines. - ac_delim='%!_!# ' - for ac_last_try in false false :; do -- ac_t=`sed -n "/$ac_delim/p" confdefs.h` -- if test -z "$ac_t"; then -+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h` -+ if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 -@@ -6353,7 +6396,7 @@ do - for ac_f - do - case $ac_f in -- -) ac_f="$tmp/stdin";; -+ -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. -@@ -6388,7 +6431,7 @@ $as_echo "$as_me: creating $ac_file" >&6 - esac - - case $ac_tag in -- *:-:* | *:-) cat >"$tmp/stdin" \ -+ *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; -@@ -6514,21 +6557,22 @@ s&@abs_builddir@&$ac_abs_builddir&;t t - s&@abs_top_builddir@&$ac_abs_top_builddir&;t t - $ac_datarootdir_hack - " --eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ -+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - - test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && -- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && -- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && -+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && -+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ -+ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' - which seems to be undefined. Please make sure it is defined" >&5 - $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' - which seems to be undefined. Please make sure it is defined" >&2;} - -- rm -f "$tmp/stdin" -+ rm -f "$ac_tmp/stdin" - case $ac_file in -- -) cat "$tmp/out" && rm -f "$tmp/out";; -- *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; -+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; -+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; -@@ -6539,20 +6583,20 @@ which seems to be undefined. Please mak - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ -- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" -- } >"$tmp/config.h" \ -+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" -+ } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then -+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 - $as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" -- mv "$tmp/config.h" "$ac_file" \ -+ mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ -- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ -+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; ---- autofs-5.0.6.orig/configure.in -+++ autofs-5.0.6/configure.in -@@ -148,6 +148,10 @@ AF_CHECK_PROG(YACC, bison, , $searchpath - AF_CHECK_PROG(RANLIB, ranlib, , $searchpath) - AF_CHECK_PROG(RPCGEN, rpcgen, , $searchpath) - -+AF_CHECK_SSS_LIB(SSS_AUTOFS, libsss_autofs.so) -+AC_SUBST(HAVE_SSS_AUTOFS) -+AC_SUBST(sssldir) -+ - # - # Newer mounts have the -s (sloppy) option to ignore unknown options, - # good for portability ---- autofs-5.0.6.orig/modules/Makefile -+++ autofs-5.0.6/modules/Makefile -@@ -47,6 +47,12 @@ ifeq ($(LDAP), 1) - endif - endif - -+ifeq ($(SSSD), 1) -+ CFLAGS += -DSSS_LIB_DIR=\"$(ssslibdir)\" -+ SRCS += lookup_sss.c -+ MODS += lookup_sss.so -+endif -+ - CFLAGS += -I../include -I../lib -fPIC -D_GNU_SOURCE - CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\" - CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\" ---- /dev/null -+++ autofs-5.0.6/modules/lookup_sss.c -@@ -0,0 +1,678 @@ -+/* ----------------------------------------------------------------------- * -+ * -+ * lookup_sss.c - module for Linux automount to query sss service -+ * -+ * Copyright 2012 Ian Kent -+ * Copyright 2012 Red Hat, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, -+ * USA; either version 2 of the License, or (at your option) any later -+ * version; incorporated herein by reference. -+ * -+ * ----------------------------------------------------------------------- */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MODULE_LOOKUP -+#include "automount.h" -+#include "nsswitch.h" -+ -+#define MAPFMT_DEFAULT "sun" -+ -+#define MODPREFIX "lookup(sss): " -+ -+#define SSS_SO_NAME "libsss_autofs" -+ -+int _sss_setautomntent(const char *, void **); -+int _sss_getautomntent_r(char **, char **, void *); -+int _sss_getautomntbyname_r(char *, char **, void *); -+int _sss_endautomntent(void **); -+ -+typedef int (*setautomntent_t) (const char *, void **); -+typedef int (*getautomntent_t) (char **, char **, void *); -+typedef int (*getautomntbyname_t) (char *, char **, void *); -+typedef int (*endautomntent_t) (void **); -+ -+struct lookup_context { -+ const char *mapname; -+ void *dlhandle; -+ setautomntent_t setautomntent; -+ getautomntent_t getautomntent_r; -+ getautomntbyname_t getautomntbyname_r; -+ endautomntent_t endautomntent; -+ struct parse_mod *parse; -+}; -+ -+int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */ -+ -+int lookup_init(const char *mapfmt, int argc, const char *const *argv, void **context) -+{ -+ struct lookup_context *ctxt; -+ char buf[MAX_ERR_BUF]; -+ char dlbuf[PATH_MAX]; -+ char *estr; -+ void *dh; -+ size_t size; -+ -+ *context = NULL; -+ -+ ctxt = malloc(sizeof(struct lookup_context)); -+ if (!ctxt) { -+ estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ logerr(MODPREFIX "malloc: %s", estr); -+ return 1; -+ } -+ -+ if (argc < 1) { -+ free(ctxt); -+ logerr(MODPREFIX "No map name"); -+ return 1; -+ } -+ ctxt->mapname = argv[0]; -+ -+ if (!mapfmt) -+ mapfmt = MAPFMT_DEFAULT; -+ -+ size = snprintf(dlbuf, sizeof(dlbuf), -+ "%s/%s.so", SSS_LIB_DIR, SSS_SO_NAME); -+ if (size >= sizeof(dlbuf)) { -+ free(ctxt); -+ logmsg(MODPREFIX "sss library path too long"); -+ return 1; -+ } -+ -+ dh = dlopen(dlbuf, RTLD_LAZY); -+ if (!dh) { -+ estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ logerr(MODPREFIX "dlopen: %s", estr); -+ free(ctxt); -+ return 1; -+ } -+ ctxt->dlhandle = dh; -+ -+ ctxt->setautomntent = (setautomntent_t) dlsym(dh, "_sss_setautomntent"); -+ if (!ctxt->setautomntent) -+ goto lib_names_fail; -+ -+ ctxt->getautomntent_r = (getautomntent_t) dlsym(dh, "_sss_getautomntent_r"); -+ if (!ctxt->getautomntent_r) -+ goto lib_names_fail; -+ -+ ctxt->getautomntbyname_r = (getautomntbyname_t) dlsym(dh, "_sss_getautomntbyname_r"); -+ if (!ctxt->getautomntbyname_r) -+ goto lib_names_fail; -+ -+ ctxt->endautomntent = (endautomntent_t) dlsym(dh, "_sss_endautomntent"); -+ if (!ctxt->setautomntent) -+ goto lib_names_fail; -+ -+ ctxt->parse = open_parse(mapfmt, MODPREFIX, argc - 1, argv + 1); -+ if (!ctxt->parse) { -+ logmsg(MODPREFIX "failed to open parse context"); -+ dlclose(dh); -+ free(ctxt); -+ return 1; -+ } -+ *context = ctxt; -+ -+ return 0; -+ -+lib_names_fail: -+ if ((estr = dlerror()) == NULL) -+ logmsg(MODPREFIX "failed to locate sss library entry points"); -+ else -+ logerr(MODPREFIX "dlsym: %s", estr); -+ dlclose(dh); -+ free(ctxt); -+ return 1; -+} -+ -+static int setautomntent(unsigned int logopt, -+ struct lookup_context *ctxt, const char *mapname, -+ void **sss_ctxt) -+{ -+ int ret = ctxt->setautomntent(mapname, sss_ctxt); -+ if (ret) { -+ char buf[MAX_ERR_BUF]; -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(logopt, MODPREFIX "setautomntent: %s", estr); -+ if (*sss_ctxt) -+ free(*sss_ctxt); -+ return 0; -+ } -+ return 1; -+} -+ -+static int endautomntent(unsigned int logopt, -+ struct lookup_context *ctxt, void **sss_ctxt) -+{ -+ int ret = ctxt->endautomntent(sss_ctxt); -+ if (ret) { -+ char buf[MAX_ERR_BUF]; -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(logopt, MODPREFIX "endautomntent: %s", estr); -+ return 0; -+ } -+ return 1; -+} -+ -+int lookup_read_master(struct master *master, time_t age, void *context) -+{ -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ unsigned int timeout = master->default_timeout; -+ unsigned int logging = master->default_logging; -+ unsigned int logopt = master->logopt; -+ void *sss_ctxt = NULL; -+ char buf[MAX_ERR_BUF]; -+ char *buffer; -+ size_t buffer_len; -+ char *key; -+ char *value = NULL; -+ int count, ret; -+ -+ if (!setautomntent(logopt, ctxt, ctxt->mapname, &sss_ctxt)) -+ return NSS_STATUS_UNAVAIL; -+ -+ count = 0; -+ while (1) { -+ key = NULL; -+ value = NULL; -+ ret = ctxt->getautomntent_r(&key, &value, sss_ctxt); -+ if (ret && ret != ENOENT) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(logopt, MODPREFIX "getautomntent_r: %s", estr); -+ endautomntent(logopt, ctxt, &sss_ctxt); -+ if (key) -+ free(key); -+ if (value) -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ if (ret == ENOENT) { -+ if (!count) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(logopt, MODPREFIX "getautomntent_r: %s", estr); -+ endautomntent(logopt, ctxt, &sss_ctxt); -+ if (key) -+ free(key); -+ if (value) -+ free(value); -+ return NSS_STATUS_NOTFOUND; -+ } -+ break; -+ } -+ count++; -+ -+ buffer_len = strlen(key) + 1 + strlen(value) + 2; -+ buffer = malloc(buffer_len); -+ if (!buffer) { -+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ error(logopt, MODPREFIX "malloc: %s", estr); -+ endautomntent(logopt, ctxt, &sss_ctxt); -+ free(key); -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ -+ /* -+ * TODO: implement sun % hack for key translation for -+ * mixed case keys in schema that are single case only. -+ */ -+ -+ strcpy(buffer, key); -+ strcat(buffer, " "); -+ strcat(buffer, value); -+ -+ /* -+ * TODO: handle cancelation. This almost certainly isn't -+ * handled properly by other lookup modules either so it -+ * should be done when cancelation is reviewed for the -+ * other modules. Ditto for the other lookup module entry -+ * points. -+ */ -+ master_parse_entry(buffer, timeout, logging, age); -+ -+ free(buffer); -+ free(key); -+ free(value); -+ } -+ -+ endautomntent(logopt, ctxt, &sss_ctxt); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+int lookup_read_map(struct autofs_point *ap, time_t age, void *context) -+{ -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ struct map_source *source; -+ struct mapent_cache *mc; -+ void *sss_ctxt = NULL; -+ char buf[MAX_ERR_BUF]; -+ char *key; -+ char *value = NULL; -+ char *s_key; -+ int count, ret; -+ -+ source = ap->entry->current; -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ -+ mc = source->mc; -+ -+ /* -+ * If we don't need to create directories then there's no use -+ * reading the map. We always need to read the whole map for -+ * direct mounts in order to mount the triggers. -+ */ -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ return NSS_STATUS_SUCCESS; -+ -+ if (!setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt)) -+ return NSS_STATUS_UNAVAIL; -+ -+ count = 0; -+ while (1) { -+ key = NULL; -+ value = NULL; -+ ret = ctxt->getautomntent_r(&key, &value, sss_ctxt); -+ if (ret && ret != ENOENT) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(ap->logopt, -+ MODPREFIX "getautomntent_r: %s", estr); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ if (key) -+ free(key); -+ if (value) -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ if (ret == ENOENT) { -+ if (!count) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(ap->logopt, -+ MODPREFIX "getautomntent_r: %s", estr); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ if (key) -+ free(key); -+ if (value) -+ free(value); -+ return NSS_STATUS_NOTFOUND; -+ } -+ break; -+ } -+ -+ /* -+ * Ignore keys beginning with '+' as plus map -+ * inclusion is only valid in file maps. -+ */ -+ if (*key == '+') { -+ warn(ap->logopt, -+ MODPREFIX "ignoring '+' map entry - not in file map"); -+ free(key); -+ free(value); -+ continue; -+ } -+ -+ /* -+ * TODO: implement sun % hack for key translation for -+ * mixed case keys in schema that are single case only. -+ */ -+ -+ s_key = sanitize_path(key, strlen(key), ap->type, ap->logopt); -+ if (!s_key) { -+ error(ap->logopt, MODPREFIX "invalid path %s", key); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ free(key); -+ free(value); -+ return NSS_STATUS_NOTFOUND; -+ } -+ -+ count++; -+ -+ cache_writelock(mc); -+ cache_update(mc, source, s_key, value, age); -+ cache_unlock(mc); -+ -+ free(s_key); -+ free(key); -+ free(value); -+ } -+ -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+static int lookup_one(struct autofs_point *ap, -+ char *qKey, int qKey_len, struct lookup_context *ctxt) -+{ -+ struct map_source *source; -+ struct mapent_cache *mc; -+ struct mapent *we; -+ void *sss_ctxt = NULL; -+ time_t age = time(NULL); -+ char buf[MAX_ERR_BUF]; -+ char *value = NULL; -+ char *s_key; -+ int ret; -+ -+ source = ap->entry->current; -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ -+ mc = source->mc; -+ -+ if (!setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt)) -+ return NSS_STATUS_UNAVAIL; -+ -+ ret = ctxt->getautomntbyname_r(qKey, &value, sss_ctxt); -+ if (ret && ret != ENOENT) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(ap->logopt, -+ MODPREFIX "getautomntbyname_r: %s", estr); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ if (value) -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ if (ret != ENOENT) { -+ /* -+ * TODO: implement sun % hack for key translation for -+ * mixed case keys in schema that are single case only. -+ */ -+ s_key = sanitize_path(qKey, qKey_len, ap->type, ap->logopt); -+ if (!s_key) { -+ free(value); -+ value = NULL; -+ goto wild; -+ } -+ cache_writelock(mc); -+ ret = cache_update(mc, source, s_key, value, age); -+ cache_unlock(mc); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ free(s_key); -+ free(value); -+ return NSS_STATUS_SUCCESS; -+ } -+ -+wild: -+ ret = ctxt->getautomntbyname_r("/", &value, sss_ctxt); -+ if (ret && ret != ENOENT) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(ap->logopt, -+ MODPREFIX "getautomntbyname_r: %s", estr); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ if (value) -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ if (ret == ENOENT) { -+ ret = ctxt->getautomntbyname_r("*", &value, sss_ctxt); -+ if (ret && ret != ENOENT) { -+ char *estr = strerror_r(ret, buf, MAX_ERR_BUF); -+ error(ap->logopt, -+ MODPREFIX "getautomntbyname_r: %s", estr); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ if (value) -+ free(value); -+ return NSS_STATUS_UNAVAIL; -+ } -+ } -+ -+ if (ret == ENOENT) { -+ /* Failed to find wild entry, update cache if needed */ -+ cache_writelock(mc); -+ we = cache_lookup_distinct(mc, "*"); -+ if (we) { -+ /* Wildcard entry existed and is now gone */ -+ if (we->source == source) { -+ cache_delete(mc, "*"); -+ source->stale = 1; -+ } -+ } -+ -+ /* Not found in the map but found in the cache */ -+ struct mapent *exists = cache_lookup_distinct(mc, qKey); -+ if (exists && exists->source == source) { -+ if (exists->mapent) { -+ free(exists->mapent); -+ exists->mapent = NULL; -+ source->stale = 1; -+ exists->status = 0; -+ } -+ } -+ cache_unlock(mc); -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ return NSS_STATUS_NOTFOUND; -+ } -+ -+ cache_writelock(mc); -+ /* Wildcard not in map but now is */ -+ we = cache_lookup_distinct(mc, "*"); -+ if (!we) -+ source->stale = 1; -+ ret = cache_update(mc, source, "*", value, age); -+ cache_unlock(mc); -+ -+ endautomntent(ap->logopt, ctxt, &sss_ctxt); -+ free(value); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+static int check_map_indirect(struct autofs_point *ap, -+ char *key, int key_len, -+ struct lookup_context *ctxt) -+{ -+ struct map_source *source; -+ struct mapent_cache *mc; -+ struct mapent *me; -+ time_t now = time(NULL); -+ time_t t_last_read; -+ int ret, cur_state; -+ -+ source = ap->entry->current; -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ -+ mc = source->mc; -+ -+ master_source_current_wait(ap->entry); -+ ap->entry->current = source; -+ -+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state); -+ ret = lookup_one(ap, key, key_len, ctxt); -+ if (ret == NSS_STATUS_NOTFOUND) { -+ pthread_setcancelstate(cur_state, NULL); -+ return ret; -+ } else if (ret == NSS_STATUS_UNAVAIL) { -+ /* -+ * If the server is down and the entry exists in the cache -+ * and belongs to this map return success and use the entry. -+ */ -+ struct mapent *exists = cache_lookup(mc, key); -+ if (exists && exists->source == source) { -+ pthread_setcancelstate(cur_state, NULL); -+ return NSS_STATUS_SUCCESS; -+ } -+ pthread_setcancelstate(cur_state, NULL); -+ -+ warn(ap->logopt, -+ MODPREFIX "lookup for %s failed: connection failed", key); -+ -+ return ret; -+ } -+ pthread_setcancelstate(cur_state, NULL); -+ -+ /* -+ * Check for map change and update as needed for -+ * following cache lookup. -+ */ -+ cache_readlock(mc); -+ t_last_read = ap->exp_runfreq + 1; -+ me = cache_lookup_first(mc); -+ while (me) { -+ if (me->source == source) { -+ t_last_read = now - me->age; -+ break; -+ } -+ me = cache_lookup_next(mc, me); -+ } -+ cache_unlock(mc); -+ -+ if (t_last_read > ap->exp_runfreq && ret & CHE_UPDATED) -+ source->stale = 1; -+ -+ cache_readlock(mc); -+ me = cache_lookup_distinct(mc, "*"); -+ if (ret == CHE_MISSING && (!me || me->source != source)) { -+ cache_unlock(mc); -+ return NSS_STATUS_NOTFOUND; -+ } -+ cache_unlock(mc); -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *context) -+{ -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ struct map_source *source; -+ struct mapent_cache *mc; -+ struct mapent *me; -+ char key[KEY_MAX_LEN + 1]; -+ int key_len; -+ char *mapent = NULL; -+ char mapent_buf[MAPENT_MAX_LEN + 1]; -+ int ret; -+ -+ source = ap->entry->current; -+ ap->entry->current = NULL; -+ master_source_current_signal(ap->entry); -+ -+ mc = source->mc; -+ -+ debug(ap->logopt, MODPREFIX "looking up %s", name); -+ -+ key_len = snprintf(key, KEY_MAX_LEN + 1, "%s", name); -+ if (key_len > KEY_MAX_LEN) -+ return NSS_STATUS_NOTFOUND; -+ -+ /* Check if we recorded a mount fail for this key anywhere */ -+ me = lookup_source_mapent(ap, key, LKP_DISTINCT); -+ if (me) { -+ if (me->status >= time(NULL)) { -+ cache_unlock(me->mc); -+ return NSS_STATUS_NOTFOUND; -+ } else { -+ struct mapent_cache *smc = me->mc; -+ struct mapent *sme; -+ -+ if (me->mapent) -+ cache_unlock(smc); -+ else { -+ cache_unlock(smc); -+ cache_writelock(smc); -+ sme = cache_lookup_distinct(smc, key); -+ /* Negative timeout expired for non-existent entry. */ -+ if (sme && !sme->mapent) -+ cache_delete(smc, key); -+ cache_unlock(smc); -+ } -+ } -+ } -+ -+ /* -+ * We can't check the direct mount map as if it's not in -+ * the map cache already we never get a mount lookup, so -+ * we never know about it. -+ */ -+ if (ap->type == LKP_INDIRECT && *key != '/') { -+ int status; -+ char *lkp_key; -+ -+ cache_readlock(mc); -+ me = cache_lookup_distinct(mc, key); -+ if (me && me->multi) -+ lkp_key = strdup(me->multi->key); -+ else -+ lkp_key = strdup(key); -+ cache_unlock(mc); -+ -+ if (!lkp_key) -+ return NSS_STATUS_UNKNOWN; -+ -+ master_source_current_wait(ap->entry); -+ ap->entry->current = source; -+ -+ status = check_map_indirect(ap, lkp_key, strlen(lkp_key), ctxt); -+ free(lkp_key); -+ if (status) -+ return status; -+ } -+ -+ cache_readlock(mc); -+ me = cache_lookup(mc, key); -+ /* Stale mapent => check for entry in alternate source or wildcard */ -+ if (me && !me->mapent) { -+ while ((me = cache_lookup_key_next(me))) -+ if (me->source == source) -+ break; -+ if (!me) -+ me = cache_lookup_distinct(mc, "*"); -+ } -+ if (me && me->mapent && (me->source == source || *me->key == '/')) { -+ strcpy(mapent_buf, me->mapent); -+ mapent = mapent_buf; -+ } -+ cache_unlock(mc); -+ -+ if (!mapent) -+ return NSS_STATUS_TRYAGAIN; -+ -+ master_source_current_wait(ap->entry); -+ ap->entry->current = source; -+ -+ debug(ap->logopt, MODPREFIX "%s -> %s", key, mapent); -+ 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_unlock(mc); -+ return NSS_STATUS_TRYAGAIN; -+ } -+ -+ return NSS_STATUS_SUCCESS; -+} -+ -+int lookup_done(void *context) -+{ -+ struct lookup_context *ctxt = (struct lookup_context *) context; -+ int rv = close_parse(ctxt->parse); -+ dlclose(ctxt->dlhandle); -+ free(ctxt); -+ return rv; -+} diff --git a/autofs-5.0.6-add-systemd-unit-support.patch b/autofs-5.0.6-add-systemd-unit-support.patch deleted file mode 100644 index d59ecbe..0000000 --- a/autofs-5.0.6-add-systemd-unit-support.patch +++ /dev/null @@ -1,388 +0,0 @@ -autofs-5.0.5 - add systemd unit support - -From: Ian Kent - -Add a systemd unit file and attempt to integrating it into our -install. ---- - - CHANGELOG | 1 - Makefile.conf.in | 2 + - aclocal.m4 | 28 ++++++++++++++++++++++ - autofs.spec | 58 +++++++++++++++++++++++++++++++++++++++++----- - configure | 47 +++++++++++++++++++++++++++++++++++++ - configure.in | 9 +++++++ - redhat/Makefile | 10 ++++++- - samples/Makefile | 23 +++++++++++++----- - samples/autofs.service.in | 12 +++++++++ - 9 files changed, 176 insertions(+), 14 deletions(-) - create mode 100644 samples/autofs.service.in - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -17,6 +17,7 @@ - - fix ipv6 rpc calls. - - fix ipv6 configure check. - - add piddir to configure. -+- add systemd unit support. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/Makefile.conf.in -+++ autofs-5.0.6/Makefile.conf.in -@@ -98,3 +98,5 @@ mandir = @mandir@ - # Location for init.d files - initdir = @initdir@ - -+# Location of systemd unit files -+systemddir = @systemddir@ ---- autofs-5.0.6.orig/aclocal.m4 -+++ autofs-5.0.6/aclocal.m4 -@@ -199,6 +199,34 @@ fi], [AC_MSG_RESULT(no)]) - ]) - - dnl -------------------------------------------------------------------------- -+dnl AF_WITH_SYSTEMD -+dnl -+dnl Check the location of the systemd unit files directory -+dnl -------------------------------------------------------------------------- -+AC_DEFUN([AF_WITH_SYSTEMD], -+[AC_ARG_WITH(systemd, -+[ --with-systemd install systemd unit file if systemd unit directory -+ is found on system], -+[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 -+ if test -z "$systemddir"; then -+ if test -d "$systemd_d"; then -+ systemddir="$systemd_d" -+ fi -+ fi -+ done -+ fi -+ if test -n "$systemddir"; then -+ AC_MSG_RESULT($systemddir) -+ else -+ AC_MSG_RESULT(not found) -+ fi -+fi]) -+]) -+ -+dnl -------------------------------------------------------------------------- - dnl AF_CHECK_LIBXML - dnl - dnl Check for lib xml ---- autofs-5.0.6.orig/autofs.spec -+++ autofs-5.0.6/autofs.spec -@@ -8,6 +8,10 @@ - %define _lib lib64 - %endif - -+# 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 from automatically mounting and umounting filesystems. - Name: autofs - %define version 5.0.6 -@@ -18,9 +22,18 @@ License: GPL - Group: System Environment/Daemons - Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/v4/autofs-%{version}.tar.gz - Buildroot: %{_tmppath}/%{name}-tmp -+%if %{with_systemd} -+BuildRequires: systemd-units -+%endif - BuildPrereq: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel - Prereq: chkconfig - Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps -+%if %{with_systemd} -+Requires(post): systemd-sysv -+Requires(post): systemd-units -+Requires(preun): systemd-units -+Requires(postun): systemd-units -+%endif - Obsoletes: autofs-ldap - Summary(de): autofs daemon - Summary(fr): démon autofs -@@ -55,14 +68,22 @@ inkludera nätfilsystem, CD-ROM, floppydi - %prep - %setup -q - echo %{version}-%{release} > .version -+%if %{with_systemd} -+ %define _unitdir %{?_unitdir:/lib/systemd/system} -+ %define systemd_configure_arg --with-systemd -+%endif - - %build --CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move -+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move %{?systemd_configure_arg:} - 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} -+%else - mkdir -p -m755 $RPM_BUILD_ROOT/etc/rc.d/init.d -+%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} -@@ -70,31 +91,56 @@ mkdir -p -m755 $RPM_BUILD_ROOT/etc/sysco - mkdir -p -m755 $RPM_BUILD_ROOT/etc/auto.master.d - - make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_ROOT -+echo make -C redhat - make -C redhat -+%if %{with_systemd} -+install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{_unitdir}/autofs.service -+%else - install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs -+%endif - install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs - - %clean - [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - - %post -+%if %{with_systemd} -+/bin/systemctl daemon-reload >/dev/null 2>&1 || : -+%else - chkconfig --add autofs -- --%postun --if [ $1 -ge 1 ] ; then -- /sbin/service autofs condrestart > /dev/null 2>&1 || : --fi -+%endif - - %preun - if [ "$1" = 0 ] ; then -+%if %{with_systemd} -+ /bin/systemctl --no-reload disable autofs.service > /dev/null 2>&1 || : -+ /bin/systemctl stop autofs.service > /dev/null 2>&1 || : -+%else - /sbin/service autofs stop > /dev/null 2>&1 || : - /sbin/chkconfig --del autofs -+%endif - fi - -+%postun -+%if %{with_systemd} -+/bin/systemctl daemon-reload >/dev/null 2>&1 || : -+if [ $1 -ge 1 ] ; then -+ /bin/systemctl try-restart autofs.service >/dev/null 2>&1 || : -+fi -+%else -+if [ $1 -ge 1 ] ; then -+ /sbin/service autofs condrestart > /dev/null 2>&1 || : -+fi -+%endif -+ - %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(noreplace) /etc/auto.master - %config(noreplace,missingok) /etc/auto.misc - %config(noreplace,missingok) /etc/auto.net ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -650,6 +650,8 @@ flagdir - fifodir - mapdir - confdir -+systemddir -+piddir - initdir - target_alias - host_alias -@@ -693,6 +695,7 @@ ac_subst_files='' - ac_user_opts=' - enable_option_checking - with_path -+with_systemd - with_confdir - with_mapdir - with_fifodir -@@ -1337,6 +1340,8 @@ Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-path=PATH look in PATH for binaries needed by the automounter -+ --with-systemd install systemd unit file if systemd unit directory -+ is found on system - --with-confdir=DIR use DIR for autofs configuration files - --with-mapdir=PATH look in PATH for mount maps used by the automounter - --with-fifodir=PATH use PATH as the directory for fifos used by the automounter -@@ -2119,6 +2124,48 @@ $as_echo "$initdir" >&6; } - done - fi - -+if test -z "$piddir"; then -+ for pid_d in /run /var/run /tmp; do -+ if test -z "$piddir"; then -+ if test -d "$pid_d"; then -+ piddir="$pid_d" -+ fi -+ fi -+ done -+fi -+ -+ -+# -+# Check for systemd unit files direectory exists if unit file installation -+# is requested -+# -+ -+# Check whether --with-systemd was given. -+if test "${with_systemd+set}" = set; then : -+ withval=$with_systemd; if test "$withval" = yes; 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 -+ if test -z "$systemddir"; then -+ if test -d "$systemd_d"; then -+ systemddir="$systemd_d" -+ fi -+ fi -+ done -+ fi -+ if test -n "$systemddir"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $systemddir" >&5 -+$as_echo "$systemddir" >&6; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -+$as_echo "not found" >&6; } -+ fi -+fi -+fi -+ -+ -+ - - # - # Location of system config script directory? ---- autofs-5.0.6.orig/configure.in -+++ autofs-5.0.6/configure.in -@@ -43,6 +43,15 @@ AF_LINUX_PROCFS() - # - AF_INIT_D() - AC_SUBST(initdir) -+AF_PID_D() -+AC_SUBST(piddir) -+ -+# -+# Check for systemd unit files direectory exists if unit file installation -+# is requested -+# -+AF_WITH_SYSTEMD() -+AC_SUBST(systemddir) - - # - # Location of system config script directory? ---- autofs-5.0.6.orig/redhat/Makefile -+++ autofs-5.0.6/redhat/Makefile -@@ -2,7 +2,7 @@ - -include ../Makefile.conf - include ../Makefile.rules - --all: autofs.init autofs.sysconfig -+all: autofs.init autofs.sysconfig autofs.service - - autofs.init: autofs.init.in - sed -e "s|@@sbindir@@|$(sbindir)|g" \ -@@ -15,6 +15,12 @@ autofs.sysconfig: autofs.sysconfig.in - sed -e "s|@@autofsmapdir@@|$(autofsmapdir)|g" \ - < autofs.sysconfig.in > autofs.sysconfig - -+autofs.service: ../samples/autofs.service.in -+ sed -e "s|@@sbindir@@|$(sbindir)|g" \ -+ -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \ -+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \ -+ < ../samples/autofs.service.in > autofs.service -+ - clean: -- rm -f autofs.init autofs.sysconfig -+ rm -f autofs.init autofs.sysconfig autofs.service - ---- autofs-5.0.6.orig/samples/Makefile -+++ autofs-5.0.6/samples/Makefile -@@ -4,7 +4,7 @@ include ../Makefile.rules - - SAMPLES = auto.master auto.misc auto.net auto.smb - --all: rc.autofs autofs.conf.default -+all: rc.autofs autofs.conf.default autofs.service - - rc.autofs: rc.autofs.in - sed -e "s|@@sbindir@@|$(sbindir)|g" \ -@@ -16,6 +16,12 @@ autofs.conf.default: autofs.conf.default - sed -e "s|@@autofsmapdir@@|$(autofsmapdir)|g" \ - < autofs.conf.default.in > autofs.conf.default - -+autofs.service: autofs.service.in -+ sed -e "s|@@sbindir@@|$(sbindir)|g" \ -+ -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \ -+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \ -+ < autofs.service.in > autofs.service -+ - .PHONY: dirs - dirs: - install -d -m 755 $(INSTALLROOT)$(autofsmapdir) -@@ -26,13 +32,18 @@ dirs: - .PHONY: autofs.init - autofs.init: - @echo --ifneq ($(initdir),) -+ifneq ($(systemddir),) -+ install -d -m 755 $(INSTALLROOT)$(systemddir) -+ install autofs.service -m 644 $(INSTALLROOT)$(systemddir)/autofs.service -+else -+ ifneq ($(initdir),) - install -d -m 755 $(INSTALLROOT)$(initdir) - install rc.autofs -m 755 $(INSTALLROOT)$(initdir)/autofs --else -+ else - if test -d $(INSTALLROOT)/etc/rc.d ; then \ - install -c rc.autofs -m 755 $(INSTALLROOT)/etc/rc.d ; \ - fi -+ endif - endif - - CONFIG = $(shell test -e $(INSTALLROOT)$(autofsconfdir)/autofs.orig || echo "-b --suffix=.orig") -@@ -173,10 +184,10 @@ auto.smb: - fi ; \ - fi - --install: rc.autofs autofs.conf.default dirs autofs.init autofs.conf \ -- autofs_ldap_auth.conf $(SAMPLES) -+install: rc.autofs autofs.conf.default dirs autofs.init autofs.service \ -+ autofs.conf autofs_ldap_auth.conf $(SAMPLES) - @echo - - clean: -- rm -f *.o *.s rc.autofs autofs.conf.default -+ rm -f *.o *.s rc.autofs autofs.conf.default autofs.service - ---- /dev/null -+++ autofs-5.0.6/samples/autofs.service.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Automounts filesystems on demand -+After=network.target ypbind.service -+ -+[Service] -+Type=forking -+PIDFile=@@autofspiddir@@/autofs.pid -+EnvironmentFile=-@@autofsconfdir@@/autofs -+ExecStart=@@sbindir@@/automount ${OPTIONS} --pid-file @@autofspiddir@@/autofs.pid -+ -+[Install] -+WantedBy=multi-user.target diff --git a/autofs-5.0.6-allow-MOUNT_WAIT-to-override-probe.patch b/autofs-5.0.6-allow-MOUNT_WAIT-to-override-probe.patch deleted file mode 100644 index 7eefce3..0000000 --- a/autofs-5.0.6-allow-MOUNT_WAIT-to-override-probe.patch +++ /dev/null @@ -1,38 +0,0 @@ -autofs-5.0.6 - allow MOUNT_WAIT to override probe - -From: Ian Kent - -Allow the use of MOUNT_WAIT to override the probe of singleton -map entries. This can allow for quicker fails to hosts that are -not reachable. ---- - - CHANGELOG | 1 + - modules/replicated.c | 3 +++ - 2 files changed, 4 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -34,6 +34,7 @@ - - fix function to check mount.nfs version. - - fix typo in libtirpc file name. - - fix rework error return handling in rpc code. -+- allow MOUNT_WAIT to override probe. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -953,8 +953,11 @@ int prune_host_list(unsigned logopt, str - * are not available so check the kernel version and mount.nfs - * version and probe singleton mounts if the kernel version is - * greater than 2.6.22 and mount.nfs version is greater than 1.1.1. -+ * But also allow the MOUNT_WAIT configuration parameter to override -+ * the probing. - */ - if (nfs_mount_uses_string_options && -+ defaults_get_mount_wait() == -1 && - (kern_vers = linux_version_code()) > KERNEL_VERSION(2, 6, 22)) { - if (!this) - return 1; diff --git a/autofs-5.0.6-allow-update-of-multi-mount-offset-entries.patch b/autofs-5.0.6-allow-update-of-multi-mount-offset-entries.patch deleted file mode 100644 index 99841a1..0000000 --- a/autofs-5.0.6-allow-update-of-multi-mount-offset-entries.patch +++ /dev/null @@ -1,104 +0,0 @@ -autofs-5.0.6 - allow update of multi mount offset entries - -From: Ian Kent - -Currently multi mount offsets can only be added or all offsets owned by -an entry deleted at once. In order to be able to update multi mount map -entries we need to be able to update offset entries of an already expanded -multi map cache entry. ---- - - include/automount.h | 2 +- - lib/cache.c | 4 ++-- - modules/parse_sun.c | 20 ++++++++++---------- - 3 files changed, 13 insertions(+), 13 deletions(-) - - -diff --git a/include/automount.h b/include/automount.h -index 40c1975..561fcc2 100644 ---- a/include/automount.h -+++ b/include/automount.h -@@ -188,7 +188,7 @@ struct mapent *cache_lookup_distinct(struct mapent_cache *mc, const char *key); - struct mapent *cache_lookup_offset(const char *prefix, const char *offset, int start, struct list_head *head); - 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_add_offset(struct mapent_cache *mc, const char *mkey, 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); - 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 1489273..9179ad5 100644 ---- a/lib/cache.c -+++ b/lib/cache.c -@@ -647,7 +647,7 @@ static void cache_add_ordered_offset(struct mapent *me, struct list_head *head) - } - - /* cache must be write locked by caller */ --int cache_add_offset(struct mapent_cache *mc, const char *mkey, 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) - { - unsigned logopt = mc->ap ? mc->ap->logopt : master_get_logopt(); - struct mapent *me, *owner; -@@ -659,7 +659,7 @@ int cache_add_offset(struct mapent_cache *mc, const char *mkey, const char *key, - - me = cache_lookup_distinct(mc, key); - if (me && me->age == age) { -- if (me != owner) -+ if (me->multi != owner) - return CHE_DUPLICATE; - } - -diff --git a/modules/parse_sun.c b/modules/parse_sun.c -index c4decbc..5be7345 100644 ---- a/modules/parse_sun.c -+++ b/modules/parse_sun.c -@@ -781,10 +781,10 @@ static int check_is_multi(const char *mapent) - } - - static int --add_offset_entry(struct autofs_point *ap, const char *name, -- const char *m_root, int m_root_len, -- const char *path, const char *myoptions, const char *loc, -- time_t age) -+update_offset_entry(struct autofs_point *ap, const char *name, -+ const char *m_root, int m_root_len, -+ const char *path, const char *myoptions, const char *loc, -+ time_t age) - { - struct map_source *source; - struct mapent_cache *mc; -@@ -838,17 +838,17 @@ add_offset_entry(struct autofs_point *ap, const char *name, - } else - strcpy(m_mapent, loc); - -- ret = cache_add_offset(mc, name, m_key, m_mapent, age); -+ ret = cache_update_offset(mc, name, m_key, m_mapent, age); - if (ret == CHE_DUPLICATE) - warn(ap->logopt, MODPREFIX - "syntax error or duplicate offset %s -> %s", path, loc); - else if (ret == CHE_FAIL) - debug(ap->logopt, MODPREFIX -- "failed to add multi-mount offset %s -> %s", path, m_mapent); -+ "failed to update multi-mount offset %s -> %s", path, m_mapent); - else { - ret = CHE_OK; - debug(ap->logopt, MODPREFIX -- "added multi-mount offset %s -> %s", path, m_mapent); -+ "updated multi-mount offset %s -> %s", path, m_mapent); - } - - return ret; -@@ -1448,9 +1448,9 @@ int parse_mount(struct autofs_point *ap, const char *name, - master_source_current_wait(ap->entry); - ap->entry->current = source; - -- status = add_offset_entry(ap, name, -- m_root, m_root_len, -- path, myoptions, loc, age); -+ status = update_offset_entry(ap, name, -+ m_root, m_root_len, -+ path, myoptions, loc, age); - - if (status != CHE_OK) { - warn(ap->logopt, MODPREFIX "error adding multi-mount"); diff --git a/autofs-5.0.6-catch-EHOSTUNREACH-and-bail-out-early.patch b/autofs-5.0.6-catch-EHOSTUNREACH-and-bail-out-early.patch deleted file mode 100644 index 1847b5c..0000000 --- a/autofs-5.0.6-catch-EHOSTUNREACH-and-bail-out-early.patch +++ /dev/null @@ -1,166 +0,0 @@ -autofs-5.0.6 - catch EHOSTUNREACH and bail out early - -From: Ian Kent - -Now that the lower layers of the rpc code has been reworked -to propogate error returns up to the top level code we can -catch the EHOSTUNREACH return and stop the probe since the -host isn't responding. - -Also, since UDP is a broadcast protocol we don't get the -EHOSTUNREACH and always have to wait, so change the probe -order to try TCP first. Using UDP first was originally -done to reduce reserved port usage but autofs probing uses -higher numbered ports now so this shouldn't introduce -problem even for older implementations. ---- - - CHANGELOG | 1 - include/replicated.h | 3 ++ - modules/replicated.c | 55 +++++++++++++++++++++++++++++++++++++-------------- - 3 files changed, 44 insertions(+), 15 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -28,6 +28,7 @@ - - add function to check mount.nfs version. - - reinstate singleton mount probe. - - rework error return handling in rpc code. -+- catch EHOSTUNREACH and bail out early. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/replicated.h -+++ autofs-5.0.6/include/replicated.h -@@ -48,6 +48,9 @@ - #define TCP_SELECTED_MASK 0x00FF - #define UDP_SELECTED_MASK 0xFF00 - -+#define IS_ERR(supported) (0x8000 & supported) -+#define ERR(supported) (IS_ERR(supported) ? (~supported + 1) : supported) -+ - #define RPC_TIMEOUT 5 - - struct host { ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -563,7 +563,9 @@ static unsigned int get_nfs_info(unsigne - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); -- if (!status) { -+ if (status == -EHOSTUNREACH) -+ return (unsigned int) status; -+ else if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -@@ -589,7 +591,10 @@ v3_ver: - status = rpc_portmap_getclient(pm_info, - host->name, host->addr, host->addr_len, - proto, RPC_CLOSE_DEFAULT); -- if (status) -+ if (status == -EHOSTUNREACH) { -+ supported = status; -+ goto done_ver; -+ } else if (status) - goto done_ver; - } - -@@ -602,16 +607,23 @@ v3_ver: - } else { - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS3_VERSION; -- rpc_info->port = rpc_portmap_getport(pm_info, &parms); -- if (rpc_info->port < 0) -+ status = rpc_portmap_getport(pm_info, &parms); -+ if (status == -EHOSTUNREACH) { -+ supported = status; -+ goto done_ver; -+ } else if (status < 0) - goto v2_ver; -+ rpc_info->port = status; - } - - if (rpc_info->proto->p_proto == IPPROTO_UDP) - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); -- if (!status) { -+ if (status == -EHOSTUNREACH) { -+ supported = status; -+ goto done_ver; -+ } else if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -@@ -643,15 +655,23 @@ v2_ver: - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS2_VERSION; - rpc_info->port = rpc_portmap_getport(pm_info, &parms); -- if (rpc_info->port < 0) -+ status = rpc_portmap_getport(pm_info, &parms); -+ if (status == -EHOSTUNREACH) { -+ supported = status; -+ goto done_ver; -+ } else if (status < 0) - goto done_ver; -+ rpc_info->port = status; - } - - if (rpc_info->proto->p_proto == IPPROTO_UDP) - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); -- if (!status) { -+ if (status == -EHOSTUNREACH) { -+ supported = status; -+ goto done_ver; -+ } else if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -@@ -728,21 +748,24 @@ static int get_vers_and_cost(unsigned lo - - vers &= version; - -- if (version & UDP_REQUESTED) { -+ if (version & TCP_REQUESTED) { - supported = get_nfs_info(logopt, host, -- &pm_info, &rpc_info, "udp", vers, options); -- if (supported) { -+ &pm_info, &rpc_info, "tcp", vers, options); -+ if (IS_ERR(supported)) { -+ if (ERR(supported) == EHOSTUNREACH) -+ return ret; -+ } else if (supported) { - ret = 1; -- host->version |= (supported << 8); -+ host->version |= supported; - } - } - -- if (version & TCP_REQUESTED) { -+ if (version & UDP_REQUESTED) { - supported = get_nfs_info(logopt, host, -- &pm_info, &rpc_info, "tcp", vers, options); -+ &pm_info, &rpc_info, "udp", vers, options); - if (supported) { - ret = 1; -- host->version |= supported; -+ host->version |= (supported << 8); - } - } - -@@ -848,7 +871,9 @@ static int get_supported_ver_and_cost(un - status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); - else - status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); -- if (!status) { -+ if (status == -EHOSTUNREACH) -+ goto done; -+ else if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(&rpc_info); - gettimeofday(&end, &tz); diff --git a/autofs-5.0.6-check-if-mtab-is-a-link-to-proc-self-mounts.patch b/autofs-5.0.6-check-if-mtab-is-a-link-to-proc-self-mounts.patch deleted file mode 100644 index a8bef3b..0000000 --- a/autofs-5.0.6-check-if-mtab-is-a-link-to-proc-self-mounts.patch +++ /dev/null @@ -1,70 +0,0 @@ -autofs-5.0.6 - check if /etc/mtab is a link to /proc/self/mounts - -From: Leonardo Chiquitto - -Check if /etc/mtab is a link to /proc/self/mounts - -Some distributions link /etc/mtab to /proc/self/mounts instead -of /proc/mounts. ---- - - CHANGELOG | 1 + - daemon/spawn.c | 9 ++++++--- - include/automount.h | 3 ++- - 3 files changed, 9 insertions(+), 4 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -48,6 +48,7 @@ - - move timeout to map_source (allow per direct map timeout). - - 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. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/spawn.c -+++ autofs-5.0.6/daemon/spawn.c -@@ -336,7 +336,8 @@ int spawn_mount(unsigned logopt, ...) - ret = readlink(_PATH_MOUNTED, buf, PATH_MAX); - if (ret != -1) { - buf[ret] = '\0'; -- if (!strcmp(buf, _PROC_MOUNTS)) { -+ if (!strcmp(buf, _PROC_MOUNTS) || -+ !strcmp(buf, _PROC_SELF_MOUNTS)) { - debug(logopt, - "mtab link detected, passing -n to mount"); - argc++; -@@ -467,7 +468,8 @@ int spawn_bind_mount(unsigned logopt, .. - ret = readlink(_PATH_MOUNTED, buf, PATH_MAX); - if (ret != -1) { - buf[ret] = '\0'; -- if (!strcmp(buf, _PROC_MOUNTS)) { -+ if (!strcmp(buf, _PROC_MOUNTS) || -+ !strcmp(buf, _PROC_SELF_MOUNTS)) { - debug(logopt, - "mtab link detected, passing -n to mount"); - argc++; -@@ -569,7 +571,8 @@ int spawn_umount(unsigned logopt, ...) - ret = readlink(_PATH_MOUNTED, buf, PATH_MAX); - if (ret != -1) { - buf[ret] = '\0'; -- if (!strcmp(buf, _PROC_MOUNTS)) { -+ if (!strcmp(buf, _PROC_MOUNTS) || -+ !strcmp(buf, _PROC_SELF_MOUNTS)) { - debug(logopt, - "mtab link detected, passing -n to mount"); - argc++; ---- autofs-5.0.6.orig/include/automount.h -+++ autofs-5.0.6/include/automount.h -@@ -84,7 +84,8 @@ int load_autofs4_module(void); - #define MTAB_NOTUPDATED 0x1000 /* mtab succeded but not updated */ - #define NOT_MOUNTED 0x0100 /* path notmounted */ - #define MNT_FORCE_FAIL -1 --#define _PROC_MOUNTS "/proc/mounts" -+#define _PROC_MOUNTS "/proc/mounts" -+#define _PROC_SELF_MOUNTS "/proc/self/mounts" - - /* Constants for lookup modules */ - diff --git a/autofs-5.0.6-code-analysis-fixes-1.patch b/autofs-5.0.6-code-analysis-fixes-1.patch deleted file mode 100644 index 6b0c902..0000000 --- a/autofs-5.0.6-code-analysis-fixes-1.patch +++ /dev/null @@ -1,101 +0,0 @@ -autofs-5.0.6 - code analysis fixes 1 - -From: Ian Kent - -Code analysis defect fixes, installment 1. - -- fix signed usage of unsigned variable in do_srv_query(). -- make NULL check handling of variable dcs explicit in get_dc_list(). - - adding an explicit NULL check for variable dcs gaurds against - future changes in get_srv_rrs() returning success while not - clearing the dcs variable. - - makes it explict for readers why we don't need to check for NULL - before free later in the loop. -- fix typo in do_reconnect() - - uri is never set now and, at this point, we need to try to connect - to the last server uri (ctxt->uri->uri) which is set in find_server() - when ctxt->uri is NULL. ---- - - CHANGELOG | 1 + - modules/dclist.c | 11 +++++------ - modules/lookup_ldap.c | 3 +-- - 3 files changed, 7 insertions(+), 8 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index dc91c25..acc5f0c 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -6,6 +6,7 @@ - - fix dumpmaps not reading maps. - - fix result null check in read_one_map(). - - fix LDAP result leaks on error paths. -+- code analysis fixes part 1. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/dclist.c b/modules/dclist.c -index aeb107f..d16b913 100644 ---- a/modules/dclist.c -+++ b/modules/dclist.c -@@ -69,7 +69,7 @@ static void dclist_mutex_unlock(void) - - static int do_srv_query(unsigned int logopt, char *name, u_char **packet) - { -- unsigned int len = PACKETSZ; -+ int len = PACKETSZ; - unsigned int last_len = len; - char ebuf[MAX_ERR_BUF]; - u_char *buf; -@@ -500,7 +500,8 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri) - } - - dclist_mutex_lock(); -- if (!get_srv_rrs(logopt, request, &dcs, &numdcs)) { -+ ret = get_srv_rrs(logopt, request, &dcs, &numdcs); -+ if (!ret | !dcs) { - error(logopt, - "DNS SRV query failed for domain %s", domain); - dclist_mutex_unlock(); -@@ -526,8 +527,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri) - if (!tmp) { - char *estr = strerror_r(errno, buf, MAX_ERR_BUF); - error(logopt, "realloc: %s", estr); -- if (dcs) -- free_srv_rrs(dcs, numdcs); -+ free_srv_rrs(dcs, numdcs); - goto out_error; - } - -@@ -548,8 +548,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri) - if (ret > 6) { - error(logopt, - "invalid port: %u", dcs[i].port); -- if (dcs) -- free_srv_rrs(dcs, numdcs); -+ free_srv_rrs(dcs, numdcs); - goto out_error; - } - strcat(tmp, port); -diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c -index 29323b2..67a6834 100644 ---- a/modules/lookup_ldap.c -+++ b/modules/lookup_ldap.c -@@ -736,7 +736,6 @@ static LDAP *find_server(unsigned logopt, struct lookup_context *ctxt) - static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt) - { - LDAP *ldap = NULL; -- char *uri; - - if (ctxt->server || !ctxt->uris) { - ldap = do_connect(logopt, ctxt->server, ctxt); -@@ -780,7 +779,7 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt) - */ - if (!ldap) { - autofs_sasl_dispose(ctxt); -- ldap = connect_to_server(logopt, uri, ctxt); -+ ldap = connect_to_server(logopt, ctxt->uri->uri, ctxt); - } - #endif - if (ldap) diff --git a/autofs-5.0.6-dont-retry-ldap-connect-if-not-required.patch b/autofs-5.0.6-dont-retry-ldap-connect-if-not-required.patch deleted file mode 100644 index a611b83..0000000 --- a/autofs-5.0.6-dont-retry-ldap-connect-if-not-required.patch +++ /dev/null @@ -1,65 +0,0 @@ -autofs-5.0.6 - dont retry ldap connect if not required - -From: Ian Kent - -When using LDAP and the server is not available autofs retries the -connection when it fails in case the SASL credentail has expired. -But this is done even when not using SASL, so change it check if -SASL authentication is required. ---- - - CHANGELOG | 1 + - include/lookup_ldap.h | 1 + - modules/lookup_ldap.c | 6 +++--- - 3 files changed, 5 insertions(+), 3 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -47,6 +47,7 @@ - - update ->timeout() function to not return timeout. - - move timeout to map_source (allow per direct map timeout). - - fix kernel verion check of version components. -+- dont retry ldap connect if not required. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/lookup_ldap.h -+++ autofs-5.0.6/include/lookup_ldap.h -@@ -104,6 +104,7 @@ struct lookup_context { - #define LDAP_AUTH_NOTREQUIRED 0x0001 - #define LDAP_AUTH_REQUIRED 0x0002 - #define LDAP_AUTH_AUTODETECT 0x0004 -+#define LDAP_NEED_AUTH (LDAP_AUTH_REQUIRED|LDAP_AUTH_AUTODETECT) - #endif - - #define LDAP_AUTH_USESIMPLE 0x0008 ---- autofs-5.0.6.orig/modules/lookup_ldap.c -+++ autofs-5.0.6/modules/lookup_ldap.c -@@ -511,7 +511,7 @@ static int do_bind(unsigned logopt, LDAP - debug(logopt, MODPREFIX "auth_required: %d, sasl_mech %s", - ctxt->auth_required, ctxt->sasl_mech); - -- if (ctxt->auth_required & (LDAP_AUTH_REQUIRED|LDAP_AUTH_AUTODETECT)) { -+ if (ctxt->auth_required & LDAP_NEED_AUTH) { - rv = autofs_sasl_bind(logopt, ldap, ctxt); - debug(logopt, MODPREFIX "autofs_sasl_bind returned %d", rv); - } else { -@@ -731,7 +731,7 @@ static LDAP *do_reconnect(unsigned logop - ldap = do_connect(logopt, ctxt->server, ctxt); - #ifdef WITH_SASL - /* Dispose of the sasl authentication connection and try again. */ -- if (!ldap) { -+ if (!ldap && ctxt->auth_required & LDAP_NEED_AUTH) { - autofs_sasl_dispose(ctxt); - ldap = connect_to_server(logopt, ctxt->server, ctxt); - } -@@ -767,7 +767,7 @@ static LDAP *do_reconnect(unsigned logop - * Dispose of the sasl authentication connection and try the - * current server again before trying other servers in the list. - */ -- if (!ldap) { -+ if (!ldap && ctxt->auth_required & LDAP_NEED_AUTH) { - autofs_sasl_dispose(ctxt); - ldap = connect_to_server(logopt, ctxt->uri->uri, ctxt); - } diff --git a/autofs-5.0.6-duplicate-parent-options-for-included-maps.patch b/autofs-5.0.6-duplicate-parent-options-for-included-maps.patch deleted file mode 100644 index a38c509..0000000 --- a/autofs-5.0.6-duplicate-parent-options-for-included-maps.patch +++ /dev/null @@ -1,158 +0,0 @@ -autofs-5.0.6 - duplicate parent options for included maps - -From: Ian Kent - -Included maps should inherite mount options from their parent mount. ---- - - CHANGELOG | 1 - modules/lookup_file.c | 61 +++++++++++++++++++++++++++++++++++++++++++------- - 2 files changed, 54 insertions(+), 8 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -43,6 +43,7 @@ - - fix initialization in rpc create_client(). - - fix libtirpc name clash. - - report map not read when debug logging. -+- duplicate parent options for included maps. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/lookup_file.c -+++ autofs-5.0.6/modules/lookup_file.c -@@ -41,9 +41,10 @@ typedef enum { - typedef enum { got_nothing, got_star, got_real, got_plus } FOUND_STATE; - typedef enum { esc_none, esc_char, esc_val, esc_all } ESCAPES; - -- - struct lookup_context { - const char *mapname; -+ int opts_argc; -+ const char **opts_argv; - struct parse_mod *parse; - }; - -@@ -88,8 +89,20 @@ int lookup_init(const char *mapfmt, int - if (!mapfmt) - mapfmt = MAPFMT_DEFAULT; - -- ctxt->parse = open_parse(mapfmt, MODPREFIX, argc - 1, argv + 1); -+ argc--; -+ argv++; -+ -+ ctxt->opts_argv = copy_argv(argc, (const char **) argv); -+ if (ctxt->opts_argv == NULL) { -+ free(ctxt); -+ warn(LOGOPT_NONE, MODPREFIX "failed to duplicate options"); -+ return 1; -+ } -+ ctxt->opts_argc = argc; -+ -+ ctxt->parse = open_parse(mapfmt, MODPREFIX, argc, argv); - if (!ctxt->parse) { -+ free_argv(ctxt->opts_argc, ctxt->opts_argv); - free(ctxt); - logmsg(MODPREFIX "failed to open parse context"); - return 1; -@@ -512,12 +525,15 @@ static int check_self_include(const char - } - - static struct map_source * --prepare_plus_include(struct autofs_point *ap, time_t age, char *key, unsigned int inc) -+prepare_plus_include(struct autofs_point *ap, -+ time_t age, char *key, unsigned int inc, -+ struct lookup_context *ctxt) - { - struct map_source *current; - struct map_source *source; - struct map_type_info *info; - const char *argv[2]; -+ char **tmp_argv, **tmp_opts; - int argc; - char *buf; - -@@ -551,9 +567,35 @@ prepare_plus_include(struct autofs_point - argv[0] = info->map; - argv[1] = NULL; - -+ tmp_argv = (char **) copy_argv(argc, argv); -+ if (!tmp_argv) { -+ error(ap->logopt, MODPREFIX "failed to allocate args vector"); -+ free_map_type_info(info); -+ free(buf); -+ return NULL; -+ } -+ -+ tmp_opts = (char **) copy_argv(ctxt->opts_argc, ctxt->opts_argv); -+ if (!tmp_opts) { -+ error(ap->logopt, MODPREFIX "failed to allocate options args vector"); -+ free_argv(argc, (const char **) tmp_argv); -+ free_map_type_info(info); -+ free(buf); -+ return NULL; -+ } -+ -+ tmp_argv = append_argv(argc, tmp_argv, ctxt->opts_argc, tmp_opts); -+ if (!tmp_argv) { -+ error(ap->logopt, MODPREFIX "failed to append options vector"); -+ free_map_type_info(info); -+ free(buf); -+ return NULL; -+ } -+ argc += ctxt->opts_argc; -+ - source = master_find_source_instance(current, - info->type, info->format, -- argc, argv); -+ argc, (const char **) tmp_argv); - if (source) { - /* - * Make sure included map age is in sync with its owner -@@ -563,15 +605,17 @@ prepare_plus_include(struct autofs_point - source->stale = 1; - } else { - source = master_add_source_instance(current, -- info->type, info->format, -- age, argc, argv); -+ info->type, info->format, age, -+ argc, (const char **) tmp_argv); - if (!source) { -+ free_argv(argc, (const char **) tmp_argv); - free_map_type_info(info); - free(buf); - error(ap->logopt, "failed to add included map instance"); - return NULL; - } - } -+ free_argv(argc, (const char **) tmp_argv); - - source->depth = current->depth + 1; - if (inc) -@@ -645,7 +689,7 @@ int lookup_read_map(struct autofs_point - master_source_current_wait(ap->entry); - ap->entry->current = source; - -- inc_source = prepare_plus_include(ap, age, key, inc); -+ inc_source = prepare_plus_include(ap, age, key, inc, ctxt); - if (!inc_source) { - debug(ap->logopt, - "failed to select included map %s", key); -@@ -729,7 +773,7 @@ static int lookup_one(struct autofs_poin - master_source_current_wait(ap->entry); - ap->entry->current = source; - -- inc_source = prepare_plus_include(ap, age, mkey, inc); -+ inc_source = prepare_plus_include(ap, age, mkey, inc, ctxt); - if (!inc_source) { - debug(ap->logopt, - MODPREFIX -@@ -1096,6 +1140,7 @@ int lookup_done(void *context) - { - struct lookup_context *ctxt = (struct lookup_context *) context; - int rv = close_parse(ctxt->parse); -+ free_argv(ctxt->opts_argc, ctxt->opts_argv); - free(ctxt); - return rv; - } diff --git a/autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch b/autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch deleted file mode 100644 index 809021e..0000000 --- a/autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch +++ /dev/null @@ -1,56 +0,0 @@ -autofs-5.0.6 - Fix LDAP result leaks on error paths - -From: Leonardo Chiquitto - -According to ldap_search_s(3), the result structure must be freed -with ldap_msgfree() even when the search function returned failure. ---- - - CHANGELOG | 1 + - modules/lookup_ldap.c | 6 ++++++ - 2 files changed, 7 insertions(+), 0 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 66b804f..dc91c25 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -5,6 +5,7 @@ - - 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. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c -index 22ff355..29323b2 100644 ---- a/modules/lookup_ldap.c -+++ b/modules/lookup_ldap.c -@@ -347,6 +347,8 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt - error(logopt, - MODPREFIX "query failed for %s: %s", - query, ldap_err2string(rv)); -+ if (result) -+ ldap_msgfree(result); - free(query); - return 0; - } -@@ -1573,6 +1575,8 @@ int lookup_read_master(struct master *master, time_t age, void *context) - error(logopt, MODPREFIX "query failed for %s: %s", - query, ldap_err2string(rv)); - unbind_ldap_connection(logging, ldap, ctxt); -+ if (result) -+ ldap_msgfree(result); - free(query); - return NSS_STATUS_NOTFOUND; - } -@@ -2586,6 +2590,8 @@ static int lookup_one(struct autofs_point *ap, - if ((rv != LDAP_SUCCESS) || !result) { - crit(ap->logopt, MODPREFIX "query failed for %s", query); - unbind_ldap_connection(ap->logopt, ldap, ctxt); -+ if (result) -+ ldap_msgfree(result); - free(query); - return CHE_FAIL; - } diff --git a/autofs-5.0.6-fix-MNT_DETACH-define.patch b/autofs-5.0.6-fix-MNT_DETACH-define.patch deleted file mode 100644 index ee6ecd9..0000000 --- a/autofs-5.0.6-fix-MNT_DETACH-define.patch +++ /dev/null @@ -1,23 +0,0 @@ -autofs-5.0.6 - fix MNT_DETACH define - -From: Ian Kent - -MNT_DETACH has been included in herder file ---- - - include/automount.h | 2 ++ - 1 file changed, 2 insertions(+) - - ---- autofs-5.0.6.orig/include/automount.h -+++ autofs-5.0.6/include/automount.h -@@ -333,7 +333,9 @@ int ncat_path(char *buf, size_t len, - - /* Core automount definitions */ - -+#ifndef MNT_DETACH - #define MNT_DETACH 0x00000002 /* Just detach from the tree */ -+#endif - - struct startup_cond { - pthread_mutex_t mutex; diff --git a/autofs-5.0.6-fix-configure-string-length-tests.patch b/autofs-5.0.6-fix-configure-string-length-tests.patch deleted file mode 100644 index 53cb6e3..0000000 --- a/autofs-5.0.6-fix-configure-string-length-tests.patch +++ /dev/null @@ -1,69 +0,0 @@ -autofs-5.0.6 - fix configure string length tests - -From: Ian Kent - -Checks for sss library directory were missing quotes around -the library variable. ---- - - CHANGELOG | 1 + - aclocal.m4 | 6 +++--- - configure | 6 +++--- - 3 files changed, 7 insertions(+), 6 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -39,6 +39,7 @@ - - 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. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/aclocal.m4 -+++ autofs-5.0.6/aclocal.m4 -@@ -37,16 +37,16 @@ dnl - dnl Check if a sss autofs library exists. - dnl -------------------------------------------------------------------------- - AC_DEFUN(AF_CHECK_SSS_LIB, --[if test -z $sssldir; then -+[if test -z "$sssldir"; then - AC_MSG_CHECKING(for sssd autofs library) - for libd in /usr/lib64 /usr/lib; do -- if test -z $sssldir; then -+ if test -z "$sssldir"; then - if test -e "$libd/sssd/modules/$2"; then - sssldir=$libd/sssd/modules - fi - fi - done -- if test -n $sssldir; then -+ if test -n "$sssldir"; then - HAVE_$1=1 - AC_MSG_RESULT(yes) - else ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -3832,17 +3832,17 @@ else - fi - - --if test -z $sssldir; then -+if test -z "$sssldir"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sssd autofs library" >&5 - $as_echo_n "checking for sssd autofs library... " >&6; } - for libd in /usr/lib64 /usr/lib; do -- if test -z $sssldir; then -+ if test -z "$sssldir"; then - if test -e "$libd/sssd/modules/libsss_autofs.so"; then - sssldir=$libd/sssd/modules - fi - fi - done -- if test -n $sssldir; then -+ if test -n "$sssldir"; then - HAVE_SSS_AUTOFS=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } diff --git a/autofs-5.0.6-fix-device-ioctl-alloc-path-check.patch b/autofs-5.0.6-fix-device-ioctl-alloc-path-check.patch deleted file mode 100644 index 42e70de..0000000 --- a/autofs-5.0.6-fix-device-ioctl-alloc-path-check.patch +++ /dev/null @@ -1,37 +0,0 @@ -autofs-5.0.6 - fix devce ioctl alloc path check - -From: Ian Kent - -The errno error should be set in alloc_dev_ioctl_path() if the passed -in path in NULL. ---- - - CHANGELOG | 1 + - lib/dev-ioctl-lib.c | 4 +++- - 2 files changed, 4 insertions(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -56,6 +56,7 @@ - - fix umount recovery of busy direct mount. - - fix offset mount point directory removal. - - fix remount of multi mount. -+- fix devce ioctl alloc path check. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/dev-ioctl-lib.c -+++ autofs-5.0.6/lib/dev-ioctl-lib.c -@@ -270,8 +270,10 @@ static struct autofs_dev_ioctl *alloc_de - struct autofs_dev_ioctl *ioctl; - size_t size, p_len; - -- if (!path) -+ if (!path) { -+ errno = EINVAL; - return NULL; -+ } - - p_len = strlen(path); - size = sizeof(struct autofs_dev_ioctl) + p_len + 1; diff --git a/autofs-5.0.6-fix-dlopen-error-handling-in-sss-module.patch b/autofs-5.0.6-fix-dlopen-error-handling-in-sss-module.patch deleted file mode 100644 index 5054f7c..0000000 --- a/autofs-5.0.6-fix-dlopen-error-handling-in-sss-module.patch +++ /dev/null @@ -1,36 +0,0 @@ -autofs-5.0.6 - fix dlopen() error handling in sss module - -From: Ian Kent - -If dlopen(3) fails during initialization of the sss module the -error message is incorrect since dlerror(3) must be used, not -errno. ---- - - CHANGELOG | 1 + - modules/lookup_sss.c | 3 +-- - 2 files changed, 2 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -38,6 +38,7 @@ - - improve UDP RPC timeout handling. - - use strtok_r() in linux_version_code(). - - fix sss wildcard match. -+- fix dlopen() error handling in sss module. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/lookup_sss.c -+++ autofs-5.0.6/modules/lookup_sss.c -@@ -94,8 +94,7 @@ int lookup_init(const char *mapfmt, int - - dh = dlopen(dlbuf, RTLD_LAZY); - if (!dh) { -- estr = strerror_r(errno, buf, MAX_ERR_BUF); -- logerr(MODPREFIX "dlopen: %s", estr); -+ logerr(MODPREFIX "failed to open %s: %s", dlbuf, dlerror()); - free(ctxt); - return 1; - } diff --git a/autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch b/autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch deleted file mode 100644 index 2f7ef27..0000000 --- a/autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch +++ /dev/null @@ -1,47 +0,0 @@ -autofs-5.0.6 - fix dumpmaps not reading maps - -From: Ian Kent - -The lookup modules won't read any indirect map entries (other than those -in a file map) unless unless the browse option is set. In order to list -the entries when tyhe dumpmap option is given the browse option needs to -be set. ---- - - CHANGELOG | 1 + - lib/master.c | 9 +++++++++ - 2 files changed, 10 insertions(+), 0 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 884a9ae..946a196 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -3,6 +3,7 @@ - - fix ipv6 name for lookup fix. - - improve mount location error reporting. - - fix paged query more results check. -+- fix dumpmaps not reading maps. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/lib/master.c b/lib/master.c -index 153a38b..6c89e1d 100644 ---- a/lib/master.c -+++ b/lib/master.c -@@ -1283,6 +1283,15 @@ int master_show_mounts(struct master *master) - printf("\nMount point: %s\n", ap->path); - printf("\nsource(s):\n"); - -+ /* -+ * 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); diff --git a/autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch b/autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch deleted file mode 100644 index cf0b069..0000000 --- a/autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch +++ /dev/null @@ -1,33 +0,0 @@ -autofs-5.0.6 - fix fix LDAP result leaks on error paths - -From: Ian Kent - -The previous patch with which ensured that the result struture returned -from ldap_search_s(3) was freed could sometimes lead to a segmentation -fault because the local variable used was not initialized before use. ---- - - modules/lookup_ldap.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/modules/lookup_ldap.c -+++ autofs-5.0.6/modules/lookup_ldap.c -@@ -1521,7 +1521,7 @@ int lookup_read_master(struct master *ma - char buf[MAX_ERR_BUF]; - char parse_buf[PARSE_MAX_BUF]; - char *query; -- LDAPMessage *result, *e; -+ LDAPMessage *result = NULL, *e; - char *class, *info, *entry; - char **keyValue = NULL; - char **values = NULL; -@@ -2467,7 +2467,7 @@ static int lookup_one(struct autofs_poin - char buf[MAX_ERR_BUF]; - time_t age = time(NULL); - char *query; -- LDAPMessage *result, *e; -+ LDAPMessage *result = NULL, *e; - char *class, *info, *entry; - char *enc_key1, *enc_key2; - int enc_len1 = 0, enc_len2 = 0; diff --git a/autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch b/autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch deleted file mode 100644 index 88b4a5d..0000000 --- a/autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch +++ /dev/null @@ -1,40 +0,0 @@ -autofs-5.0.6 - fix fix map source check in file lookup - -From: Ian Kent - -A recent change to correct a problem with included map entry removal -has broken a different case of included map key lookup. The check in -previous patch was too broad and caused map key lookup for keys in an -included multi-mount map entrys to not be found. ---- - - CHANGELOG | 1 + - modules/lookup_file.c | 2 +- - 2 files changed, 2 insertions(+), 1 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index cb9ac75..304b6a2 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -11,6 +11,7 @@ - - add "dir" map-type. - - fix wait for master source mutex. - - fix submount shutdown race. -+- fix fix map source check in file lookup. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/lookup_file.c b/modules/lookup_file.c -index 8ead07c..63b5ae7 100644 ---- a/modules/lookup_file.c -+++ b/modules/lookup_file.c -@@ -1046,7 +1046,7 @@ do_cache_lookup: - * instance (same map entry cache), not in a distinct source. - */ - if (me && (!me->mapent || -- (ap->type == LKP_INDIRECT && me->source != source))) { -+ (me->source != source && *me->key != '/'))) { - while ((me = cache_lookup_key_next(me))) - if (me->source == source) - break; diff --git a/autofs-5.0.6-fix-fix-wait-for-master-source-mutex.patch b/autofs-5.0.6-fix-fix-wait-for-master-source-mutex.patch deleted file mode 100644 index 5d0036d..0000000 --- a/autofs-5.0.6-fix-fix-wait-for-master-source-mutex.patch +++ /dev/null @@ -1,28 +0,0 @@ -autofs-5.0.6 - fix fix wait for master source mutex - -From: Ian Kent - -The "wait for master source mutex" change wait for a busy read/write -mutex to become available instead of failing. The s390x architecture -is slower than the Intel architectures and the time allowed to wait -can be too short leading to a failure anyway. - -This patch increases the maximum wait from 1 second to 5 seconds to -avoid false positive fails. ---- - - lib/master.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/lib/master.c -+++ autofs-5.0.6/lib/master.c -@@ -552,7 +552,7 @@ void master_source_writelock(struct mast - - void master_source_readlock(struct master_mapent *entry) - { -- int retries = 5; /* 1 second maximum */ -+ int retries = 25; /* 5 second maximum */ - int status; - - while (retries--) { diff --git a/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch b/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch deleted file mode 100644 index 4246df3..0000000 --- a/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch +++ /dev/null @@ -1,52 +0,0 @@ -autofs-5.0.6 - fix function to check mount.nfs version - -From: Leonardo Chiquitto - -The function check_nfs_mount_version() compares the version -of mount.nfs to decide whether a feature is available or not. - -There's a bug in the version comparison code that causes -1.3.0 to be considered less than 1.1.1. This patch fixes it. ---- - - CHANGELOG | 1 + - lib/mounts.c | 17 +++++------------ - 2 files changed, 6 insertions(+), 12 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -31,6 +31,7 @@ - - catch EHOSTUNREACH and bail out early. - - systemd support fixes. - - check scandir() return value. -+- fix function to check mount.nfs version. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -249,18 +249,11 @@ int check_nfs_mount_version(struct nfs_m - } - - if (ret) { -- if (vers->major == check->major && -- vers->minor == check->minor && -- vers->fix == check->fix) -- ; -- else { -- if (vers->major < check->major) -- ret = 0; -- else if (vers->minor < check->minor) -- ret = 0; -- else if (vers->fix < check->fix) -- ret = 0; -- } -+ if ((vers->major < check->major) || -+ ((vers->major == check->major) && (vers->minor < check->minor)) || -+ ((vers->major == check->major) && (vers->minor == check->minor) && -+ (vers->fix < check->fix))) -+ ret = 0; - } - - if (waitpid(f, &status, 0) != f) ; diff --git a/autofs-5.0.6-fix-get_nfs_info-incorrectly-fails.patch b/autofs-5.0.6-fix-get_nfs_info-incorrectly-fails.patch deleted file mode 100644 index 8617a15..0000000 --- a/autofs-5.0.6-fix-get_nfs_info-incorrectly-fails.patch +++ /dev/null @@ -1,35 +0,0 @@ -autofs-5.0.6 - fix get_nfs_info() can incorrectly fail - -From: Ian Kent - -In function get_nfs_info(), if both TCP and UDP protocols are being -checked, the TCP check passes but the UDP check fails, the function -will incorrectly return a fail to the caller. ---- - - CHANGELOG | 1 + - modules/replicated.c | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -59,6 +59,7 @@ - - fix devce ioctl alloc path check. - - add hup signal handling to hosts map. - - fix systemd argument passing. -+- fix get_nfs_info() can incorrectly fail. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -769,7 +769,7 @@ static int get_vers_and_cost(unsigned lo - supported = get_nfs_info(logopt, host, - &pm_info, &rpc_info, "udp", vers, options); - if (IS_ERR(supported)) { -- if (ERR(supported) == ETIMEDOUT) -+ if (!ret && ERR(supported) == ETIMEDOUT) - return ret; - } else if (supported) { - ret = 1; diff --git a/autofs-5.0.6-fix-improve-mount-location-error-reporting.patch b/autofs-5.0.6-fix-improve-mount-location-error-reporting.patch deleted file mode 100644 index 0db620a..0000000 --- a/autofs-5.0.6-fix-improve-mount-location-error-reporting.patch +++ /dev/null @@ -1,49 +0,0 @@ -autofs-5.0.6 - fix improve mount location error reporting - -From: Ian Kent - -The validate_location() function is meant to check for a small subset -of map location errors only but the "improve mount location error -reporting" patch inverted a logic test which has made the scope of -the test greater causing false positive fails. So add a check for -those special cases and return success instead. ---- - - CHANGELOG | 1 + - modules/parse_sun.c | 14 ++++++++++++++ - 2 files changed, 15 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -19,6 +19,7 @@ - - add piddir to configure. - - add systemd unit support. - - remove empty command line arguments (passed by systemd). -+- fix improve mount location error reporting. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -868,6 +868,20 @@ static int validate_location(unsigned in - * have ":", "[" and "]". - */ - if (!check_colon(ptr)) { -+ char *esc; -+ /* -+ * Don't forget cases where a colon is present but -+ * not followed by a "/" or, if there is no colon at -+ * all, we don't know if it is actually invalid since -+ * it may be a map name by itself, for example. -+ */ -+ if (!strchr(ptr, ':') || -+ ((esc = strchr(ptr, '\\')) && *(esc + 1) == ':') || -+ !strncmp(ptr, "file:", 5) || !strncmp(ptr, "yp:", 3) || -+ !strncmp(ptr, "nis:", 4) || !strncmp(ptr, "nisplus:", 8) || -+ !strncmp(ptr, "ldap:", 5) || !strncmp(ptr, "ldaps:", 6) || -+ !strncmp(ptr, "dir:", 4)) -+ return 1; - error(logopt, - "expected colon delimeter not found in location %s", - loc); diff --git a/autofs-5.0.6-fix-initialization-in-rpc-create_client.patch b/autofs-5.0.6-fix-initialization-in-rpc-create_client.patch deleted file mode 100644 index 0131132..0000000 --- a/autofs-5.0.6-fix-initialization-in-rpc-create_client.patch +++ /dev/null @@ -1,70 +0,0 @@ -autofs-5.0.6 - fix initialization in rpc create_client() - -From: Ian Kent - -Sometimes the RPC function create_client() gets a non-null stack -variable passed in which can cause a SEGV. Fix it by initializing -the passed in variable. ---- - - CHANGELOG | 1 + - lib/rpc_subs.c | 11 ++++++++--- - 2 files changed, 9 insertions(+), 3 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -40,6 +40,7 @@ - - fix sss wildcard match. - - fix dlopen() error handling in sss module. - - fix configure string length tests for sss library. -+- fix initialization in rpc create_client(). - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -316,6 +316,7 @@ static int create_client(struct conn_inf - int fd, ret; - - fd = RPC_ANYSOCK; -+ *client = NULL; - - if (info->client) { - if (!clnt_control(info->client, CLGET_FD, (char *) &fd)) { -@@ -344,7 +345,10 @@ static int create_client(struct conn_inf - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_ADDRCONFIG; - hints.ai_family = AF_UNSPEC; -- hints.ai_socktype = SOCK_DGRAM; -+ if (info->proto->p_proto == IPPROTO_UDP) -+ hints.ai_socktype = SOCK_DGRAM; -+ else -+ hints.ai_socktype = SOCK_STREAM; - - ret = getaddrinfo(info->host, NULL, &hints, &ai); - if (ret) { -@@ -377,12 +381,13 @@ static int create_client(struct conn_inf - - freeaddrinfo(ai); - -+done: - if (!*client) { - info->client = NULL; - ret = -ENOTCONN; - goto out_close; - } --done: -+ - /* Close socket fd on destroy, as is default for rpcowned fds */ - if (!clnt_control(*client, CLSET_FD_CLOSE, NULL)) { - clnt_destroy(*client); -@@ -800,7 +805,7 @@ static int rpc_get_exports_proto(struct - (xdrproc_t) xdr_void, NULL, - (xdrproc_t) xdr_exports, (caddr_t) exp, - info->timeout); -- if (status != RPC_PROGVERSMISMATCH) -+ if (status == RPC_SUCCESS) - break; - if (++vers_entry > 2) - break; diff --git a/autofs-5.0.6-fix-ipv6-configure-check.patch b/autofs-5.0.6-fix-ipv6-configure-check.patch deleted file mode 100644 index 39d283f..0000000 --- a/autofs-5.0.6-fix-ipv6-configure-check.patch +++ /dev/null @@ -1,185 +0,0 @@ -autofs-5.0.6 - fix ipv6 configure check - -From: Ian Kent - -Since the functions clntudp6_bufcreate() and clnttcp6_create() of -libtirpc were never actually included in the library our reference -to clntudp6_bufcreate() in configure needs to be removed. - -Having redone the libtirpc interface (after realizing these functions -were defined but not actually included in the library) checking for -IPv6 support can't be done now and we need to rely on the transport -independent nature of libtirpc to take care of this. So the INET6 -checks have been replaced with WITH_LIBTIRPC checks instead. ---- - - CHANGELOG | 1 + - aclocal.m4 | 36 ------------------------------------ - configure | 46 ---------------------------------------------- - include/config.h.in | 3 --- - modules/replicated.c | 10 +++++++--- - 5 files changed, 8 insertions(+), 88 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -15,6 +15,7 @@ - - add disable move mount configure option. - - fix ipv6 name lookup check. - - fix ipv6 rpc calls. -+- fix ipv6 configure check. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/aclocal.m4 -+++ autofs-5.0.6/aclocal.m4 -@@ -324,41 +324,6 @@ LIBS="$af_check_ldap_parse_page_control_ - ]) - - dnl -------------------------------------------------------------------------- --dnl AF_CHECK_LIBTIRPC_IPV6 --dnl --dnl Use libtirpc for rpc transport --dnl -------------------------------------------------------------------------- --AC_DEFUN([AF_CHECK_LIBTIRPC_IPV6], --[AC_MSG_CHECKING(if libtirpc has IPv6 support) -- --# save current flags --af_check_libtirpc_ipv6_save_cflags="$CFLAGS" --af_check_libtirpc_ipv6_save_ldflags="$LDFLAGS" --CFLAGS="$CFLAGS -I/usr/include/tirpc" --LDFLAGS="$LDFLAGS -ltirpc" -- --AC_TRY_LINK( -- [ #define INET6 -- #include ], -- [ CLIENT *cl; -- struct sockaddr_in6 addr; -- int fd; -- unsigned long ul; struct timeval t; unsigned int ui; -- cl = clntudp6_bufcreate(&addr,ul,ul,t,&fd,ui,ui); ], -- [ af_have_libtirpc_ipv6=yes -- AC_MSG_RESULT(yes) ], -- [ AC_MSG_RESULT(no) ]) -- --if test "$af_have_libtirpc_ipv6" = "yes"; then -- AC_DEFINE(INET6,1, [Use IPv6 with libtirpc]) --fi -- --# restore flags --CFLAGS="$af_check_libtirpc_ipv6_save_cflags" --LDFLAGS="$af_check_libtirpc_ipv6_save_ldflags" --]) -- --dnl -------------------------------------------------------------------------- - dnl AF_CHECK_LIBTIRPC - dnl - dnl Use libtirpc for rpc transport -@@ -399,7 +364,6 @@ AC_ARG_WITH(libtirpc, - [ --with-libtirpc use libtirpc if available], - [if test "$withval" = yes; then - AF_CHECK_LIBTIRPC() -- AF_CHECK_LIBTIRPC_IPV6() - else - AC_MSG_RESULT(no) - fi], [AC_MSG_RESULT(no)]) ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -3087,52 +3087,6 @@ fi - CFLAGS="$af_check_libtirpc_save_cflags" - LDFLAGS="$af_check_libtirpc_save_ldflags" - -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtirpc has IPv6 support" >&5 --$as_echo_n "checking if libtirpc has IPv6 support... " >&6; } -- --# save current flags --af_check_libtirpc_ipv6_save_cflags="$CFLAGS" --af_check_libtirpc_ipv6_save_ldflags="$LDFLAGS" --CFLAGS="$CFLAGS -I/usr/include/tirpc" --LDFLAGS="$LDFLAGS -ltirpc" -- --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- #define INET6 -- #include --int --main () --{ -- CLIENT *cl; -- struct sockaddr_in6 addr; -- int fd; -- unsigned long ul; struct timeval t; unsigned int ui; -- cl = clntudp6_bufcreate(&addr,ul,ul,t,&fd,ui,ui); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- af_have_libtirpc_ipv6=yes -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- --if test "$af_have_libtirpc_ipv6" = "yes"; then -- --$as_echo "#define INET6 1" >>confdefs.h -- --fi -- --# restore flags --CFLAGS="$af_check_libtirpc_ipv6_save_cflags" --LDFLAGS="$af_check_libtirpc_ipv6_save_ldflags" -- - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - $as_echo "no" >&6; } ---- autofs-5.0.6.orig/include/config.h.in -+++ autofs-5.0.6/include/config.h.in -@@ -72,9 +72,6 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_UNISTD_H - --/* Use IPv6 with libtirpc */ --#undef INET6 -- - /* Use libxml2 tsd usage workaround */ - #undef LIBXML2_WORKAROUND - ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -180,7 +180,7 @@ static unsigned int get_proximity(struct - break; - - case AF_INET6: --#ifndef INET6 -+#ifndef WITH_LIBTIRPC - return PROXIMITY_UNSUPPORTED; - #else - addr6 = (struct sockaddr_in6 *) host_addr; -@@ -229,7 +229,9 @@ static unsigned int get_proximity(struct - break; - - case AF_INET6: --#ifdef INET6 -+#ifndef WITH_LIBTIRPC -+ return PROXIMITY_UNSUPPORTED; -+#else - if (host_addr->sa_family == AF_INET) - break; - -@@ -309,7 +311,9 @@ static unsigned int get_proximity(struct - break; - - case AF_INET6: --#ifdef INET6 -+#ifndef WITH_LIBTIRPC -+ return PROXIMITY_UNSUPPORTED; -+#else - if (host_addr->sa_family == AF_INET) - break; - diff --git a/autofs-5.0.6-fix-ipv6-name-for-lookup-fix.patch b/autofs-5.0.6-fix-ipv6-name-for-lookup-fix.patch deleted file mode 100644 index fbb8473..0000000 --- a/autofs-5.0.6-fix-ipv6-name-for-lookup-fix.patch +++ /dev/null @@ -1,79 +0,0 @@ -autofs-5.0.6 - fix ipv6 name for lookup fix - -From: Ian Kent - -Fix an error in the recent ipv6 name for lookup patch. - -Reported by Leonardo Chiquitto who provided a patch to resolve the -problem. The patch below is a slightly modified version of his patch. ---- - - CHANGELOG | 4 ++++ - modules/replicated.c | 13 ++++++++----- - 2 files changed, 12 insertions(+), 5 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 849a38c..e5dfa83 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -1,3 +1,7 @@ -+??/??/20?? autofs-5.0.7 -+======================= -+- fix ipv6 name for lookup fix. -+ - 28/06/2011 autofs-5.0.6 - ----------------------- - - fix included map read fail handling. -diff --git a/modules/replicated.c b/modules/replicated.c -index 7f2b892..a10a817 100644 ---- a/modules/replicated.c -+++ b/modules/replicated.c -@@ -1111,7 +1111,8 @@ static int add_host_addrs(struct host **list, const char *host, - unsigned int weight, unsigned int options) - { - struct addrinfo hints, *ni, *this; -- char *name = strdup(host); -+ char *n_ptr; -+ char *name = n_ptr = strdup(host); - int len; - char buf[MAX_ERR_BUF]; - int rr = 0; -@@ -1125,15 +1126,17 @@ static int add_host_addrs(struct host **list, const char *host, - } - len = strlen(name); - -- if (name[0] == '[' && name[--len] == ']') -+ if (name[0] == '[' && name[--len] == ']') { - name[len] = '\0'; -+ name++; -+ } - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - -- ret = getaddrinfo(name + 1, NULL, &hints, &ni); -+ ret = getaddrinfo(name, NULL, &hints, &ni); - if (ret) - goto try_name; - -@@ -1153,7 +1156,7 @@ try_name: - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_DGRAM; - -- ret = getaddrinfo(name + 1, NULL, &hints, &ni); -+ ret = getaddrinfo(name, NULL, &hints, &ni); - if (ret) { - error(LOGOPT_ANY, "hostname lookup failed: %s", - gai_strerror(ret)); -@@ -1172,7 +1175,7 @@ try_name: - } - freeaddrinfo(ni); - done: -- free(name); -+ free(n_ptr); - return ret; - } - diff --git a/autofs-5.0.6-fix-ipv6-name-lookup-check.patch b/autofs-5.0.6-fix-ipv6-name-lookup-check.patch deleted file mode 100644 index d8fd7c4..0000000 --- a/autofs-5.0.6-fix-ipv6-name-lookup-check.patch +++ /dev/null @@ -1,63 +0,0 @@ -autofs-5.0.6 - fix ipv6 name lookup check - -From: Ian Kent - -The host address must be used when the host name has multiple -addresses since we need to mount the specific host and so that -it is known what host log entries refer to. - -But the check for multiple addresses can be wrong because there -is no distinction between ipv4 and ipv6 addresses. Change the -check to use the host name when mounting if neither the ipv4 -or the ipv6 addresses have more than one record. ---- - - CHANGELOG | 1 + - modules/replicated.c | 17 +++++++++++++++-- - 2 files changed, 16 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -13,6 +13,7 @@ - - fix submount shutdown race. - - fix fix map source check in file lookup. - - add disable move mount configure option. -+- fix ipv6 name lookup check. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -1117,7 +1117,7 @@ static int add_host_addrs(struct host ** - char *name = n_ptr = strdup(host); - int len; - char buf[MAX_ERR_BUF]; -- int rr = 0; -+ int rr = 0, rr4 = 0, rr6 = 0; - int ret; - - if (!name) { -@@ -1167,8 +1167,21 @@ try_name: - } - - this = ni; -- if (this->ai_next) -+ while (this->ai_next) { -+ if (this->ai_family == AF_INET) { -+ struct sockaddr_in *addr = (struct sockaddr_in *) this->ai_addr; -+ if (addr->sin_addr.s_addr != INADDR_LOOPBACK) -+ 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)) -+ rr6++; -+ } -+ this = this->ai_next; -+ } -+ if (rr4 > 1 || rr6 > 1) - rr++; -+ this = ni; - while (this) { - ret = add_new_host(list, host, weight, this, rr, options); - if (!ret) diff --git a/autofs-5.0.6-fix-ipv6-rpc-calls.patch b/autofs-5.0.6-fix-ipv6-rpc-calls.patch deleted file mode 100644 index ed8230d..0000000 --- a/autofs-5.0.6-fix-ipv6-rpc-calls.patch +++ /dev/null @@ -1,531 +0,0 @@ -autofs-5.0.6 - fix ipv6 rpc calls - -From: Ian Kent - -There is a mistake in the way autofs uses libtirpc. Two IPv6 compatibiliy -functions were thought to be included when in fact they were not and would -not actually work with IPv6 anyway. - -To fix that the libtirpc interface code needed to be re-written. Portmap -(using libtirpc calls) is still used to get service port numbers, rather -than rpcbind. ---- - - CHANGELOG | 1 - lib/rpc_subs.c | 370 ++++++++++++++++++++------------------------------- - modules/replicated.c | 8 - - 3 files changed, 155 insertions(+), 224 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -14,6 +14,7 @@ - - fix fix map source check in file lookup. - - add disable move mount configure option. - - fix ipv6 name lookup check. -+- fix ipv6 rpc calls. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -62,89 +62,6 @@ static const rpcvers_t mount_vers[] = { - static int connect_nb(int, struct sockaddr *, socklen_t, struct timeval *); - inline void dump_core(void); - --static CLIENT *rpc_clntudp_create(struct sockaddr *addr, struct conn_info *info, int *fd) --{ -- struct sockaddr_in *in4_raddr; -- struct sockaddr_in6 *in6_raddr; -- CLIENT *client = NULL; -- -- switch (addr->sa_family) { -- case AF_INET: -- in4_raddr = (struct sockaddr_in *) addr; -- in4_raddr->sin_port = htons(info->port); -- client = clntudp_bufcreate(in4_raddr, -- info->program, info->version, -- info->timeout, fd, -- info->send_sz, info->recv_sz); -- break; -- -- case AF_INET6: --#ifndef INET6 -- /* Quiet compile warning */ -- in6_raddr = NULL; --#else -- in6_raddr = (struct sockaddr_in6 *) addr; -- in6_raddr->sin6_port = htons(info->port); -- client = clntudp6_bufcreate(in6_raddr, -- info->program, info->version, -- info->timeout, fd, -- info->send_sz, info->recv_sz); --#endif -- break; -- -- default: -- break; -- } -- -- return client; --} -- --static CLIENT *rpc_clnttcp_create(struct sockaddr *addr, struct conn_info *info, int *fd) --{ -- struct sockaddr_in *in4_raddr; -- struct sockaddr_in6 *in6_raddr; -- CLIENT *client = NULL; -- socklen_t slen; -- -- switch (addr->sa_family) { -- case AF_INET: -- in4_raddr = (struct sockaddr_in *) addr; -- in4_raddr->sin_port = htons(info->port); -- slen = sizeof(struct sockaddr_in); -- -- if (connect_nb(*fd, addr, slen, &info->timeout) < 0) -- break; -- -- client = clnttcp_create(in4_raddr, -- info->program, info->version, fd, -- info->send_sz, info->recv_sz); -- break; -- -- case AF_INET6: --#ifndef INET6 -- /* Quiet compile warning */ -- in6_raddr = NULL; --#else -- in6_raddr = (struct sockaddr_in6 *) addr; -- in6_raddr->sin6_port = htons(info->port); -- slen = sizeof(struct sockaddr_in6); -- -- if (connect_nb(*fd, addr, slen, &info->timeout) < 0) -- break; -- -- client = clnttcp6_create(in6_raddr, -- info->program, info->version, fd, -- info->send_sz, info->recv_sz); --#endif -- break; -- -- default: -- break; -- } -- -- return client; --} -- - /* - * Perform a non-blocking connect on the socket fd. - * -@@ -232,12 +149,12 @@ done: - return ret; - } - -+#ifndef WITH_LIBTIRPC - static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd) - { - CLIENT *client = NULL; -- struct sockaddr *laddr; - struct sockaddr_in in4_laddr; -- struct sockaddr_in6 in6_laddr; -+ struct sockaddr_in in4_raddr; - int type, proto; - socklen_t slen; - -@@ -252,48 +169,41 @@ static CLIENT *rpc_do_create_client(stru - * layer, it would bind to a reserved port, which has been shown - * to exhaust the reserved port range in some situations. - */ -- switch (addr->sa_family) { -- case AF_INET: -- in4_laddr.sin_family = AF_INET; -- in4_laddr.sin_port = htons(0); -- in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY); -- slen = sizeof(struct sockaddr_in); -- laddr = (struct sockaddr *) &in4_laddr; -- break; -- -- case AF_INET6: --#ifndef INET6 -- /* Quiet compiler */ -- in6_laddr.sin6_family = AF_INET6; -- return NULL; --#else -- in6_laddr.sin6_family = AF_INET6; -- in6_laddr.sin6_port = htons(0); -- in6_laddr.sin6_addr = in6addr_any; -- slen = sizeof(struct sockaddr_in6); -- laddr = (struct sockaddr *) &in6_laddr; -- break; --#endif -- default: -- return NULL; -- } -+ in4_laddr.sin_family = AF_INET; -+ in4_laddr.sin_port = htons(0); -+ in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ slen = sizeof(struct sockaddr_in); - - if (!info->client) { -+ struct sockaddr *laddr; -+ - *fd = open_sock(addr->sa_family, type, proto); - if (*fd < 0) - return NULL; - -+ laddr = (struct sockaddr *) &in4_laddr; - if (bind(*fd, laddr, slen) < 0) - return NULL; - } - -+ in4_raddr = (struct sockaddr_in *) addr; -+ in4_raddr->sin_port = htons(info->port); -+ - switch (info->proto->p_proto) { - case IPPROTO_UDP: -- client = rpc_clntudp_create(addr, info, fd); -+ client = clntudp_bufcreate(in4_raddr, -+ info->program, info->version, -+ info->timeout, fd, -+ info->send_sz, info->recv_sz); - break; - - case IPPROTO_TCP: -- client = rpc_clnttcp_create(addr, info, fd); -+ if (connect_nb(*fd, addr, slen, &info->timeout) < 0) -+ break; -+ -+ client = clnttcp_create(in4_raddr, -+ info->program, info->version, fd, -+ info->send_sz, info->recv_sz); - break; - - default: -@@ -302,20 +212,126 @@ static CLIENT *rpc_do_create_client(stru - - return client; - } -+#else -+struct netconfig *find_netconf(void *handle, char *family, char *proto) -+{ -+ struct netconfig *nconf; -+ -+ while ((nconf = getnetconfig(handle))) { -+ if ((strcmp(nconf->nc_protofmly, family) == 0) && -+ (strcmp(nconf->nc_proto, proto) == 0)) -+ break; -+ } -+ -+ return nconf; -+} -+ -+static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd) -+{ -+ CLIENT *client = NULL; -+ struct sockaddr_in in4_laddr; -+ struct sockaddr_in6 in6_laddr; -+ struct sockaddr *laddr = NULL; -+ struct netconfig *nconf; -+ struct netbuf nb_addr; -+ int type, proto; -+ char *nc_family, *nc_proto; -+ void *handle; -+ size_t slen; -+ -+ proto = info->proto->p_proto; -+ if (proto == IPPROTO_UDP) { -+ type = SOCK_DGRAM; -+ nc_proto = NC_UDP; -+ } else { -+ type = SOCK_STREAM; -+ nc_proto = NC_TCP; -+ } -+ -+ /* -+ * bind to any unused port. If we left this up to the rpc -+ * layer, it would bind to a reserved port, which has been shown -+ * to exhaust the reserved port range in some situations. -+ */ -+ if (addr->sa_family == AF_INET) { -+ struct sockaddr_in *in4_raddr = (struct sockaddr_in *) addr; -+ in4_laddr.sin_family = AF_INET; -+ in4_laddr.sin_port = htons(0); -+ in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY); -+ laddr = (struct sockaddr *) &in4_laddr; -+ in4_raddr->sin_port = htons(info->port); -+ slen = sizeof(struct sockaddr_in); -+ nc_family = NC_INET; -+ } else if (addr->sa_family == AF_INET6) { -+ struct sockaddr_in6 *in6_raddr = (struct sockaddr_in6 *) addr; -+ in6_laddr.sin6_family = AF_INET6; -+ in6_laddr.sin6_port = htons(0); -+ in6_laddr.sin6_addr = in6addr_any; -+ laddr = (struct sockaddr *) &in6_laddr; -+ in6_raddr->sin6_port = htons(info->port); -+ slen = sizeof(struct sockaddr_in6); -+ nc_family = NC_INET6; -+ } else -+ return NULL; -+ -+ handle = setnetconfig(); -+ if (!handle) -+ return NULL; -+ -+ nconf = find_netconf(handle, nc_family, nc_proto); -+ if (!nconf) { -+ endnetconfig(handle); -+ return NULL; -+ } -+ -+ /* -+ * bind to any unused port. If we left this up to the rpc layer, -+ * it would bind to a reserved port, which has been shown to -+ * exhaust the reserved port range in some situations. -+ */ -+ if (!info->client) { -+ *fd = open_sock(addr->sa_family, type, proto); -+ if (*fd < 0) { -+ endnetconfig(handle); -+ return NULL; -+ } -+ -+ if (bind(*fd, laddr, slen) < 0) { -+ endnetconfig(handle); -+ return NULL; -+ } -+ } -+ -+ nb_addr.maxlen = nb_addr.len = slen; -+ nb_addr.buf = addr; -+ -+ if (info->proto->p_proto == IPPROTO_TCP) { -+ if (connect_nb(*fd, addr, slen, &info->timeout) < 0) { -+ endnetconfig(handle); -+ return NULL; -+ } -+ } -+ -+ client = clnt_tli_create(*fd, nconf, &nb_addr, -+ info->program, info->version, -+ info->send_sz, info->recv_sz); -+ -+ endnetconfig(handle); -+ -+ return client; -+} -+#endif - - /* -- * Create a UDP RPC client -+ * Create an RPC client - */ --static CLIENT *create_udp_client(struct conn_info *info) -+static CLIENT *create_client(struct conn_info *info) - { - CLIENT *client = NULL; - struct addrinfo *ai, *haddr; - struct addrinfo hints; - int fd, ret; - -- if (info->proto->p_proto != IPPROTO_UDP) -- return NULL; -- - fd = RPC_ANYSOCK; - - if (info->client) { -@@ -355,6 +371,11 @@ static CLIENT *create_udp_client(struct - - haddr = ai; - while (haddr) { -+ if (haddr->ai_protocol != info->proto->p_proto) { -+ haddr = haddr->ai_next; -+ continue; -+ } -+ - client = rpc_do_create_client(haddr->ai_addr, info, &fd); - if (client) - break; -@@ -408,7 +429,7 @@ int rpc_udp_getclient(struct conn_info * - info->program = program; - info->version = version; - -- client = create_udp_client(info); -+ client = create_client(info); - - if (!client) - return 0; -@@ -428,92 +449,6 @@ void rpc_destroy_udp_client(struct conn_ - return; - } - --/* -- * Create a TCP RPC client using non-blocking connect -- */ --static CLIENT *create_tcp_client(struct conn_info *info) --{ -- CLIENT *client = NULL; -- struct addrinfo *ai, *haddr; -- struct addrinfo hints; -- int fd, ret; -- -- if (info->proto->p_proto != IPPROTO_TCP) -- return NULL; -- -- fd = RPC_ANYSOCK; -- -- if (info->client) { -- if (!clnt_control(info->client, CLGET_FD, (char *) &fd)) { -- fd = RPC_ANYSOCK; -- clnt_destroy(info->client); -- info->client = NULL; -- } else { -- clnt_control(info->client, CLSET_FD_NCLOSE, NULL); -- clnt_destroy(info->client); -- } -- } -- -- if (info->addr) { -- client = rpc_do_create_client(info->addr, info, &fd); -- if (client) -- goto done; -- -- if (!info->client) { -- close(fd); -- fd = RPC_ANYSOCK; -- } -- } -- -- memset(&hints, 0, sizeof(hints)); -- hints.ai_flags = AI_ADDRCONFIG; -- hints.ai_family = AF_UNSPEC; -- hints.ai_socktype = SOCK_STREAM; -- -- ret = getaddrinfo(info->host, NULL, &hints, &ai); -- if (ret) { -- error(LOGOPT_ANY, -- "hostname lookup failed: %s", gai_strerror(ret)); -- info->client = NULL; -- goto out_close; -- } -- -- haddr = ai; -- while (haddr) { -- client = rpc_do_create_client(haddr->ai_addr, info, &fd); -- if (client) -- break; -- -- if (!info->client && fd != RPC_ANYSOCK) { -- close(fd); -- fd = RPC_ANYSOCK; -- } -- -- haddr = haddr->ai_next; -- } -- -- freeaddrinfo(ai); -- -- if (!client) { -- info->client = NULL; -- goto out_close; -- } --done: -- /* Close socket fd on destroy, as is default for rpcowned fds */ -- if (!clnt_control(client, CLSET_FD_CLOSE, NULL)) { -- clnt_destroy(client); -- info->client = NULL; -- goto out_close; -- } -- -- return client; -- --out_close: -- if (fd != -1) -- close(fd); -- return NULL; --} -- - int rpc_tcp_getclient(struct conn_info *info, - unsigned int program, unsigned int version) - { -@@ -533,7 +468,7 @@ int rpc_tcp_getclient(struct conn_info * - info->program = program; - info->version = version; - -- client = create_tcp_client(info); -+ client = create_client(info); - - if (!client) - return 0; -@@ -593,12 +528,9 @@ int rpc_portmap_getclient(struct conn_in - info->close_option = option; - info->client = NULL; - -- if (pe_proto->p_proto == IPPROTO_TCP) { -+ if (pe_proto->p_proto == IPPROTO_TCP) - info->timeout.tv_sec = PMAP_TOUT_TCP; -- client = create_tcp_client(info); -- } else -- client = create_udp_client(info); -- -+ client = create_client(info); - if (!client) - return 0; - -@@ -635,11 +567,7 @@ unsigned short rpc_portmap_getport(struc - pmap_info.send_sz = RPCSMALLMSGSIZE; - pmap_info.recv_sz = RPCSMALLMSGSIZE; - -- if (proto == IPPROTO_TCP) -- client = create_tcp_client(&pmap_info); -- else -- client = create_udp_client(&pmap_info); -- -+ client = create_client(&pmap_info); - if (!client) - return 0; - } -@@ -700,10 +628,8 @@ int rpc_ping_proto(struct conn_info *inf - if (info->proto->p_proto == IPPROTO_UDP) { - info->send_sz = UDPMSGSIZE; - info->recv_sz = UDPMSGSIZE; -- client = create_udp_client(info); -- } else -- client = create_tcp_client(info); -- -+ } -+ client = create_client(info); - if (!client) - return 0; - } -@@ -857,10 +783,8 @@ static int rpc_get_exports_proto(struct - if (info->proto->p_proto == IPPROTO_UDP) { - info->send_sz = UDPMSGSIZE; - info->recv_sz = UDPMSGSIZE; -- client = create_udp_client(info); -- } else -- client = create_tcp_client(info); -- -+ } -+ client = create_client(info); - if (!client) - return 0; - ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -1095,7 +1095,13 @@ static int add_new_host(struct host **li - if (prx == PROXIMITY_ERROR) - return 0; - -- addr_len = sizeof(struct sockaddr); -+ if (host_addr->ai_addr->sa_family == AF_INET) -+ addr_len = INET_ADDRSTRLEN; -+ else if (host_addr->ai_addr->sa_family == AF_INET6) -+ addr_len = INET6_ADDRSTRLEN; -+ else -+ return 0; -+ - new = new_host(host, host_addr->ai_addr, addr_len, prx, weight, options); - if (!new) - return 0; diff --git a/autofs-5.0.6-fix-kernel-verion-check-of-version-components.patch b/autofs-5.0.6-fix-kernel-verion-check-of-version-components.patch deleted file mode 100644 index cc7ad24..0000000 --- a/autofs-5.0.6-fix-kernel-verion-check-of-version-components.patch +++ /dev/null @@ -1,94 +0,0 @@ -autofs-5.0.6 - fix kernel verion check of version components - -From: Ian Kent - -Oops, not following the ball. - -The kernel may have (or will have at times) a two digit version number. -Fix the version check function to allow for this. ---- - - CHANGELOG | 1 + - include/mounts.h | 15 +-------------- - lib/mounts.c | 29 +++++++++++++++++++++++++++++ - 3 files changed, 31 insertions(+), 14 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -46,6 +46,7 @@ - - duplicate parent options for included maps. - - update ->timeout() function to not return timeout. - - move timeout to map_source (allow per direct map timeout). -+- fix kernel verion check of version components. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -75,26 +75,13 @@ struct mnt_list { - struct list_head ordered; - }; - --static inline unsigned int linux_version_code(void) --{ -- struct utsname my_utsname; -- unsigned int p, q, r; -- char *save; -- -- if (uname(&my_utsname)) -- return 0; -- -- p = (unsigned int) atoi(strtok_r(my_utsname.release, ".", &save)); -- q = (unsigned int) atoi(strtok_r(NULL, ".", &save)); -- r = (unsigned int) atoi(strtok_r(NULL, ".", &save)); -- return KERNEL_VERSION(p, q, r); --} - - struct nfs_mount_vers { - unsigned int major; - unsigned int minor; - unsigned int fix; - }; -+unsigned int linux_version_code(void); - int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *); - extern unsigned int nfs_mount_uses_string_options; - ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -46,6 +46,35 @@ static const char mnt_name_template[] - static struct kernel_mod_version kver = {0, 0}; - static const char kver_options_template[] = "fd=%d,pgrp=%u,minproto=3,maxproto=5"; - -+unsigned int linux_version_code(void) -+{ -+ struct utsname my_utsname; -+ unsigned int p, q, r; -+ char *tmp, *save; -+ -+ if (uname(&my_utsname)) -+ return 0; -+ -+ p = q = r = 0; -+ -+ tmp = strtok_r(my_utsname.release, ".", &save); -+ if (!tmp) -+ return 0; -+ p = (unsigned int ) atoi(tmp); -+ -+ tmp = strtok_r(NULL, ".", &save); -+ if (!tmp) -+ return KERNEL_VERSION(p, 0, 0); -+ q = (unsigned int) atoi(tmp); -+ -+ tmp = strtok_r(NULL, ".", &save); -+ if (!tmp) -+ return KERNEL_VERSION(p, q, 0); -+ r = (unsigned int) atoi(tmp); -+ -+ return KERNEL_VERSION(p, q, r); -+} -+ - unsigned int query_kproto_ver(void) - { - struct ioctl_ops *ops = get_ioctl_ops(); diff --git a/autofs-5.0.6-fix-libtirpc-name-clash.patch b/autofs-5.0.6-fix-libtirpc-name-clash.patch deleted file mode 100644 index 2cbc299..0000000 --- a/autofs-5.0.6-fix-libtirpc-name-clash.patch +++ /dev/null @@ -1,45 +0,0 @@ -autofs-5.0.6 - fix libtirpc name clash - -From: Ian Kent - -The tirpc function auth_destroy() is a macro definition in tirpc/rpc/auth.h -which includes an unconditional call to a function log_debug() which clashes -with an autofs function of the same name and has a different call signature. - -To fix it redefine auth_destroy() and exclude the debug log call. ---- - - CHANGELOG | 1 + - lib/rpc_subs.c | 10 ++++++++++ - 2 files changed, 11 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -41,6 +41,7 @@ - - fix dlopen() error handling in sss module. - - fix configure string length tests for sss library. - - fix initialization in rpc create_client(). -+- fix libtirpc name clash. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -34,6 +34,16 @@ - #include - #include - -+#ifdef WITH_LIBTIRPC -+#undef auth_destroy -+#define auth_destroy(auth) \ -+ do { \ -+ int refs; \ -+ if ((refs = auth_put((auth))) == 0) \ -+ ((*((auth)->ah_ops->ah_destroy))(auth));\ -+ } while (0) -+#endif -+ - #include "mount.h" - #include "rpc_subs.h" - #include "automount.h" diff --git a/autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch b/autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch deleted file mode 100644 index 15ff157..0000000 --- a/autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch +++ /dev/null @@ -1,45 +0,0 @@ -autofs-5.0.6 - fix lsb service name in init script 2 - -From: Ian Kent - -The "Required-Start:" and "Required-Stop:" in the init script header -incorrectly uses $ypbind instead of ypbind. This isn't correct as -using names starting with a $ is reserved for standards-defined -facilities. ---- - - redhat/autofs.init.in | 4 ++-- - samples/rc.autofs.in | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - - -diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in -index 86b7eb4..48d387d 100644 ---- a/redhat/autofs.init.in -+++ b/redhat/autofs.init.in -@@ -9,8 +9,8 @@ - # - ### BEGIN INIT INFO - # Provides: autofs --# Required-Start: $network $ypbind --# Required-Stop: $network $ypbind -+# Required-Start: $network ypbind -+# Required-Stop: $network ypbind - # Default-Start: 3 4 5 - # Default-Stop: 0 1 2 6 - # Short-Description: Automounts filesystems on demand -diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in -index 0306ef6..35667ba 100644 ---- a/samples/rc.autofs.in -+++ b/samples/rc.autofs.in -@@ -8,8 +8,8 @@ - # - ### BEGIN INIT INFO - # Provides: autofs --# Required-Start: $network $ypbind --# Required-Stop: $network $ypbind -+# Required-Start: $network ypbind -+# Required-Stop: $network ypbind - # Default-Start: 3 4 5 - # Default-Stop: 0 1 2 6 - # Short-Description: Automounts filesystems on demand diff --git a/autofs-5.0.6-fix-nfs4-contacts-portmap.patch b/autofs-5.0.6-fix-nfs4-contacts-portmap.patch deleted file mode 100644 index 57b1ae7..0000000 --- a/autofs-5.0.6-fix-nfs4-contacts-portmap.patch +++ /dev/null @@ -1,52 +0,0 @@ -autofs-5.0.6 - fix nfs4 contacts portmap - -From: Ian Kent - -When an fstype of nfs4 is specified probing the server for availability -should not need to contact the portmapper, it should use either the port -specified by the port= option or use port 2049. - -However, in function modules/replicated.c:get_nfs_info() a check for the -port= option, and subsequent portmap lookup when not it's not present, is -done before the check for whether nfsv3 is to be checked at all. - -Oops! ---- - - CHANGELOG | 1 + - modules/replicated.c | 6 +++--- - 2 files changed, 4 insertions(+), 3 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -49,6 +49,7 @@ - - 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. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -589,6 +589,9 @@ static unsigned int get_nfs_info(unsigne - } - - v3_ver: -+ if (!(version & NFS3_REQUESTED)) -+ goto v2_ver; -+ - if (!have_port_opt) { - status = rpc_portmap_getclient(pm_info, - host->name, host->addr, host->addr_len, -@@ -600,9 +603,6 @@ v3_ver: - goto done_ver; - } - -- if (!(version & NFS3_REQUESTED)) -- goto v2_ver; -- - if (have_port_opt) { - if (!(rpc_info->port = get_port_option(options))) - goto done_ver; diff --git a/autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch b/autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch deleted file mode 100644 index 099ac11..0000000 --- a/autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch +++ /dev/null @@ -1,56 +0,0 @@ -autofs-5.0.6 - fix not bind mounting local filesystem - -From: Ian Kent - -When the --random-multimount-selection (-r) option is used automount(8) -won't bind mount a local filesystem. If the filesystem that has been -requested is local it should always be used. ---- - - CHANGELOG | 1 + - modules/replicated.c | 12 +++++++----- - 2 files changed, 8 insertions(+), 5 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index acc5f0c..7e86c84 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -7,6 +7,7 @@ - - fix result null check in read_one_map(). - - fix LDAP result leaks on error paths. - - code analysis fixes part 1. -+- fix not bind mounting local filesystem. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/replicated.c b/modules/replicated.c -index a10a817..eee1a06 100644 ---- a/modules/replicated.c -+++ b/modules/replicated.c -@@ -1068,18 +1068,20 @@ static int add_new_host(struct host **list, - * We can't use PROXIMITY_LOCAL or we won't perform an RPC ping - * to remove hosts that may be down. - */ -- if (options & MOUNT_FLAG_RANDOM_SELECT) -+ if (!host_addr) - 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 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. -+ * 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)) -+ (options & (MOUNT_FLAG_USE_WEIGHT_ONLY | -+ MOUNT_FLAG_RANDOM_SELECT))) - prx = PROXIMITY_SUBNET; - } - diff --git a/autofs-5.0.6-fix-offset-dir-removal.patch b/autofs-5.0.6-fix-offset-dir-removal.patch deleted file mode 100644 index b9b6a4d..0000000 --- a/autofs-5.0.6-fix-offset-dir-removal.patch +++ /dev/null @@ -1,88 +0,0 @@ -autofs-5.0.6 - fix offset dir removal - -From: Ian Kent - -When removing autofs multi-mount directories (which usually means the -top level tree where no mount is present at the base) at expire we -need to take care not to remove the top directory of the tree if the -origin map is an indirect mount that has the browse option set. ---- - - lib/mounts.c | 43 +++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 41 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1687,6 +1687,41 @@ cont: - return mounted; - } - -+static int rmdir_path_offset(struct autofs_point *ap, struct mapent *oe) -+{ -+ char *dir, *path; -+ unsigned int split; -+ int ret; -+ -+ if (ap->type == LKP_DIRECT) -+ return rmdir_path(ap, oe->key, oe->multi->dev); -+ -+ dir = strdup(oe->key); -+ -+ if (ap->flags & MOUNT_FLAG_GHOST) -+ split = strlen(ap->path) + strlen(oe->multi->key) + 1; -+ else -+ split = strlen(ap->path); -+ -+ dir[split] = '\0'; -+ path = &dir[split + 1]; -+ -+ if (chdir(dir) == -1) { -+ error(ap->logopt, "failed to chdir to %s", dir); -+ free(dir); -+ return -1; -+ } -+ -+ ret = rmdir_path(ap, path, ap->dev); -+ -+ free(dir); -+ -+ if (chdir("/") == -1) -+ error(ap->logopt, "failed to chdir to /"); -+ -+ return ret; -+} -+ - int umount_multi_triggers(struct autofs_point *ap, struct mapent *me, char *root, const char *base) - { - char path[PATH_MAX + 1]; -@@ -1748,11 +1783,13 @@ int umount_multi_triggers(struct autofs_ - * ok so only try and remount the offset if the - * actual mount point still exists. - */ -- ret = rmdir_path(ap, oe->key, ap->dev); -+ ret = rmdir_path_offset(ap, oe); - if (ret == -1 && !stat(oe->key, &st)) { - ret = do_mount_autofs_offset(ap, oe, root, offset); - if (ret) - left++; -+ /* But we did origianlly create this */ -+ oe->flags |= MOUNT_FLAG_DIR_CREATED; - } - } - } -@@ -1914,11 +1951,13 @@ int clean_stale_multi_triggers(struct au - * ok so only try and remount the offset if the - * actual mount point still exists. - */ -- ret = rmdir_path(ap, oe->key, ap->dev); -+ ret = rmdir_path_offset(ap, oe); - if (ret == -1 && !stat(oe->key, &st)) { - ret = do_mount_autofs_offset(ap, oe, root, offset); - if (ret) { - left++; -+ /* But we did origianlly create this */ -+ oe->flags |= MOUNT_FLAG_DIR_CREATED; - free(key); - continue; - } diff --git a/autofs-5.0.6-fix-offset-mount-point-directory-removal.patch b/autofs-5.0.6-fix-offset-mount-point-directory-removal.patch deleted file mode 100644 index 0bf8c92..0000000 --- a/autofs-5.0.6-fix-offset-mount-point-directory-removal.patch +++ /dev/null @@ -1,167 +0,0 @@ -autofs-5.0.6 - fix offset mount point directory removal - -From: Ian Kent - -Attempting to remove the last component of a multi-mount offset mount -point is incorrect. The removal and attempted recovery is better -handled in the calling function. ---- - - CHANGELOG | 1 - daemon/direct.c | 7 ---- - lib/mounts.c | 82 ++++++++++++++++++++++++++++++++------------------------ - 3 files changed, 49 insertions(+), 41 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -54,6 +54,7 @@ - - fix sss map age not updated. - - fix remount deadlock. - - fix umount recovery of busy direct mount. -+- fix offset mount point directory removal. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/direct.c -+++ autofs-5.0.6/daemon/direct.c -@@ -633,13 +633,6 @@ force_umount: - } else - info(ap->logopt, "umounted offset mount %s", me->key); - -- if (!rv && me->flags & MOUNT_FLAG_DIR_CREATED) { -- if (rmdir(me->key) == -1) { -- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -- warn(ap->logopt, "failed to remove dir %s: %s", -- me->key, estr); -- } -- } - return rv; - } - ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1605,6 +1605,33 @@ int umount_ent(struct autofs_point *ap, - return rv; - } - -+static int do_mount_autofs_offset(struct autofs_point *ap, -+ struct mapent *oe, const char *root, -+ char *offset) -+ -+{ -+ int mounted = 0; -+ int ret; -+ -+ debug(ap->logopt, "mount offset %s at %s", oe->key, root); -+ -+ ret = mount_autofs_offset(ap, oe, root, offset); -+ if (ret >= MOUNT_OFFSET_OK) -+ mounted++; -+ else { -+ if (ret != MOUNT_OFFSET_IGNORE) -+ warn(ap->logopt, "failed to mount offset"); -+ else { -+ debug(ap->logopt, "ignoring \"nohide\" trigger %s", -+ oe->key); -+ free(oe->mapent); -+ oe->mapent = NULL; -+ } -+ } -+ -+ return mounted; -+} -+ - int mount_multi_triggers(struct autofs_point *ap, struct mapent *me, - const char *root, unsigned int start, const char *base) - { -@@ -1613,8 +1640,7 @@ int mount_multi_triggers(struct autofs_p - struct mapent *oe; - struct list_head *pos = NULL; - unsigned int fs_path_len; -- unsigned int mounted; -- int ret; -+ int mounted; - - fs_path_len = start + strlen(base); - if (fs_path_len > PATH_MAX) -@@ -1634,22 +1660,7 @@ int mount_multi_triggers(struct autofs_p - if (!oe || !oe->mapent) - goto cont; - -- debug(ap->logopt, "mount offset %s at %s", oe->key, root); -- -- ret = mount_autofs_offset(ap, oe, root, offset); -- if (ret >= MOUNT_OFFSET_OK) -- mounted++; -- else { -- if (ret != MOUNT_OFFSET_IGNORE) -- warn(ap->logopt, "failed to mount offset"); -- else { -- debug(ap->logopt, -- "ignoring \"nohide\" trigger %s", -- oe->key); -- free(oe->mapent); -- oe->mapent = NULL; -- } -- } -+ mounted += do_mount_autofs_offset(ap, oe, root, offset); - cont: - offset = cache_get_offset(base, - offset, start, &me->multi_list, &pos); -@@ -1681,7 +1692,6 @@ int umount_multi_triggers(struct autofs_ - pos = NULL; - offset = path; - -- /* Make sure "none" of the offsets have an active mount. */ - while ((offset = cache_get_offset(mm_base, offset, start, mm_root, &pos))) { - char *oe_base; - -@@ -1700,28 +1710,32 @@ int umount_multi_triggers(struct autofs_ - if (oe->ioctlfd != -1 || - is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { - left++; -- break; -- } -- } -- -- if (left) -- return left; -- -- pos = NULL; -- offset = path; -- -- /* Make sure "none" of the offsets have an active mount. */ -- while ((offset = cache_get_offset(mm_base, offset, start, mm_root, &pos))) { -- oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list); -- /* root offset is a special case */ -- if (!oe || !oe->mapent || (strlen(oe->key) - start) == 1) - continue; -+ } - - debug(ap->logopt, "umount offset %s", oe->key); - - if (umount_autofs_offset(ap, oe)) { - warn(ap->logopt, "failed to umount offset"); - left++; -+ } else { -+ struct stat st; -+ int ret; -+ -+ if (!(oe->flags & MOUNT_FLAG_DIR_CREATED)) -+ continue; -+ -+ /* -+ * An error due to partial directory removal is -+ * ok so only try and remount the offset if the -+ * actual mount point still exists. -+ */ -+ ret = rmdir_path(ap, oe->key, ap->dev); -+ if (ret == -1 && !stat(oe->key, &st)) { -+ ret = do_mount_autofs_offset(ap, oe, root, offset); -+ if (ret) -+ left++; -+ } - } - } - diff --git a/autofs-5.0.6-fix-paged-query-more-results-check.patch b/autofs-5.0.6-fix-paged-query-more-results-check.patch deleted file mode 100644 index b842521..0000000 --- a/autofs-5.0.6-fix-paged-query-more-results-check.patch +++ /dev/null @@ -1,87 +0,0 @@ -autofs-5.0.6 - fix paged query more results check - -From: Ian Kent - -When getting paged results from an LDAP server the server returns an -opaque cookie (of type berval) that is used to retrieve the next page. -The criteria for deciding if there are more pages is that the berval -value is non-null and has a non-zero length. - -To determine if the berval value has non-zero length autofs checks the -strlen() of the value but on ppc64 and s390x this can return 0 even if -the value has non-zero length causing a premature termination of the -query. - -Fix this by also checking the berval length field. -Also make sure we free the opaque cookie when the query is finished. ---- - - CHANGELOG | 1 + - modules/lookup_ldap.c | 13 ++++++++++++- - 2 files changed, 13 insertions(+), 1 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index a178b74..884a9ae 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -2,6 +2,7 @@ - ======================= - - fix ipv6 name for lookup fix. - - improve mount location error reporting. -+- fix paged query more results check. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c -index 719fed1..a25050a 100644 ---- a/modules/lookup_ldap.c -+++ b/modules/lookup_ldap.c -@@ -2041,7 +2041,8 @@ do_paged: - rv = ldap_parse_page_control(sp->ldap, - returnedControls, &sp->totalCount, - &sp->cookie); -- if (sp->cookie && sp->cookie->bv_val && strlen(sp->cookie->bv_val)) -+ if (sp->cookie && sp->cookie->bv_val && -+ (strlen(sp->cookie->bv_val) || sp->cookie->bv_len)) - sp->morePages = TRUE; - else - sp->morePages = FALSE; -@@ -2382,6 +2383,10 @@ static int read_one_map(struct autofs_point *ap, - rv == LDAP_SIZELIMIT_EXCEEDED) { - if (sp.result) - ldap_msgfree(sp.result); -+ if (sp.cookie) { -+ ber_bvfree(sp.cookie); -+ sp.cookie = NULL; -+ } - sp.pageSize = sp.pageSize / 2; - if (sp.pageSize < 5) { - debug(ap->logopt, MODPREFIX -@@ -2397,6 +2402,8 @@ static int read_one_map(struct autofs_point *ap, - if (rv != LDAP_SUCCESS || !sp.result) { - unbind_ldap_connection(ap->logopt, sp.ldap, ctxt); - *result_ldap = rv; -+ if (sp.cookie) -+ ber_bvfree(sp.cookie); - free(sp.query); - return NSS_STATUS_UNAVAIL; - } -@@ -2406,6 +2413,8 @@ static int read_one_map(struct autofs_point *ap, - ldap_msgfree(sp.result); - unbind_ldap_connection(ap->logopt, sp.ldap, ctxt); - *result_ldap = rv; -+ if (sp.cookie) -+ ber_bvfree(sp.cookie); - free(sp.query); - return NSS_STATUS_NOTFOUND; - } -@@ -2417,6 +2426,8 @@ static int read_one_map(struct autofs_point *ap, - unbind_ldap_connection(ap->logopt, sp.ldap, ctxt); - - source->age = age; -+ if (sp.cookie) -+ ber_bvfree(sp.cookie); - free(sp.query); - - return NSS_STATUS_SUCCESS; diff --git a/autofs-5.0.6-fix-recursive-mount-deadlock.patch b/autofs-5.0.6-fix-recursive-mount-deadlock.patch deleted file mode 100644 index e6549a7..0000000 --- a/autofs-5.0.6-fix-recursive-mount-deadlock.patch +++ /dev/null @@ -1,78 +0,0 @@ -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/autofs-5.0.6-fix-remount-deadlock.patch b/autofs-5.0.6-fix-remount-deadlock.patch deleted file mode 100644 index 31a92ed..0000000 --- a/autofs-5.0.6-fix-remount-deadlock.patch +++ /dev/null @@ -1,136 +0,0 @@ -autofs-5.0.6 - fix remount deadlock - -From: Ian Kent - -When reconstructing the mount tree upon restart a writelock to the map -entry cache cannot be taken when parsing a direct map entry because a -readlock is already held higher up in the call tree. - -In the place this is done it isn't be necessary to alter the direct map -entries in the cache. Also, it shouldn't be necessary to delete existing -multi-mount cache entries to avoid a duplicate multi-mount entry error -return. The check for a duplicate can be done in the cache handling -functions. ---- - - CHANGELOG | 1 - lib/cache.c | 8 ++++-- - modules/parse_sun.c | 60 ++++++++++++++++++++++++++-------------------------- - 3 files changed, 36 insertions(+), 33 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -52,6 +52,7 @@ - - fix nfs4 contacts portmap. - - make autofs wait longer for shutdown completion. - - fix sss map age not updated. -+- fix remount deadlock. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/cache.c -+++ autofs-5.0.6/lib/cache.c -@@ -658,10 +658,12 @@ int cache_add_offset(struct mapent_cache - return CHE_FAIL; - - me = cache_lookup_distinct(mc, key); -- if (me && me != owner) -- return CHE_DUPLICATE; -+ if (me && me->age == age) { -+ if (me != owner) -+ return CHE_DUPLICATE; -+ } - -- ret = cache_add(mc, owner->source, key, mapent, age); -+ ret = cache_update(mc, owner->source, key, mapent, age); - if (ret == CHE_FAIL) { - warn(logopt, "failed to add key %s to cache", key); - return CHE_FAIL; ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -843,12 +843,17 @@ add_offset_entry(struct autofs_point *ap - strcpy(m_mapent, loc); - - ret = cache_add_offset(mc, name, m_key, m_mapent, age); -- if (ret == CHE_OK) -+ if (ret == CHE_DUPLICATE) -+ warn(ap->logopt, MODPREFIX -+ "syntax error or duplicate offset %s -> %s", path, loc); -+ else if (ret == CHE_FAIL) -+ debug(ap->logopt, MODPREFIX -+ "failed to add multi-mount offset %s -> %s", path, m_mapent); -+ else { -+ ret = CHE_OK; - debug(ap->logopt, MODPREFIX - "added multi-mount offset %s -> %s", path, m_mapent); -- else -- warn(ap->logopt, MODPREFIX -- "syntax error or duplicate offset %s -> %s", path, loc); -+ } - - return ret; - } -@@ -1410,7 +1415,7 @@ int parse_mount(struct autofs_point *ap, - char buf[MAX_ERR_BUF]; - struct map_source *source; - struct mapent_cache *mc; -- struct mapent *me = NULL; -+ struct mapent *me; - char *pmapent, *options; - const char *p; - int mapent_len, rv = 0; -@@ -1561,33 +1566,28 @@ int parse_mount(struct autofs_point *ap, - strcat(m_root, name); - } - -- cache_writelock(mc); -- me = cache_lookup_distinct(mc, name); -- if (!me) { -- int ret; -- /* -- * Not in the cache, perhaps it's a program map -- * or one that doesn't support enumeration -- */ -- ret = cache_add(mc, source, name, mapent, time(NULL)); -- if (ret == CHE_FAIL) { -- cache_unlock(mc); -- free(options); -- return 1; -+ /* -+ * Can't take the write lock for direct mount entries here -+ * but they should always be present in the map entry cache. -+ */ -+ if (ap->type == LKP_INDIRECT) { -+ cache_writelock(mc); -+ me = cache_lookup_distinct(mc, name); -+ if (!me) { -+ int ret; -+ /* -+ * Not in the cache, perhaps it's a program map -+ * or one that doesn't support enumeration. -+ */ -+ ret = cache_add(mc, source, name, mapent, age); -+ if (ret == CHE_FAIL) { -+ cache_unlock(mc); -+ free(options); -+ return 1; -+ } - } -- } else { -- /* -- * If the entry exists it must not have any existing -- * multi-mount subordinate entries since we are -- * mounting this afresh. We need to do this to allow -- * us to fail on the check for duplicate offsets in -- * we don't know when submounts go away. -- */ -- cache_multi_writelock(me); -- cache_delete_offset_list(mc, name); -- cache_multi_unlock(me); -+ cache_unlock(mc); - } -- cache_unlock(mc); - - cache_readlock(mc); - me = cache_lookup_distinct(mc, name); diff --git a/autofs-5.0.6-fix-remount-of-multi-mount.patch b/autofs-5.0.6-fix-remount-of-multi-mount.patch deleted file mode 100644 index 59dd7f7..0000000 --- a/autofs-5.0.6-fix-remount-of-multi-mount.patch +++ /dev/null @@ -1,49 +0,0 @@ -autofs-5.0.6 - fix remount of multi mount - -From: Ian Kent - -Went accessing a multi-mount only the the offsets that need to be mounted -are mounted. But when re-mounting multi-mounts during a restart we need to -also traverse into existing mounts and re-connect to triggers mounted within -them. ---- - - CHANGELOG | 1 + - lib/mounts.c | 15 +++++++++++++++ - 2 files changed, 16 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -55,6 +55,7 @@ - - fix remount deadlock. - - fix umount recovery of busy direct mount. - - fix offset mount point directory removal. -+- fix remount of multi mount. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1661,6 +1661,21 @@ int mount_multi_triggers(struct autofs_p - goto cont; - - mounted += do_mount_autofs_offset(ap, oe, root, offset); -+ -+ /* -+ * If re-constructing a multi-mount it's necessary to walk -+ * into nested mounts, unlike the usual "mount only what's -+ * needed as you go" behavior. -+ */ -+ if (ap->state == ST_READMAP && ap->flags & MOUNT_FLAG_REMOUNT) { -+ if (oe->ioctlfd != -1 || -+ is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { -+ char oe_root[PATH_MAX + 1]; -+ strcpy(oe_root, root); -+ strcat(oe_root, offset); -+ mount_multi_triggers(ap, oe, oe_root, strlen(oe_root), base); -+ } -+ } - cont: - offset = cache_get_offset(base, - offset, start, &me->multi_list, &pos); diff --git a/autofs-5.0.6-fix-result-null-check-in-read_one_map.patch b/autofs-5.0.6-fix-result-null-check-in-read_one_map.patch deleted file mode 100644 index ac888d2..0000000 --- a/autofs-5.0.6-fix-result-null-check-in-read_one_map.patch +++ /dev/null @@ -1,58 +0,0 @@ -autofs-5.0.6 - fix result null check in read_one_map() - -From: Ian Kent - -Fix the check and reset to NULL of the LDAP library allocated result -within the loop to fetch paged query values. ---- - - CHANGELOG | 1 + - modules/lookup_ldap.c | 7 ++++++- - 2 files changed, 7 insertions(+), 1 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 946a196..66b804f 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -4,6 +4,7 @@ - - improve mount location error reporting. - - fix paged query more results check. - - fix dumpmaps not reading maps. -+- fix result null check in read_one_map(). - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c -index a25050a..22ff355 100644 ---- a/modules/lookup_ldap.c -+++ b/modules/lookup_ldap.c -@@ -2381,8 +2381,10 @@ static int read_one_map(struct autofs_point *ap, - - if (rv == LDAP_ADMINLIMIT_EXCEEDED || - rv == LDAP_SIZELIMIT_EXCEEDED) { -- if (sp.result) -+ if (sp.result) { - ldap_msgfree(sp.result); -+ sp.result = NULL; -+ } - if (sp.cookie) { - ber_bvfree(sp.cookie); - sp.cookie = NULL; -@@ -2402,6 +2404,8 @@ static int read_one_map(struct autofs_point *ap, - if (rv != LDAP_SUCCESS || !sp.result) { - unbind_ldap_connection(ap->logopt, sp.ldap, ctxt); - *result_ldap = rv; -+ if (sp.result) -+ ldap_msgfree(sp.result); - if (sp.cookie) - ber_bvfree(sp.cookie); - free(sp.query); -@@ -2419,6 +2423,7 @@ static int read_one_map(struct autofs_point *ap, - return NSS_STATUS_NOTFOUND; - } - ldap_msgfree(sp.result); -+ sp.result = NULL; - } while (sp.morePages == TRUE); - - debug(ap->logopt, MODPREFIX "done updating map"); diff --git a/autofs-5.0.6-fix-rework-error-return-handling-in-rpc-code.patch b/autofs-5.0.6-fix-rework-error-return-handling-in-rpc-code.patch deleted file mode 100644 index c2eba23..0000000 --- a/autofs-5.0.6-fix-rework-error-return-handling-in-rpc-code.patch +++ /dev/null @@ -1,45 +0,0 @@ -autofs-5.0.6 - fix rework error return handling in rpc code - -From: Dustin Polke - -This fixes the following error: -rpc_subs.c: In function ‘rpc_do_create_client’: -rpc_subs.c:203:3: error: a label can only be part of a statement and a -declaration is not a statement ---- - - CHANGELOG | 1 + - lib/rpc_subs.c | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -33,6 +33,7 @@ - - check scandir() return value. - - fix function to check mount.nfs version. - - fix typo in libtirpc file name. -+- fix rework error return handling in rpc code. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -155,7 +155,7 @@ static int rpc_do_create_client(struct s - CLIENT *clnt = NULL; - struct sockaddr_in in4_laddr; - struct sockaddr_in *in4_raddr; -- int type, proto; -+ int type, proto, ret; - socklen_t slen; - - *client = NULL; -@@ -200,7 +200,7 @@ static int rpc_do_create_client(struct s - break; - - case IPPROTO_TCP: -- int ret = connect_nb(*fd, addr, slen, &info->timeout); -+ ret = connect_nb(*fd, addr, slen, &info->timeout); - if (ret < 0) - return ret; - diff --git a/autofs-5.0.6-fix-rpc-build-error.patch b/autofs-5.0.6-fix-rpc-build-error.patch deleted file mode 100644 index 13b9057..0000000 --- a/autofs-5.0.6-fix-rpc-build-error.patch +++ /dev/null @@ -1,35 +0,0 @@ -autofs-5.0.6 - fix rpc build error - -From: Leonardo Chiquitto - -The compile error looks like a problem in the libtirpc interface code rewrite -(commit f8ea2a5762 - autofs-5.0.6 - fix ipv6 rpc calls). The following patch -should fix it. ---- - - CHANGELOG | 1 + - lib/rpc_subs.c | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -20,6 +20,7 @@ - - add systemd unit support. - - remove empty command line arguments (passed by systemd). - - fix improve mount location error reporting. -+- fix rpc build error. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -154,7 +154,7 @@ static CLIENT *rpc_do_create_client(stru - { - CLIENT *client = NULL; - struct sockaddr_in in4_laddr; -- struct sockaddr_in in4_raddr; -+ struct sockaddr_in *in4_raddr; - int type, proto; - socklen_t slen; - diff --git a/autofs-5.0.6-fix-segfault-in-get_query_dn.patch b/autofs-5.0.6-fix-segfault-in-get_query_dn.patch deleted file mode 100644 index 7f49038..0000000 --- a/autofs-5.0.6-fix-segfault-in-get_query_dn.patch +++ /dev/null @@ -1,58 +0,0 @@ -autofs-5.0.6 - fix segfault in get_query_dn() - -From: Leonardo Chiquitto - -Automount will segfault when two threads run get_query_dn() -simultaneously and $SEARCH_BASE is defined in sysconfig. -This happens because a thread tries to dereference ctxt->sdns -while another thread running the same function frees the -memory. - -I believe we don't need to reread $SEARCH_BASE every time -get_query_dn() is called. - -edit: Ian Kent -move the read of configured search dns to lookup_init(). -edit end ---- - - modules/lookup_ldap.c | 13 +++---------- - 1 file changed, 3 insertions(+), 10 deletions(-) - - ---- autofs-5.0.6.orig/modules/lookup_ldap.c -+++ autofs-5.0.6/modules/lookup_ldap.c -@@ -281,7 +281,6 @@ static int get_query_dn(unsigned logopt, - char buf[MAX_ERR_BUF]; - char *query, *dn, *qdn; - LDAPMessage *result, *e; -- struct ldap_searchdn *sdns = NULL; - char *attrs[2]; - struct berval **value; - int scope; -@@ -330,15 +329,6 @@ static int get_query_dn(unsigned logopt, - scope = LDAP_SCOPE_SUBTREE; - } - -- if (!ctxt->base) { -- sdns = defaults_get_searchdns(); -- if (sdns) { -- if (ctxt->sdns) -- defaults_free_searchdns(ctxt->sdns); -- ctxt->sdns = sdns; -- } -- } -- - dn = NULL; - if (!ctxt->sdns) { - rv = ldap_search_s(ldap, ctxt->base, -@@ -1467,6 +1457,9 @@ int lookup_init(const char *mapfmt, int - return 1; - } - -+ if (!ctxt->base) -+ ctxt->sdns = defaults_get_searchdns(); -+ - ctxt->timeout = defaults_get_ldap_timeout(); - ctxt->network_timeout = defaults_get_ldap_network_timeout(); - diff --git a/autofs-5.0.6-fix-segmentation-fault-in-do-remount-indirect.patch b/autofs-5.0.6-fix-segmentation-fault-in-do-remount-indirect.patch deleted file mode 100644 index 9b16a97..0000000 --- a/autofs-5.0.6-fix-segmentation-fault-in-do-remount-indirect.patch +++ /dev/null @@ -1,86 +0,0 @@ -autofs-5.0.6 - fix segmentation fault in do_remount_indirect() - -From: Leonardo Chiquitto - -In some rare circumstance, it's possible that automount will crash -on startup while trying to reconnect to a "half-broken" NFS mount -point. - -The segmentation fault happens because we're not testing scandir()'s -return value in do_remount_indirect(): - -lib/mounts.c: -1210 i = j = scandir(buf, &de2, 0, alphasort); -1211 while (i--) -1212 free(de2[i]); - -So, if scandir() returns -1, it will try to free de2[-1], de2[-2], etc. - -Here's the call trace, for reference: - -Program terminated with signal 11, Segmentation fault. -#0 0x00007ffff7fe2425 in do_remount_indirect (ap=0x7ffff821e070, fd=15, - path=0x7ffff821e150 "/nfs/iil") at mounts.c:1212 -1212 free(de2[i]); -(gdb) print j -$1 = -1 -(gdb) print de2 -$3 = (struct dirent **) 0x0 - -#0 0x00007ffff7fe2425 in do_remount_indirect (ap=0x7ffff821e070, fd=15, - path=0x7ffff821e150 "/nfs/iil") at mounts.c:1212 -#1 0x00007ffff7fe2a48 in remount_active_mount (ap=0x7ffff821e070, mc=0x0, - path=0x7ffff821e150 "/nfs/iil", devid=20, type=, - ioctlfd=0x7ffff6e5babc) at mounts.c:1327 -#2 0x00007ffff7fe2ac6 in try_remount (ap=0x7ffff821e070, me=0x0, type=1) - at mounts.c:1357 -#3 0x00007ffff7fd35e0 in do_mount_autofs_indirect (root=, - ap=) at indirect.c:103 -#4 mount_autofs_indirect (ap=0x7ffff821e070, root=0x7ffff8202d50 "/nfs/iil") - at indirect.c:213 -#5 0x00007ffff7fd1473 in mount_autofs (root=, - ap=) at automount.c:1005 -#6 handle_mounts (arg=0x7fffffffdfd0) at automount.c:1526 -#7 0x00007ffff7b8e5f0 in start_thread (arg=) - at pthread_create.c:297 -#8 0x00007ffff6f3187d in clone () - at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 -#9 0x0000000000000000 in ?? () - -Suggested fix: - -Check scandir() return value - -In some rare circumstance, it's possible that automount will crash -on startup while trying to reconnect to a "half-broken" NFS mount -point. ---- - - CHANGELOG | 1 + - lib/mounts.c | 4 ++++ - 2 files changed, 5 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -30,6 +30,7 @@ - - rework error return handling in rpc code. - - catch EHOSTUNREACH and bail out early. - - systemd support fixes. -+- check scandir() return value. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1355,6 +1355,10 @@ static int do_remount_indirect(struct au - int i, j; - - i = j = scandir(buf, &de2, 0, alphasort); -+ if (i < 0) { -+ free(de[n]); -+ continue; -+ } - while (i--) - free(de2[i]); - free(de2); diff --git a/autofs-5.0.6-fix-sss-map-age.patch b/autofs-5.0.6-fix-sss-map-age.patch deleted file mode 100644 index f30aa1b..0000000 --- a/autofs-5.0.6-fix-sss-map-age.patch +++ /dev/null @@ -1,34 +0,0 @@ -autofs-5.0.6 - fix sss map age not updated - -From: Ian Kent - -The map source age field should be updated when the map is read for -map entry cache cleanup. ---- - - CHANGELOG | 1 + - modules/lookup_sss.c | 2 ++ - 2 files changed, 3 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -51,6 +51,7 @@ - - check if /etc/mtab is a link to /proc/self/mounts. - - fix nfs4 contacts portmap. - - make autofs wait longer for shutdown completion. -+- fix sss map age not updated. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/lookup_sss.c -+++ autofs-5.0.6/modules/lookup_sss.c -@@ -362,6 +362,8 @@ int lookup_read_map(struct autofs_point - - endautomntent(ap->logopt, ctxt, &sss_ctxt); - -+ source->age = age; -+ - return NSS_STATUS_SUCCESS; - } - diff --git a/autofs-5.0.6-fix-sss-wildcard-match.patch b/autofs-5.0.6-fix-sss-wildcard-match.patch deleted file mode 100644 index 4669304..0000000 --- a/autofs-5.0.6-fix-sss-wildcard-match.patch +++ /dev/null @@ -1,41 +0,0 @@ -autofs-5.0.6 - fix sss wildcard match - -From: Ian Kent - -Check for a wildcard map entry on sss map read and convert to -the usual '*' befone adding to the map entry cache. ---- - - CHANGELOG | 1 + - modules/lookup_sss.c | 9 +++++++++ - 2 files changed, 10 insertions(+) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -37,6 +37,7 @@ - - allow MOUNT_WAIT to override probe. - - improve UDP RPC timeout handling. - - use strtok_r() in linux_version_code(). -+- fix sss wildcard match. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/lookup_sss.c -+++ autofs-5.0.6/modules/lookup_sss.c -@@ -325,6 +325,15 @@ int lookup_read_map(struct autofs_point - continue; - } - -+ if (*key == '/' && strlen(key) == 1) { -+ if (ap->type == LKP_DIRECT) { -+ free(key); -+ free(value); -+ continue; -+ } -+ *key = '*'; -+ } -+ - /* - * TODO: implement sun % hack for key translation for - * mixed case keys in schema that are single case only. diff --git a/autofs-5.0.6-fix-submount-shutdown-race.patch b/autofs-5.0.6-fix-submount-shutdown-race.patch deleted file mode 100644 index 1bd908d..0000000 --- a/autofs-5.0.6-fix-submount-shutdown-race.patch +++ /dev/null @@ -1,141 +0,0 @@ -autofs-5.0.6 - fix submount shutdown race - -From: Ian Kent - -Shutdown of submounts is problematic because the kernel doesn't -know when they are going away and so cannot block path walks -while they shut down. After aquiring the locks that cause mount -requests to wait, the daemon checks if the submount is active before -finally umounting it. If the mount is found to be busy the shutdown -is abandoned and the submount returned to a ready state. - -But, if a mount request arrives at the same time as the daemon is -attempting to aquire these locks pthreads appears to become confused -and blocks. So change to using the try version of the lock call and -handling the return appropriately. ---- - - CHANGELOG | 1 + - daemon/automount.c | 76 ++++++++++++++++++++++++++++++++++++++++------------ - 2 files changed, 60 insertions(+), 17 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index cac450f..cb9ac75 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -10,6 +10,7 @@ - - fix not bind mounting local filesystem. - - add "dir" map-type. - - fix wait for master source mutex. -+- fix submount shutdown race. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/daemon/automount.c b/daemon/automount.c -index 376e965..4f3151f 100644 ---- a/daemon/automount.c -+++ b/daemon/automount.c -@@ -1495,6 +1495,41 @@ static void handle_mounts_cleanup(void *arg) - return; - } - -+static int submount_source_writelock_nested(struct autofs_point *ap) -+{ -+ struct autofs_point *parent = ap->parent; -+ int status; -+ -+ status = pthread_rwlock_trywrlock(&parent->entry->source_lock); -+ if (status) -+ goto done; -+ -+ mounts_mutex_lock(parent); -+ -+ status = pthread_rwlock_trywrlock(&ap->entry->source_lock); -+ if (status) { -+ mounts_mutex_unlock(parent); -+ master_source_unlock(parent->entry); -+ } -+ -+done: -+ if (status && status != EBUSY) { -+ logmsg("submount nested master_mapent source write lock failed"); -+ fatal(status); -+ } -+ -+ return status; -+} -+ -+static void submount_source_unlock_nested(struct autofs_point *ap) -+{ -+ struct autofs_point *parent = ap->parent; -+ -+ master_source_unlock(ap->entry); -+ mounts_mutex_unlock(parent); -+ master_source_unlock(parent->entry); -+} -+ - void *handle_mounts(void *arg) - { - struct startup_cond *suc; -@@ -1565,23 +1600,32 @@ void *handle_mounts(void *arg) - master_mutex_lock(); - - if (ap->submount) { -- master_source_writelock(ap->parent->entry); -- mounts_mutex_lock(ap->parent); -- } -- -- master_source_writelock(ap->entry); -+ /* -+ * If a mount request arrives before the locks are -+ * aquired just return to ready state. -+ */ -+ ret = submount_source_writelock_nested(ap); -+ if (ret) { -+ warn(ap->logopt, -+ "can't shutdown submount: mount in progress"); -+ /* Return to ST_READY is done immediately */ -+ st_add_task(ap, ST_READY); -+ master_mutex_unlock(); -+ pthread_setcancelstate(cur_state, NULL); -+ continue; -+ } -+ } else -+ master_source_writelock(ap->entry); - - if (ap->state != ST_SHUTDOWN) { - if (!ap->submount) - alarm_add(ap, ap->exp_runfreq); - /* Return to ST_READY is done immediately */ - st_add_task(ap, ST_READY); -- master_source_unlock(ap->entry); -- if (ap->submount) { -- mounts_mutex_unlock(ap->parent); -- master_source_unlock(ap->parent->entry); -- } -- -+ if (ap->submount) -+ submount_source_unlock_nested(ap); -+ else -+ master_source_unlock(ap->entry); - master_mutex_unlock(); - - pthread_setcancelstate(cur_state, NULL); -@@ -1621,12 +1665,10 @@ void *handle_mounts(void *arg) - alarm_add(ap, ap->exp_runfreq); - /* Return to ST_READY is done immediately */ - st_add_task(ap, ST_READY); -- master_source_unlock(ap->entry); -- if (ap->submount) { -- mounts_mutex_unlock(ap->parent); -- master_source_unlock(ap->parent->entry); -- } -- -+ if (ap->submount) -+ submount_source_unlock_nested(ap); -+ else -+ master_source_unlock(ap->entry); - master_mutex_unlock(); - - pthread_setcancelstate(cur_state, NULL); diff --git a/autofs-5.0.6-fix-systemd-argument-passing.patch b/autofs-5.0.6-fix-systemd-argument-passing.patch deleted file mode 100644 index d5572e3..0000000 --- a/autofs-5.0.6-fix-systemd-argument-passing.patch +++ /dev/null @@ -1,36 +0,0 @@ -autofs-5.0.6 - fix systemd argument passing - -From: Ian Kent - -The substition of the environment variable OPTIONS, from the autofs -confuguration may contain multiple elements that need to be passed -as such when systemd run the unit file. That requires that the braces -be omitted the ExecStart entry of the unit file. ---- - - CHANGELOG | 1 + - samples/autofs.service.in | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -58,6 +58,7 @@ - - fix remount of multi mount. - - fix devce ioctl alloc path check. - - add hup signal handling to hosts map. -+- fix systemd argument passing. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/samples/autofs.service.in -+++ autofs-5.0.6/samples/autofs.service.in -@@ -6,7 +6,7 @@ After=network.target ypbind.service - Type=forking - PIDFile=@@autofspiddir@@/autofs.pid - EnvironmentFile=-@@autofsconfdir@@/autofs --ExecStart=@@sbindir@@/automount ${OPTIONS} --pid-file @@autofspiddir@@/autofs.pid -+ExecStart=@@sbindir@@/automount $OPTIONS --pid-file @@autofspiddir@@/autofs.pid - ExecReload=/usr/bin/kill -HUP $MAINPID - TimeoutSec=180 - diff --git a/autofs-5.0.6-fix-typo-in-libtirpc-file-name.patch b/autofs-5.0.6-fix-typo-in-libtirpc-file-name.patch deleted file mode 100644 index e871db1..0000000 --- a/autofs-5.0.6-fix-typo-in-libtirpc-file-name.patch +++ /dev/null @@ -1,36 +0,0 @@ -autofs-5.0.6 - fix typo in libtirpc file name - -From: Leonardo Chiquitto - -The library file name was misspelled as libitirpc.so. ---- - - CHANGELOG | 1 + - daemon/automount.c | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -32,6 +32,7 @@ - - systemd support fixes. - - check scandir() return value. - - fix function to check mount.nfs version. -+- fix typo in libtirpc file name. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/automount.c -+++ autofs-5.0.6/daemon/automount.c -@@ -2232,9 +2232,9 @@ int main(int argc, char *argv[]) - xmlInitParser(); - #endif - #ifdef TIRPC_WORKAROUND -- void *dh_tirpc = dlopen("libitirpc.so", RTLD_NOW); -+ void *dh_tirpc = dlopen("libtirpc.so", RTLD_NOW); - if (!dh_tirpc) -- dh_tirpc = dlopen("libitirpc.so.1", RTLD_NOW); -+ dh_tirpc = dlopen("libtirpc.so.1", RTLD_NOW); - #endif - - if (!master_read_master(master_list, age, 0)) { diff --git a/autofs-5.0.6-fix-umount-recovery-of-busy-direct-mount.patch b/autofs-5.0.6-fix-umount-recovery-of-busy-direct-mount.patch deleted file mode 100644 index bc2bf42..0000000 --- a/autofs-5.0.6-fix-umount-recovery-of-busy-direct-mount.patch +++ /dev/null @@ -1,66 +0,0 @@ -autofs-5.0.6 - fix umount recovery of busy direct mount - -From: Ian Kent - -Reported by Leonardo Chiquitto (along with a problem analysis that lead -to the resolution). Thanks for the effort Leonardo. - -When umounting direct mounts at exit, if any are busy and contain offset -trigger mounts automount will try and re-mount them when the umount fails -so they can be used to re-construct the mount tree at restart. But this -fails because the kernel communication pipe, which is used as a parameter -when mounting the offsets, has already been closed. To fix this all we -need do is delay closing the kernel pipe file handle until after the -direct mounts have been umounted since this doesn't affect the in use -status of the mounts. ---- - - CHANGELOG | 1 + - daemon/direct.c | 18 +++++++++--------- - 2 files changed, 10 insertions(+), 9 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -53,6 +53,7 @@ - - make autofs wait longer for shutdown completion. - - fix sss map age not updated. - - fix remount deadlock. -+- fix umount recovery of busy direct mount. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/direct.c -+++ autofs-5.0.6/daemon/direct.c -@@ -193,15 +193,6 @@ int umount_autofs_direct(struct autofs_p - struct mnt_list *mnts; - struct mapent *me, *ne; - -- close(ap->state_pipe[0]); -- close(ap->state_pipe[1]); -- if (ap->pipefd >= 0) -- close(ap->pipefd); -- if (ap->kpipefd >= 0) { -- close(ap->kpipefd); -- ap->kpipefd = -1; -- } -- - mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/"); - pthread_cleanup_push(mnts_cleanup, mnts); - nc = ap->entry->master->nc; -@@ -231,6 +222,15 @@ int umount_autofs_direct(struct autofs_p - pthread_cleanup_pop(1); - pthread_cleanup_pop(1); - -+ close(ap->state_pipe[0]); -+ close(ap->state_pipe[1]); -+ if (ap->pipefd >= 0) -+ close(ap->pipefd); -+ if (ap->kpipefd >= 0) { -+ close(ap->kpipefd); -+ ap->kpipefd = -1; -+ } -+ - return 0; - } - diff --git a/autofs-5.0.6-fix-wait-for-master-source-mutex.patch b/autofs-5.0.6-fix-wait-for-master-source-mutex.patch deleted file mode 100644 index 54e24ad..0000000 --- a/autofs-5.0.6-fix-wait-for-master-source-mutex.patch +++ /dev/null @@ -1,84 +0,0 @@ -autofs-5.0.6 - fix wait for master source mutex - -From: Ian Kent - -A previous change that was meant to handle the case where the master map -source mutex read lock count was exceeded was incorrectly done for the -write lock case instead of the read lock case. ---- - - CHANGELOG | 1 + - lib/master.c | 30 +++++++++++++++--------------- - 2 files changed, 16 insertions(+), 15 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 5b988d4..cac450f 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -9,6 +9,7 @@ - - code analysis fixes part 1. - - fix not bind mounting local filesystem. - - add "dir" map-type. -+- fix wait for master source mutex. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/lib/master.c b/lib/master.c -index 6c89e1d..87d1269 100644 ---- a/lib/master.c -+++ b/lib/master.c -@@ -540,38 +540,38 @@ void send_map_update_request(struct autofs_point *ap) - - void master_source_writelock(struct master_mapent *entry) - { -- int retries = 5; /* 1 second maximum */ - int status; - -- while (retries--) { -- status = pthread_rwlock_wrlock(&entry->source_lock); -- if (status != EAGAIN) -- break; -- else { -- struct timespec t = { 0, 200000000 }; -- struct timespec r; -- while (nanosleep(&t, &r) == -1 && errno == EINTR) -- memcpy(&t, &r, sizeof(struct timespec)); -- } -- } -- -+ status = pthread_rwlock_wrlock(&entry->source_lock); - if (status) { - logmsg("master_mapent source write lock failed"); - fatal(status); - } -- - return; - } - - void master_source_readlock(struct master_mapent *entry) - { -+ int retries = 5; /* 1 second maximum */ - int status; - -- status = pthread_rwlock_rdlock(&entry->source_lock); -+ while (retries--) { -+ status = pthread_rwlock_tryrdlock(&entry->source_lock); -+ if (status != EAGAIN && status != EBUSY) -+ break; -+ else { -+ struct timespec t = { 0, 200000000 }; -+ struct timespec r; -+ while (nanosleep(&t, &r) == -1 && errno == EINTR) -+ memcpy(&t, &r, sizeof(struct timespec)); -+ } -+ } -+ - if (status) { - logmsg("master_mapent source read lock failed"); - fatal(status); - } -+ - return; - } - diff --git a/autofs-5.0.6-ignore-duplicate-exports-in-auto-net.patch b/autofs-5.0.6-ignore-duplicate-exports-in-auto-net.patch deleted file mode 100644 index 66a91aa..0000000 --- a/autofs-5.0.6-ignore-duplicate-exports-in-auto-net.patch +++ /dev/null @@ -1,33 +0,0 @@ -autofs-5.0.6 - ignore duplicate exports in auto.net - -From: Paul Smith - - ---- - - CHANGELOG | 1 + - samples/auto.net | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -23,6 +23,7 @@ - - fix rpc build error. - - add sss lookup module. - - teach automount about sss source. -+- ignore duplicate exports in auto.net. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/samples/auto.net -+++ autofs-5.0.6/samples/auto.net -@@ -35,7 +35,7 @@ done - # Newer distributions get this right - SHOWMOUNT="$SMNT --no-headers -e $key" - --$SHOWMOUNT | LC_ALL=C sort -k 1 | \ -+$SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \ - awk -v key="$key" -v opts="$opts" -- ' - BEGIN { ORS=""; first=1 } - { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } diff --git a/autofs-5.0.6-improve-UDP_RPC-timeout-handling.patch b/autofs-5.0.6-improve-UDP_RPC-timeout-handling.patch deleted file mode 100644 index c6899ec..0000000 --- a/autofs-5.0.6-improve-UDP_RPC-timeout-handling.patch +++ /dev/null @@ -1,372 +0,0 @@ -autofs-5.0.6 - improve UDP RPC timeout handling - -From: Ian Kent - -The RPC code still doesn't control timeout quite right. Change that -to take control of the UDP timeout too. ---- - - CHANGELOG | 1 - include/rpc_subs.h | 5 ++ - lib/rpc_subs.c | 93 +++++++++++++++++++-------------------------------- - modules/replicated.c | 36 ++++++++++++------- - 4 files changed, 63 insertions(+), 72 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -35,6 +35,7 @@ - - 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. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/rpc_subs.h -+++ autofs-5.0.6/include/rpc_subs.h -@@ -42,6 +42,9 @@ - #define PMAP_TOUT_UDP 3 - #define PMAP_TOUT_TCP 5 - -+#define RPC_TOUT_UDP PMAP_TOUT_UDP -+#define RPC_TOUT_TCP PMAP_TOUT_TCP -+ - #define HOST_ENT_BUF_SIZE 2048 - - struct conn_info { -@@ -64,7 +67,7 @@ void rpc_destroy_udp_client(struct conn_ - 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); --unsigned short rpc_portmap_getport(struct conn_info *, struct pmap *); -+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); - double elapsed(struct timeval, struct timeval); ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -218,43 +218,24 @@ static int rpc_do_create_client(struct s - return 0; - } - #else --struct netconfig *find_netconf(void *handle, char *family, char *proto) --{ -- struct netconfig *nconf; -- -- while ((nconf = getnetconfig(handle))) { -- if ((strcmp(nconf->nc_protofmly, family) == 0) && -- (strcmp(nconf->nc_proto, proto) == 0)) -- break; -- } -- -- return nconf; --} -- - static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd, CLIENT **client) - { - CLIENT *clnt = NULL; - struct sockaddr_in in4_laddr; - struct sockaddr_in6 in6_laddr; - struct sockaddr *laddr = NULL; -- struct netconfig *nconf; - struct netbuf nb_addr; - int type, proto; -- char *nc_family, *nc_proto; -- void *handle; - size_t slen; - int ret; - - *client = NULL; - - proto = info->proto->p_proto; -- if (proto == IPPROTO_UDP) { -+ if (proto == IPPROTO_UDP) - type = SOCK_DGRAM; -- nc_proto = NC_UDP; -- } else { -+ else - type = SOCK_STREAM; -- nc_proto = NC_TCP; -- } - - /* - * bind to any unused port. If we left this up to the rpc -@@ -269,7 +250,6 @@ 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); -- nc_family = NC_INET; - } else if (addr->sa_family == AF_INET6) { - struct sockaddr_in6 *in6_raddr = (struct sockaddr_in6 *) addr; - in6_laddr.sin6_family = AF_INET6; -@@ -278,20 +258,9 @@ static int rpc_do_create_client(struct s - laddr = (struct sockaddr *) &in6_laddr; - in6_raddr->sin6_port = htons(info->port); - slen = sizeof(struct sockaddr_in6); -- nc_family = NC_INET6; - } else - return -EINVAL; - -- handle = setnetconfig(); -- if (!handle) -- return -EINVAL; -- -- nconf = find_netconf(handle, nc_family, nc_proto); -- if (!nconf) { -- endnetconfig(handle); -- return -EINVAL; -- } -- - /* - * bind to any unused port. If we left this up to the rpc layer, - * it would bind to a reserved port, which has been shown to -@@ -301,13 +270,11 @@ static int rpc_do_create_client(struct s - *fd = open_sock(addr->sa_family, type, proto); - if (*fd < 0) { - ret = -errno; -- endnetconfig(handle); - return ret; - } - - if (bind(*fd, laddr, slen) < 0) { - ret = -errno; -- endnetconfig(handle); - return ret; - } - } -@@ -315,19 +282,23 @@ static int rpc_do_create_client(struct s - nb_addr.maxlen = nb_addr.len = slen; - nb_addr.buf = addr; - -- if (info->proto->p_proto == IPPROTO_TCP) { -+ if (info->proto->p_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) { - ret = connect_nb(*fd, addr, slen, &info->timeout); -- if (ret < 0) { -- endnetconfig(handle); -+ if (ret < 0) - return ret; -- } -- } -- -- clnt = clnt_tli_create(*fd, nconf, &nb_addr, -- info->program, info->version, -- info->send_sz, info->recv_sz); -+ clnt = clnt_vc_create(*fd, &nb_addr, -+ info->program, info->version, -+ info->send_sz, info->recv_sz); -+ } else -+ return -EINVAL; - -- endnetconfig(handle); -+ /* Our timeout is in seconds */ -+ if (clnt && info->timeout.tv_sec) -+ clnt_control(clnt, CLSET_TIMEOUT, (void *) &info->timeout); - - *client = clnt; - -@@ -441,6 +412,8 @@ int rpc_udp_getclient(struct conn_info * - return -ENOENT; - - info->proto = pe_proto; -+ info->timeout.tv_sec = RPC_TOUT_UDP; -+ info->timeout.tv_usec = 0; - info->send_sz = UDPMSGSIZE; - info->recv_sz = UDPMSGSIZE; - } -@@ -480,6 +453,8 @@ int rpc_tcp_getclient(struct conn_info * - return -ENOENT; - - info->proto = pe_proto; -+ info->timeout.tv_sec = RPC_TOUT_TCP; -+ info->timeout.tv_usec = 0; - info->send_sz = 0; - info->recv_sz = 0; - } -@@ -559,10 +534,10 @@ int rpc_portmap_getclient(struct conn_in - return 0; - } - --unsigned short rpc_portmap_getport(struct conn_info *info, struct pmap *parms) -+int rpc_portmap_getport(struct conn_info *info, -+ struct pmap *parms, unsigned short *port) - { - struct conn_info pmap_info; -- unsigned short port = 0; - CLIENT *client; - enum clnt_stat status; - int proto = info->proto->p_proto; -@@ -604,7 +579,7 @@ unsigned short rpc_portmap_getport(struc - if (status == RPC_SUCCESS) { - status = clnt_call(client, PMAPPROC_GETPORT, - (xdrproc_t) xdr_pmap, (caddr_t) parms, -- (xdrproc_t) xdr_u_short, (caddr_t) &port, -+ (xdrproc_t) xdr_u_short, (caddr_t) port, - pmap_info.timeout); - } - -@@ -631,10 +606,12 @@ unsigned short rpc_portmap_getport(struc - clnt_destroy(client); - } - -- if (status != RPC_SUCCESS) -+ if (status == RPC_TIMEDOUT) -+ return -ETIMEDOUT; -+ else if (status != RPC_SUCCESS) - return -EIO; - -- return port; -+ return 0; - } - - int rpc_ping_proto(struct conn_info *info) -@@ -686,7 +663,9 @@ int rpc_ping_proto(struct conn_info *inf - clnt_destroy(client); - } - -- if (status != RPC_SUCCESS) -+ if (status == RPC_TIMEDOUT) -+ return -ETIMEDOUT; -+ else if (status != RPC_SUCCESS) - return -EIO; - - return 1; -@@ -725,8 +704,8 @@ static unsigned int __rpc_ping(const cha - parms.pm_prot = info.proto->p_proto; - parms.pm_port = 0; - -- info.port = rpc_portmap_getport(&info, &parms); -- if (info.port < 0) -+ status = rpc_portmap_getport(&info, &parms, &info.port); -+ if (status < 0) - return status; - - status = rpc_ping_proto(&info); -@@ -915,8 +894,8 @@ exports rpc_get_exports(const char *host - - parms.pm_prot = info.proto->p_proto; - -- info.port = rpc_portmap_getport(&info, &parms); -- if (info.port < 0) -+ status = rpc_portmap_getport(&info, &parms, &info.port); -+ if (status < 0) - goto try_tcp; - - memset(&exportlist, '\0', sizeof(exportlist)); -@@ -932,8 +911,8 @@ try_tcp: - - parms.pm_prot = info.proto->p_proto; - -- info.port = rpc_portmap_getport(&info, &parms); -- if (info.port < 0) -+ status = rpc_portmap_getport(&info, &parms, &info.port); -+ if (status < 0) - return NULL; - - memset(&exportlist, '\0', sizeof(exportlist)); ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -569,7 +569,9 @@ static unsigned int get_nfs_info(unsigne - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status > 0) { -+ if (status == -ETIMEDOUT) -+ return (unsigned int) status; -+ else if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -607,13 +609,12 @@ v3_ver: - } else { - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS3_VERSION; -- status = rpc_portmap_getport(pm_info, &parms); -- if (status == -EHOSTUNREACH) { -+ status = rpc_portmap_getport(pm_info, &parms, &rpc_info->port); -+ if (status == -EHOSTUNREACH || status == -ETIMEDOUT) { - supported = status; - goto done_ver; - } else if (status < 0) - goto v2_ver; -- rpc_info->port = status; - } - - if (rpc_info->proto->p_proto == IPPROTO_UDP) -@@ -627,7 +628,10 @@ v3_ver: - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status > 0) { -+ if (status == -ETIMEDOUT) { -+ supported = status; -+ goto done_ver; -+ } else if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -654,14 +658,12 @@ v2_ver: - } else { - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS2_VERSION; -- rpc_info->port = rpc_portmap_getport(pm_info, &parms); -- status = rpc_portmap_getport(pm_info, &parms); -- if (status == -EHOSTUNREACH) { -+ status = rpc_portmap_getport(pm_info, &parms, &rpc_info->port); -+ if (status == -EHOSTUNREACH || status == -ETIMEDOUT) { - supported = status; - goto done_ver; - } else if (status < 0) - goto done_ver; -- rpc_info->port = status; - } - - if (rpc_info->proto->p_proto == IPPROTO_UDP) -@@ -675,7 +677,9 @@ v2_ver: - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status > 0) { -+ if (status == -ETIMEDOUT) -+ supported = status; -+ else if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -752,7 +756,8 @@ static int get_vers_and_cost(unsigned lo - supported = get_nfs_info(logopt, host, - &pm_info, &rpc_info, "tcp", vers, options); - if (IS_ERR(supported)) { -- if (ERR(supported) == EHOSTUNREACH) -+ if (ERR(supported) == EHOSTUNREACH || -+ ERR(supported) == ETIMEDOUT) - return ret; - } else if (supported) { - ret = 1; -@@ -763,7 +768,10 @@ static int get_vers_and_cost(unsigned lo - if (version & UDP_REQUESTED) { - supported = get_nfs_info(logopt, host, - &pm_info, &rpc_info, "udp", vers, options); -- if (supported) { -+ if (IS_ERR(supported)) { -+ if (ERR(supported) == ETIMEDOUT) -+ return ret; -+ } else if (supported) { - ret = 1; - host->version |= (supported << 8); - } -@@ -862,8 +870,8 @@ static int get_supported_ver_and_cost(un - return 0; - - parms.pm_prot = rpc_info.proto->p_proto; -- rpc_info.port = rpc_portmap_getport(&pm_info, &parms); -- if (rpc_info.port < 0) -+ ret = rpc_portmap_getport(&pm_info, &parms, &rpc_info.port); -+ if (ret < 0) - goto done; - } - diff --git a/autofs-5.0.6-improve-mount-location-error-reporting.patch b/autofs-5.0.6-improve-mount-location-error-reporting.patch deleted file mode 100644 index b0cb27d..0000000 --- a/autofs-5.0.6-improve-mount-location-error-reporting.patch +++ /dev/null @@ -1,117 +0,0 @@ -autofs-5.0.6 - improve mount location error reporting - -From: Ian Kent - -Try and report a more sensible error when an invalid location is -encountered. ---- - - CHANGELOG | 1 + - modules/parse_sun.c | 32 ++++++++++++++++++-------------- - 2 files changed, 19 insertions(+), 14 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index e5dfa83..a178b74 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -1,6 +1,7 @@ - ??/??/20?? autofs-5.0.7 - ======================= - - fix ipv6 name for lookup fix. -+- improve mount location error reporting. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/modules/parse_sun.c b/modules/parse_sun.c -index 3242e3b..021850d 100644 ---- a/modules/parse_sun.c -+++ b/modules/parse_sun.c -@@ -853,7 +853,7 @@ add_offset_entry(struct autofs_point *ap, const char *name, - return ret; - } - --static int validate_location(char *loc) -+static int validate_location(unsigned int logopt, char *loc) - { - char *ptr = loc; - -@@ -867,14 +867,22 @@ static int validate_location(char *loc) - * and "@" in the host name part and ipv6 addresses that - * have ":", "[" and "]". - */ -- if (check_colon(ptr)) { -+ if (!check_colon(ptr)) { -+ error(logopt, -+ "expected colon delimeter not found in location %s", -+ loc); -+ return 0; -+ } else { - while (*ptr && strncmp(ptr, ":/", 2)) { - if (!(isalnum(*ptr) || - *ptr == '-' || *ptr == '.' || *ptr == '_' || - *ptr == ',' || *ptr == '(' || *ptr == ')' || - *ptr == '#' || *ptr == '@' || *ptr == ':' || -- *ptr == '[' || *ptr == ']')) -+ *ptr == '[' || *ptr == ']')) { -+ error(logopt, "invalid character \"%c\" " -+ "found in location %s", *ptr, loc); - return 0; -+ } - ptr++; - } - -@@ -883,8 +891,10 @@ static int validate_location(char *loc) - } - - /* Must always be something following */ -- if (!*ptr) -+ if (!*ptr) { -+ error(logopt, "invalid location %s", loc); - return 0; -+ } - - return 1; - } -@@ -951,8 +961,7 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char * - return 0; - } - -- if (!validate_location(loc)) { -- warn(logopt, MODPREFIX "invalid location %s", loc); -+ if (!validate_location(logopt, loc)) { - free(myoptions); - free(loc); - return 0; -@@ -985,9 +994,7 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char * - return 0; - } - -- if (!validate_location(ent_chunk)) { -- warn(logopt, -- MODPREFIX "invalid location %s", ent_chunk); -+ if (!validate_location(logopt, ent_chunk)) { - free(ent_chunk); - free(myoptions); - free(loc); -@@ -1688,8 +1695,7 @@ int parse_mount(struct autofs_point *ap, const char *name, - return 1; - } - -- if (!validate_location(loc)) { -- warn(ap->logopt, MODPREFIX "invalid location %s", loc); -+ if (!validate_location(ap->logopt, loc)) { - free(loc); - free(options); - return 1; -@@ -1714,9 +1720,7 @@ int parse_mount(struct autofs_point *ap, const char *name, - return 1; - } - -- if (!validate_location(ent)) { -- warn(ap->logopt, -- MODPREFIX "invalid location %s", loc); -+ if (!validate_location(ap->logopt, ent)) { - free(ent); - free(loc); - free(options); diff --git a/autofs-5.0.6-increase-file-map-read-buffer-size.patch b/autofs-5.0.6-increase-file-map-read-buffer-size.patch deleted file mode 100644 index 39b2221..0000000 --- a/autofs-5.0.6-increase-file-map-read-buffer-size.patch +++ /dev/null @@ -1,38 +0,0 @@ -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/autofs-5.0.6-make-autofs-wait-longer-for-shutdown.patch b/autofs-5.0.6-make-autofs-wait-longer-for-shutdown.patch deleted file mode 100644 index 9917f67..0000000 --- a/autofs-5.0.6-make-autofs-wait-longer-for-shutdown.patch +++ /dev/null @@ -1,78 +0,0 @@ -autofs-5.0.6 - make autofs wait longer for shutdown - -From: Ian Kent - -After signaling the automount daemon to shutdown the autofs init script -doesn't wait long enough for the daemon to exit. This can be a problem -if there are a large number of mounts or if servers are slow to respond. ---- - - CHANGELOG | 1 + - redhat/autofs.init.in | 5 ++++- - samples/autofs.service.in | 1 + - samples/rc.autofs.in | 5 ++++- - 4 files changed, 10 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -50,6 +50,7 @@ - - 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 completion. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/redhat/autofs.init.in -+++ autofs-5.0.6/redhat/autofs.init.in -@@ -108,7 +108,7 @@ function stop() { - while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do - killproc $prog -TERM >& /dev/null - RETVAL=$? -- [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3 -+ [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 20 - count=`expr $count + 1` - done - if [ $RETVAL -eq 0 ]; then -@@ -129,6 +129,9 @@ function restart() { - status autofs > /dev/null 2>&1 - if [ $? -eq 0 ]; then - stop -+ while [ -n "`pidof $prog`" ] ; do -+ sleep 5 -+ done - fi - start - } ---- autofs-5.0.6.orig/samples/autofs.service.in -+++ autofs-5.0.6/samples/autofs.service.in -@@ -8,6 +8,7 @@ PIDFile=@@autofspiddir@@/autofs.pid - EnvironmentFile=-@@autofsconfdir@@/autofs - ExecStart=@@sbindir@@/automount ${OPTIONS} --pid-file @@autofspiddir@@/autofs.pid - ExecReload=/usr/bin/kill -HUP $MAINPID -+TimeoutSec=180 - - [Install] - WantedBy=multi-user.target ---- autofs-5.0.6.orig/samples/rc.autofs.in -+++ autofs-5.0.6/samples/rc.autofs.in -@@ -91,7 +91,7 @@ function stop() { - while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do - killall -TERM $prog >& /dev/null - RETVAL=$? -- [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3 -+ [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 20 - count=`expr $count + 1` - done - if [ -z "`pidof $prog`" ] ; then -@@ -104,6 +104,9 @@ function stop() { - - function restart() { - stop -+ while [ -n "`pidof $prog`" ] ; do -+ sleep 5 -+ done - start - } - diff --git a/autofs-5.0.6-move-timeout-to-map_source.patch b/autofs-5.0.6-move-timeout-to-map_source.patch deleted file mode 100644 index 6e181c3..0000000 --- a/autofs-5.0.6-move-timeout-to-map_source.patch +++ /dev/null @@ -1,529 +0,0 @@ -autofs-5.0.6 - move timeout to map_source - -From: Ian Kent - -Move the map entry timeout field from "struct autofs_point" to -"struct map_source". - -The result of this change is that an individual timeout may be -set for each direct map master map entry. ---- - - CHANGELOG | 1 + - daemon/automount.c | 2 +- - daemon/direct.c | 32 +++++++++++++++++++++----------- - daemon/indirect.c | 7 +++---- - daemon/lookup.c | 2 ++ - daemon/state.c | 18 +++++++++++++++++- - include/automount.h | 5 +++-- - include/master.h | 3 ++- - include/mounts.h | 2 +- - lib/master.c | 9 ++++----- - lib/master_parse.y | 32 +++++++++++++------------------- - lib/mounts.c | 37 ++++++++++++++++++------------------- - modules/mount_autofs.c | 5 +++-- - 13 files changed, 89 insertions(+), 66 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -45,6 +45,7 @@ - - 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 (allow per direct map timeout). - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/automount.c -+++ autofs-5.0.6/daemon/automount.c -@@ -1585,7 +1585,7 @@ void *handle_mounts(void *arg) - - /* We often start several automounters at the same time. Add some - randomness so we don't all expire at the same time. */ -- if (!ap->submount && ap->exp_timeout) -+ if (!ap->submount && ap->exp_runfreq) - alarm_add(ap, ap->exp_runfreq + rand() % ap->exp_runfreq); - - pthread_setcancelstate(cancel_state, NULL); ---- autofs-5.0.6.orig/daemon/direct.c -+++ autofs-5.0.6/daemon/direct.c -@@ -286,7 +286,7 @@ static int unlink_active_mounts(struct a - - if (tree_get_mnt_list(mnts, &list, me->key, 1)) { - if (ap->state == ST_READMAP) { -- time_t tout = ap->exp_timeout; -+ time_t tout = me->source->exp_timeout; - int save_ioctlfd, ioctlfd; - - save_ioctlfd = ioctlfd = me->ioctlfd; -@@ -321,18 +321,26 @@ static int unlink_active_mounts(struct a - return 1; - } - --int do_mount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, struct mapent *me) -+int do_mount_autofs_direct(struct autofs_point *ap, -+ struct mnt_list *mnts, struct mapent *me, -+ time_t timeout) - { - const char *str_direct = mount_type_str(t_direct); - struct ioctl_ops *ops = get_ioctl_ops(); - struct mnt_params *mp; -- time_t timeout = ap->exp_timeout; - struct stat st; - int status, ret, ioctlfd; - const char *map_name; -+ time_t runfreq; - -- /* Calculate the timeouts */ -- ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; -+ if (timeout) { -+ /* Calculate the expire run frequency */ -+ runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; -+ if (ap->exp_runfreq) -+ ap->exp_runfreq = min(ap->exp_runfreq, runfreq); -+ else -+ ap->exp_runfreq = runfreq; -+ } - - if (ops->version && !do_force_unlink) { - ap->flags |= MOUNT_FLAG_REMOUNT; -@@ -425,7 +433,7 @@ int do_mount_autofs_direct(struct autofs - } - - ops->timeout(ap->logopt, ioctlfd, timeout); -- notify_mount_result(ap, me->key, str_direct); -+ notify_mount_result(ap, me->key, timeout, str_direct); - cache_set_ino_index(me->mc, me->key, st.st_dev, st.st_ino); - ops->close(ap->logopt, ioctlfd); - -@@ -473,6 +481,7 @@ int mount_autofs_direct(struct autofs_po - pthread_cleanup_push(cache_lock_cleanup, nc); - map = ap->entry->maps; - while (map) { -+ time_t timeout; - /* - * Only consider map sources that have been read since - * the map entry was last updated. -@@ -483,6 +492,7 @@ int mount_autofs_direct(struct autofs_po - } - - mc = map->mc; -+ timeout = map->exp_timeout; - cache_readlock(mc); - pthread_cleanup_push(cache_lock_cleanup, mc); - me = cache_enumerate(mc, NULL); -@@ -491,7 +501,7 @@ int mount_autofs_direct(struct autofs_po - if (ne) { - if (map->master_line < ne->age) { - /* TODO: check return, locking me */ -- do_mount_autofs_direct(ap, mnts, me); -+ do_mount_autofs_direct(ap, mnts, me, timeout); - } - me = cache_enumerate(mc, me); - continue; -@@ -508,7 +518,7 @@ int mount_autofs_direct(struct autofs_po - } - - /* TODO: check return, locking me */ -- do_mount_autofs_direct(ap, mnts, me); -+ do_mount_autofs_direct(ap, mnts, me, timeout); - - me = cache_enumerate(mc, me); - } -@@ -639,7 +649,7 @@ int mount_autofs_offset(struct autofs_po - struct ioctl_ops *ops = get_ioctl_ops(); - char buf[MAX_ERR_BUF]; - struct mnt_params *mp; -- time_t timeout = ap->exp_timeout; -+ time_t timeout = me->source->exp_timeout; - struct stat st; - int ioctlfd, status, ret; - const char *hosts_map_name = "-hosts"; -@@ -774,9 +784,9 @@ int mount_autofs_offset(struct autofs_po - ops->timeout(ap->logopt, ioctlfd, timeout); - cache_set_ino_index(me->mc, me->key, st.st_dev, st.st_ino); - if (ap->logopt & LOGOPT_DEBUG) -- notify_mount_result(ap, mountpoint, str_offset); -+ notify_mount_result(ap, mountpoint, timeout, str_offset); - else -- notify_mount_result(ap, me->key, str_offset); -+ notify_mount_result(ap, me->key, timeout, str_offset); - ops->close(ap->logopt, ioctlfd); - - debug(ap->logopt, "mounted trigger %s at %s", me->key, mountpoint); ---- autofs-5.0.6.orig/daemon/indirect.c -+++ autofs-5.0.6/daemon/indirect.c -@@ -87,7 +87,7 @@ static int do_mount_autofs_indirect(stru - { - const char *str_indirect = mount_type_str(t_indirect); - struct ioctl_ops *ops = get_ioctl_ops(); -- time_t timeout = ap->exp_timeout; -+ time_t timeout = ap->entry->maps->exp_timeout; - char *options = NULL; - const char *hosts_map_name = "-hosts"; - const char *map_name = hosts_map_name; -@@ -170,13 +170,12 @@ static int do_mount_autofs_indirect(stru - } - - ap->dev = st.st_dev; /* Device number for mount point checks */ -- ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; - - ops->timeout(ap->logopt, ap->ioctlfd, timeout); - if (ap->logopt & LOGOPT_DEBUG) -- notify_mount_result(ap, root, str_indirect); -+ notify_mount_result(ap, root, timeout, str_indirect); - else -- notify_mount_result(ap, ap->path, str_indirect); -+ notify_mount_result(ap, ap->path, timeout, str_indirect); - - return 0; - ---- autofs-5.0.6.orig/daemon/lookup.c -+++ autofs-5.0.6/daemon/lookup.c -@@ -413,6 +413,7 @@ static enum nsswitch_status read_map_sou - tmap.lookup = map->lookup; - tmap.mc = map->mc; - tmap.instance = map->instance; -+ tmap.exp_timeout = map->exp_timeout; - tmap.recurse = map->recurse; - tmap.depth = map->depth; - tmap.stale = map->stale; -@@ -770,6 +771,7 @@ static enum nsswitch_status lookup_map_n - tmap.format = map->format; - tmap.mc = map->mc; - tmap.instance = map->instance; -+ tmap.exp_timeout = map->exp_timeout; - tmap.recurse = map->recurse; - tmap.depth = map->depth; - tmap.argc = 0; ---- autofs-5.0.6.orig/daemon/state.c -+++ autofs-5.0.6/daemon/state.c -@@ -400,6 +400,9 @@ static void do_readmap_mount(struct auto - } - if (valid) { - struct mapent_cache *vmc = valid->mc; -+ struct ioctl_ops *ops = get_ioctl_ops(); -+ time_t runfreq; -+ - cache_unlock(vmc); - debug(ap->logopt, - "updating cache entry for valid direct trigger %s", -@@ -412,13 +415,22 @@ static void do_readmap_mount(struct auto - /* Set device and inode number of the new mapent */ - cache_set_ino_index(vmc, me->key, me->dev, me->ino); - cache_unlock(vmc); -+ /* Set timeout and calculate the expire run frequency */ -+ ops->timeout(ap->logopt, valid->ioctlfd, map->exp_timeout); -+ if (map->exp_timeout) { -+ runfreq = (map->exp_timeout + CHECK_RATIO - 1) / CHECK_RATIO; -+ if (ap->exp_runfreq) -+ ap->exp_runfreq = min(ap->exp_runfreq, runfreq); -+ else -+ ap->exp_runfreq = runfreq; -+ } - } else if (!tree_is_mounted(mnts, me->key, MNTS_REAL)) - do_umount_autofs_direct(ap, mnts, me); - else - debug(ap->logopt, - "%s is mounted", me->key); - } else -- do_mount_autofs_direct(ap, mnts, me); -+ do_mount_autofs_direct(ap, mnts, me, map->exp_timeout); - - return; - } -@@ -466,6 +478,10 @@ static void *do_readmap(void *arg) - pthread_cleanup_pop(1); - - if (ap->type == LKP_INDIRECT) { -+ struct ioctl_ops *ops = get_ioctl_ops(); -+ time_t timeout = ap->entry->maps->exp_timeout; -+ ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; -+ ops->timeout(ap->logopt, ap->ioctlfd, timeout); - lookup_prune_cache(ap, now); - status = lookup_ghost(ap, ap->path); - } else { ---- autofs-5.0.6.orig/include/automount.h -+++ autofs-5.0.6/include/automount.h -@@ -114,6 +114,8 @@ int load_autofs4_module(void); - #define DB(x) do { } while(0) - #endif - -+#define min(a, b) (a <= b ? a : b) -+ - /* Forward declaraion */ - struct autofs_point; - -@@ -461,7 +463,6 @@ struct autofs_point { - dev_t dev; /* "Device" number assigned by kernel */ - struct master_mapent *entry; /* Master map entry for this mount */ - unsigned int type; /* Type of map direct or indirect */ -- time_t exp_timeout; /* Timeout for expiring mounts */ - time_t exp_runfreq; /* Frequency for polling for timeouts */ - time_t negative_timeout; /* timeout in secs for failed mounts */ - unsigned int flags; /* autofs mount flags */ -@@ -495,7 +496,7 @@ void *expire_proc_indirect(void *); - void *expire_proc_direct(void *); - int expire_offsets_direct(struct autofs_point *ap, struct mapent *me, int now); - int mount_autofs_indirect(struct autofs_point *ap, const char *root); --int do_mount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, struct mapent *me); -+int do_mount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, struct mapent *me, time_t timeout); - int mount_autofs_direct(struct autofs_point *ap); - int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, const char *root, const char *offset); - void submount_signal_parent(struct autofs_point *ap, unsigned int success); ---- autofs-5.0.6.orig/include/master.h -+++ autofs-5.0.6/include/master.h -@@ -23,6 +23,7 @@ - struct map_source { - char *type; - char *format; -+ time_t exp_timeout; /* Timeout for expiring mounts */ - time_t age; - unsigned int master_line; - struct mapent_cache *mc; -@@ -78,7 +79,7 @@ void master_mutex_unlock(void); - void master_mutex_lock_cleanup(void *); - void master_set_default_timeout(void); - void master_set_default_ghost_mode(void); --int master_add_autofs_point(struct master_mapent *, time_t, unsigned, unsigned, unsigned, int); -+int master_add_autofs_point(struct master_mapent *, unsigned, unsigned, unsigned, int); - void master_free_autofs_point(struct autofs_point *); - struct map_source * - master_add_map_source(struct master_mapent *, char *, char *, time_t, int, const char **); ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -120,7 +120,7 @@ int tree_find_mnt_ents(struct mnt_list * - int tree_is_mounted(struct mnt_list *mnts, const char *path, unsigned int type); - void set_tsd_user_vars(unsigned int, uid_t, gid_t); - const char *mount_type_str(unsigned int); --void notify_mount_result(struct autofs_point *, const char *, const char *); -+void notify_mount_result(struct autofs_point *, const char *, time_t, const char *); - int try_remount(struct autofs_point *, struct mapent *, unsigned int); - int umount_ent(struct autofs_point *, const char *); - int mount_multi_triggers(struct autofs_point *, struct mapent *, const char *, unsigned int, const char *); ---- autofs-5.0.6.orig/lib/master.c -+++ autofs-5.0.6/lib/master.c -@@ -65,9 +65,8 @@ void master_mutex_lock_cleanup(void *arg - return; - } - --int master_add_autofs_point(struct master_mapent *entry, time_t timeout, -- unsigned logopt, unsigned nobind, unsigned ghost, -- int submount) -+int master_add_autofs_point(struct master_mapent *entry, unsigned logopt, -+ unsigned nobind, unsigned ghost, int submount) - { - struct autofs_point *ap; - int status; -@@ -91,7 +90,6 @@ int master_add_autofs_point(struct maste - ap->entry = entry; - ap->exp_thread = 0; - ap->readmap_thread = 0; -- ap->exp_timeout = timeout; - /* - * Program command line option overrides config. - * We can't use 0 negative timeout so use default. -@@ -100,7 +98,7 @@ int master_add_autofs_point(struct maste - ap->negative_timeout = defaults_get_negative_timeout(); - else - ap->negative_timeout = global_negative_timeout; -- ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; -+ ap->exp_runfreq = 0; - ap->flags = 0; - if (ghost) - ap->flags = MOUNT_FLAG_GHOST; -@@ -437,6 +435,7 @@ master_add_source_instance(struct map_so - new->age = age; - new->master_line = 0; - new->mc = source->mc; -+ new->exp_timeout = source->exp_timeout; - new->stale = 1; - - tmpargv = copy_argv(argc, argv); ---- autofs-5.0.6.orig/lib/master_parse.y -+++ autofs-5.0.6/lib/master_parse.y -@@ -765,9 +765,6 @@ int master_parse_entry(const char *buffe - logopt |= (verbose ? LOGOPT_VERBOSE : 0); - } - -- if (timeout < 0) -- timeout = default_timeout; -- - new = NULL; - entry = master_find_mapent(master, path); - if (!entry) { -@@ -789,8 +786,19 @@ int master_parse_entry(const char *buffe - } - } - -+ if (timeout < 0) { -+ /* -+ * If no timeout is given get the timout from first -+ * map (if it exists). -+ */ -+ if (entry->maps) -+ timeout = entry->maps->exp_timeout; -+ else -+ timeout = default_timeout; -+ } -+ - if (!entry->ap) { -- ret = master_add_autofs_point(entry, timeout, logopt, nobind, ghost, 0); -+ ret = master_add_autofs_point(entry, logopt, nobind, ghost, 0); - if (!ret) { - error(m_logopt, "failed to add autofs_point"); - if (new) -@@ -798,20 +806,6 @@ int master_parse_entry(const char *buffe - local_free_vars(); - return 0; - } -- } else { -- struct ioctl_ops *ops = get_ioctl_ops(); -- struct autofs_point *ap = entry->ap; -- -- /* -- * Second and subsequent instances of a mount point -- * use the ghost, log and timeout of the first -- */ -- if (entry->age < age) { -- ap->exp_timeout = timeout; -- ap->exp_runfreq = (ap->exp_timeout + CHECK_RATIO - 1) / CHECK_RATIO; -- if (ap->ioctlfd != -1 && ap->type == LKP_INDIRECT) -- ops->timeout(ap->logopt, ap->ioctlfd, timeout); -- } - } - if (random_selection) - entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT; -@@ -838,7 +832,7 @@ int master_parse_entry(const char *buffe - local_free_vars(); - return 0; - } -- -+ source->exp_timeout = timeout; - source->master_line = lineno; - - entry->age = age; ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1268,13 +1268,12 @@ const char *mount_type_str(const unsigne - } - - void notify_mount_result(struct autofs_point *ap, -- const char *path, const char *type) -+ const char *path, time_t timeout, const char *type) - { -- if (ap->exp_timeout) -+ if (timeout) - info(ap->logopt, - "mounted %s on %s with timeout %u, freq %u seconds", -- type, path, -- (unsigned int) ap->exp_timeout, -+ type, path, (unsigned int) timeout, - (unsigned int) ap->exp_runfreq); - else - info(ap->logopt, -@@ -1382,16 +1381,14 @@ static int do_remount_indirect(struct au - } - - static int remount_active_mount(struct autofs_point *ap, -- struct mapent_cache *mc, -- const char *path, dev_t devid, -- const unsigned int type, -- int *ioctlfd) -+ struct mapent *me, const char *path, dev_t devid, -+ const unsigned int type, int *ioctlfd) - { - struct ioctl_ops *ops = get_ioctl_ops(); -- time_t timeout = ap->exp_timeout; - const char *str_type = mount_type_str(type); - char buf[MAX_ERR_BUF]; - unsigned int mounted; -+ time_t timeout; - struct stat st; - int fd; - -@@ -1401,6 +1398,12 @@ static int remount_active_mount(struct a - ops->open(ap->logopt, &fd, devid, path); - if (fd == -1) - return REMOUNT_OPEN_FAIL; -+ else { -+ if (type == t_indirect || type == t_offset) -+ timeout = ap->entry->maps->exp_timeout; -+ else -+ timeout = me->source->exp_timeout; -+ } - - /* Re-reading the map, set timeout and return */ - if (ap->state == ST_READMAP) { -@@ -1434,11 +1437,11 @@ static int remount_active_mount(struct a - ops->close(ap->logopt, fd); - return REMOUNT_STAT_FAIL; - } -- if (mc) -- cache_set_ino_index(mc, path, st.st_dev, st.st_ino); -+ if (type != t_indirect) -+ cache_set_ino_index(me->mc, path, st.st_dev, st.st_ino); - else - ap->dev = st.st_dev; -- notify_mount_result(ap, path, str_type); -+ notify_mount_result(ap, path, timeout, str_type); - - *ioctlfd = fd; - -@@ -1481,24 +1484,20 @@ static int remount_active_mount(struct a - int try_remount(struct autofs_point *ap, struct mapent *me, unsigned int type) - { - struct ioctl_ops *ops = get_ioctl_ops(); -- struct mapent_cache *mc; - const char *path; - int ret, fd; - dev_t devid; - -- if (type == t_indirect) { -- mc = NULL; -+ if (type == t_indirect) - path = ap->path; -- } else { -- mc = me->mc; -+ else - path = me->key; -- } - - ret = ops->mount_device(ap->logopt, path, type, &devid); - if (ret == -1 || ret == 0) - return -1; - -- ret = remount_active_mount(ap, mc, path, devid, type, &fd); -+ ret = remount_active_mount(ap, me, path, devid, type, &fd); - - /* - * The directory must exist since we found a device ---- autofs-5.0.6.orig/modules/mount_autofs.c -+++ autofs-5.0.6/modules/mount_autofs.c -@@ -51,7 +51,7 @@ int mount_mount(struct autofs_point *ap, - int argc, status; - int nobind = ap->flags & MOUNT_FLAG_NOBIND; - int ghost = ap->flags & MOUNT_FLAG_GHOST; -- time_t timeout = ap->exp_timeout; -+ time_t timeout = ap->entry->maps->exp_timeout; - unsigned logopt = ap->logopt; - struct map_type_info *info; - struct master *master; -@@ -149,7 +149,7 @@ int mount_mount(struct autofs_point *ap, - return 1; - } - -- ret = master_add_autofs_point(entry, timeout, logopt, nobind, ghost, 1); -+ ret = master_add_autofs_point(entry, logopt, nobind, ghost, 1); - if (!ret) { - error(ap->logopt, - MODPREFIX "failed to add autofs_point to entry"); -@@ -203,6 +203,7 @@ int mount_mount(struct autofs_point *ap, - return 1; - } - free_map_type_info(info); -+ source->exp_timeout = timeout; - - mounts_mutex_lock(ap); - diff --git a/autofs-5.0.6-refactor-lookup-hosts-module.patch b/autofs-5.0.6-refactor-lookup-hosts-module.patch deleted file mode 100644 index ecc18be..0000000 --- a/autofs-5.0.6-refactor-lookup-hosts-module.patch +++ /dev/null @@ -1,248 +0,0 @@ -autofs-5.0.6 - refactor hosts lookup module - -From: Ian Kent - -Simplify lookup hosts lookup_mount() function. ---- - - modules/lookup_hosts.c | 206 ++++++++++++++++++++++++------------------------- - 1 file changed, 101 insertions(+), 105 deletions(-) - - ---- autofs-5.0.6.orig/modules/lookup_hosts.c -+++ autofs-5.0.6/modules/lookup_hosts.c -@@ -78,6 +78,94 @@ int lookup_read_master(struct master *ma - return NSS_STATUS_UNKNOWN; - } - -+static char *get_exports(struct autofs_point *ap, const char *host) -+{ -+ char *mapent = NULL; -+ exports exp; -+ -+ debug(ap->logopt, MODPREFIX "fetchng export list for %s", name); -+ -+ exp = rpc_get_exports(host, 10, 0, RPC_CLOSE_NOLINGER); -+ -+ mapent = NULL; -+ while (exp) { -+ if (mapent) { -+ int len = strlen(mapent) + 1; -+ -+ len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3; -+ mapent = realloc(mapent, len); -+ if (!mapent) { -+ char *estr; -+ estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ error(ap->logopt, MODPREFIX "malloc: %s", estr); -+ rpc_exports_free(exp); -+ return NSS_STATUS_UNAVAIL; -+ } -+ strcat(mapent, " \""); -+ strcat(mapent, exp->ex_dir); -+ strcat(mapent, "\""); -+ } else { -+ int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3; -+ -+ mapent = malloc(len); -+ if (!mapent) { -+ char *estr; -+ estr = strerror_r(errno, buf, MAX_ERR_BUF); -+ error(ap->logopt, MODPREFIX "malloc: %s", estr); -+ rpc_exports_free(exp); -+ return NSS_STATUS_UNAVAIL; -+ } -+ strcpy(mapent, "\""); -+ strcat(mapent, exp->ex_dir); -+ strcat(mapent, "\""); -+ } -+ strcat(mapent, " \""); -+ strcat(mapent, name); -+ strcat(mapent, ":"); -+ strcat(mapent, exp->ex_dir); -+ strcat(mapent, "\""); -+ -+ exp = exp->ex_next; -+ } -+ rpc_exports_free(exp); -+ -+ if (!mapent) -+ error(ap->logopt, "exports lookup failed for %s", name); -+ -+ return mapent; -+} -+ -+static int do_parse_mount(struct autofs_point *ap, -+ const char *name, int name_len, char *mapent, -+ void *context) -+{ -+ int ret; -+ -+ master_source_current_wait(ap->entry); -+ ap->entry->current = source; -+ -+ ret = ctxt->parse->parse_mount(ap, name, name_len, -+ mapent, ctxt->parse->context); -+ if (ret) { -+ time_t now = time(NULL); -+ struct mapent_cache *mc = source->mc; -+ struct mapent *me; -+ int rv = CHE_OK; -+ -+ cache_writelock(mc); -+ me = cache_lookup_distinct(mc, name); -+ if (!me) -+ rv = cache_update(mc, source, name, NULL, now); -+ if (rv != CHE_FAIL) { -+ me = cache_lookup_distinct(mc, name); -+ me->status = now + ap->negative_timeout; -+ } -+ cache_unlock(mc); -+ return NSS_STATUS_TRYAGAIN; -+ } -+ return NSS_STATUS_SUCCESS; -+} -+ - int lookup_read_map(struct autofs_point *ap, time_t age, void *context) - { - struct map_source *source; -@@ -209,126 +297,34 @@ int lookup_mount(struct autofs_point *ap - if (*name == '/') { - pthread_cleanup_push(cache_lock_cleanup, mc); - mapent_len = strlen(me->mapent); -- mapent = alloca(mapent_len + 1); -+ mapent = malloc(mapent_len + 1); - if (mapent) - strcpy(mapent, me->mapent); - pthread_cleanup_pop(0); - } - cache_unlock(mc); - -- if (mapent) { -- master_source_current_wait(ap->entry); -- ap->entry->current = source; -- -- debug(ap->logopt, MODPREFIX "%s -> %s", name, me->mapent); -- -- ret = ctxt->parse->parse_mount(ap, name, name_len, -- mapent, ctxt->parse->context); -- -- if (ret) { -- time_t now = time(NULL); -- int rv = CHE_OK; -- -- cache_writelock(mc); -- me = cache_lookup_distinct(mc, name); -- if (!me) -- rv = cache_update(mc, source, name, NULL, now); -- if (rv != CHE_FAIL) { -- me = cache_lookup_distinct(mc, name); -- me->status = now + ap->negative_timeout; -- } -- cache_unlock(mc); -- return NSS_STATUS_TRYAGAIN; -- } -- return NSS_STATUS_SUCCESS; -- } - done: -- /* -- * Otherwise we need to get the exports list and add update -- * the cache. -- */ -- debug(ap->logopt, MODPREFIX "fetchng export list for %s", name); -- -- exp = rpc_get_exports(name, 10, 0, RPC_CLOSE_NOLINGER); -- -- mapent = NULL; -- while (exp) { -- if (mapent) { -- int len = strlen(mapent) + 1; -- -- len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3; -- mapent = realloc(mapent, len); -- if (!mapent) { -- char *estr; -- estr = strerror_r(errno, buf, MAX_ERR_BUF); -- logerr(MODPREFIX "malloc: %s", estr); -- rpc_exports_free(exp); -- return NSS_STATUS_UNAVAIL; -- } -- strcat(mapent, " \""); -- strcat(mapent, exp->ex_dir); -- strcat(mapent, "\""); -- } else { -- int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3; -- -- mapent = malloc(len); -- if (!mapent) { -- char *estr; -- estr = strerror_r(errno, buf, MAX_ERR_BUF); -- logerr(MODPREFIX "malloc: %s", estr); -- rpc_exports_free(exp); -- return NSS_STATUS_UNAVAIL; -- } -- strcpy(mapent, "\""); -- strcat(mapent, exp->ex_dir); -- strcat(mapent, "\""); -- } -- strcat(mapent, " \""); -- strcat(mapent, name); -- strcat(mapent, ":"); -- strcat(mapent, exp->ex_dir); -- strcat(mapent, "\""); -- -- exp = exp->ex_next; -- } -- rpc_exports_free(exp); -- -- /* Exports lookup failed so we're outa here */ -- if (!mapent) { -- error(ap->logopt, "exports lookup failed for %s", name); -- return NSS_STATUS_UNAVAIL; -- } -- - debug(ap->logopt, MODPREFIX "%s -> %s", name, mapent); - -- cache_writelock(mc); -- cache_update(mc, source, name, mapent, now); -- cache_unlock(mc); -- -- master_source_current_wait(ap->entry); -- ap->entry->current = source; -- -- ret = ctxt->parse->parse_mount(ap, name, name_len, -- mapent, ctxt->parse->context); -- free(mapent); -+ if (!mapent) { -+ /* We need to get the exports list and update the cache. */ -+ mapent = get_exports(ap, name); - -- if (ret) { -- time_t now = time(NULL); -- int rv = CHE_OK; -+ /* Exports lookup failed so we're outa here */ -+ if (!mapent) -+ return NSS_STATUS_UNAVAIL; - - cache_writelock(mc); -- me = cache_lookup_distinct(mc, name); -- if (!me) -- rv = cache_update(mc, source, name, NULL, now); -- if (rv != CHE_FAIL) { -- me = cache_lookup_distinct(mc, name); -- me->status = now + ap->negative_timeout; -- } -+ cache_update(mc, source, name, mapent, now); - cache_unlock(mc); -- return NSS_STATUS_TRYAGAIN; - } - -- return NSS_STATUS_SUCCESS; -+ ret = do_parse_mount(ap, name, name_len, mapent, ctxt->parse->context); -+ -+ free(mapent); -+ -+ return ret; - } - - int lookup_done(void *context) diff --git a/autofs-5.0.6-reinstate-singleton-mount-probe.patch b/autofs-5.0.6-reinstate-singleton-mount-probe.patch deleted file mode 100644 index 4e9a078..0000000 --- a/autofs-5.0.6-reinstate-singleton-mount-probe.patch +++ /dev/null @@ -1,105 +0,0 @@ -autofs-5.0.6 - reinstate singleton mount probe - -From: Ian Kent - -The change to have the kernel process text based mount options can -introduce lengthy timeout waits when attempting a mount to a host -that is not available. - -To avoid these waits autofs should probe singleton mounts if it -thinks mount.nfs will pass text options to the kernel (which of -course implies the kernel supports this). ---- - - CHANGELOG | 1 + - daemon/automount.c | 7 +++++++ - include/mounts.h | 1 + - modules/replicated.c | 18 ++++++++++++++++-- - 4 files changed, 25 insertions(+), 2 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -26,6 +26,7 @@ - - ignore duplicate exports in auto.net. - - add kernel verion check function. - - add function to check mount.nfs version. -+- reinstate singleton mount probe. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/automount.c -+++ autofs-5.0.6/daemon/automount.c -@@ -51,6 +51,9 @@ const char *libdir = AUTOFS_LIB_DIR; /* - const char *mapdir = AUTOFS_MAP_DIR; /* Location of mount maps */ - const char *confdir = AUTOFS_CONF_DIR; /* Location of autofs config file */ - -+unsigned int nfs_mount_uses_string_options = 0; -+static struct nfs_mount_vers vers, check = {1, 1, 1}; -+ - /* autofs fifo name prefix */ - const char *fifodir = AUTOFS_FIFO_DIR "/autofs.fifo"; - -@@ -1273,6 +1276,8 @@ static int do_hup_signal(struct master * - if (status) - fatal(status); - -+ nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check); -+ - master_mutex_lock(); - if (master->reading) { - status = pthread_mutex_unlock(&mrc.mutex); -@@ -1936,6 +1941,8 @@ int main(int argc, char *argv[]) - - defaults_read_config(0); - -+ nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check); -+ - kpkt_len = get_kpkt_len(); - timeout = defaults_get_timeout(); - ghost = defaults_get_browse_mode(); ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -95,6 +95,7 @@ struct nfs_mount_vers { - unsigned int fix; - }; - int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *); -+extern unsigned int nfs_mount_uses_string_options; - - unsigned int query_kproto_ver(void); - unsigned int get_kver_major(void); ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -901,6 +901,7 @@ int prune_host_list(unsigned logopt, str - unsigned int v2_udp_count, v3_udp_count, v4_udp_count; - unsigned int max_udp_count, max_tcp_count, max_count; - int status; -+ int kern_vers; - - if (!*list) - return 0; -@@ -920,9 +921,22 @@ int prune_host_list(unsigned logopt, str - * or a single host entry whose proximity isn't local. If so - * return immediately as we don't want to add probe latency for - * the common case of a single filesystem mount request. -+ * -+ * But, if the kernel understands text nfs mount options then -+ * mount.nfs most likely bypasses its probing and lets the kernel -+ * do all the work. This can lead to long timeouts for hosts that -+ * are not available so check the kernel version and mount.nfs -+ * version and probe singleton mounts if the kernel version is -+ * greater than 2.6.22 and mount.nfs version is greater than 1.1.1. - */ -- if (!this || !this->next) -- return 1; -+ if (nfs_mount_uses_string_options && -+ (kern_vers = linux_version_code()) > KERNEL_VERSION(2, 6, 22)) { -+ if (!this) -+ return 1; -+ } else { -+ if (!this || !this->next) -+ return 1; -+ } - - proximity = this->proximity; - while (this) { diff --git a/autofs-5.0.6-remove-cache-update-from-parse_mount.patch b/autofs-5.0.6-remove-cache-update-from-parse_mount.patch deleted file mode 100644 index 3024b84..0000000 --- a/autofs-5.0.6-remove-cache-update-from-parse_mount.patch +++ /dev/null @@ -1,47 +0,0 @@ -autofs-5.0.6 - remove cache update from parse_mount() - -From: Ian Kent - -I'm not sure why I added this update in the parse sun module. - -The lookup modules have the job of updating the map entry cache and -I can't see why an entry would be missing since the parse function -is called following the entry lookup (which does the update). ---- - - modules/parse_sun.c | 23 ----------------------- - 1 file changed, 23 deletions(-) - - ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -1383,29 +1383,6 @@ int parse_mount(struct autofs_point *ap, - strcat(m_root, name); - } - -- /* -- * Can't take the write lock for direct mount entries here -- * but they should always be present in the map entry cache. -- */ -- if (ap->type == LKP_INDIRECT) { -- cache_writelock(mc); -- me = cache_lookup_distinct(mc, name); -- if (!me) { -- int ret; -- /* -- * Not in the cache, perhaps it's a program map -- * or one that doesn't support enumeration. -- */ -- ret = cache_add(mc, source, name, mapent, age); -- if (ret == CHE_FAIL) { -- cache_unlock(mc); -- free(options); -- return 1; -- } -- } -- cache_unlock(mc); -- } -- - cache_readlock(mc); - me = cache_lookup_distinct(mc, name); - if (me) { diff --git a/autofs-5.0.6-remove-empty-command-line-arguments.patch b/autofs-5.0.6-remove-empty-command-line-arguments.patch deleted file mode 100644 index 32ce534..0000000 --- a/autofs-5.0.6-remove-empty-command-line-arguments.patch +++ /dev/null @@ -1,113 +0,0 @@ -autofs-5.0.6 - remove empty command line arguments - -From: Ian Kent - -When invoking the automount daemon from a systemd unit file a macro -that evaluates to the empty string is passed as an empty argument -unlike the shell environment within which unquoted arguments are -seen as white space and are not passed at all. - -These empty arguments confuse getopt(3) and cause the program -parameters to be misread so we need to remove them before calling -getopt(3). ---- - - CHANGELOG | 1 + - daemon/automount.c | 39 +++++++++++++++++++++++++++++++++++---- - 2 files changed, 36 insertions(+), 4 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -18,6 +18,7 @@ - - fix ipv6 configure check. - - add piddir to configure. - - add systemd unit support. -+- remove empty command line arguments (passed by systemd). - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/automount.c -+++ autofs-5.0.6/daemon/automount.c -@@ -1865,6 +1865,34 @@ static int convert_log_priority(char *pr - return -1; - } - -+static void remove_empty_args(char **argv, int *argc) -+{ -+ int next_to_last = *argc - 1; -+ int i, j; -+ -+ for (i = j = 1; i < *argc; i++) { -+ if (*argv[i]) { -+ j++; -+ continue; -+ } -+ -+ while (i < *argc && argv[i] && !*argv[i]) i++; -+ -+ if (i == *argc) -+ break; -+ -+ if (i == next_to_last) { -+ if (*argv[i]) -+ argv[j++] = argv[i]; -+ break; -+ } else { -+ argv[j++] = argv[i]; -+ argv[i--] = ""; -+ } -+ } -+ *argc = j; -+} -+ - int main(int argc, char *argv[]) - { - int res, opt, status; -@@ -1874,6 +1902,7 @@ int main(int argc, char *argv[]) - time_t timeout; - time_t age = time(NULL); - struct rlimit rlim; -+ const char *options = "+hp:t:vmdD:fVrO:l:n:CF"; - static const struct option long_options[] = { - {"help", 0, 0, 'h'}, - {"pid-file", 1, 0, 'p'}, -@@ -1918,8 +1947,10 @@ int main(int argc, char *argv[]) - dumpmaps = 0; - daemon_check = 1; - -+ remove_empty_args(argv, &argc); -+ - opterr = 0; -- while ((opt = getopt_long(argc, argv, "+hp:t:vmdD:fVrO:l:n:CF", long_options, NULL)) != EOF) { -+ while ((opt = getopt_long(argc, argv, options, long_options, NULL)) != EOF) { - switch (opt) { - case 'h': - usage(); -@@ -2066,7 +2097,7 @@ int main(int argc, char *argv[]) - res = setrlimit(RLIMIT_NOFILE, &rlim); - if (res) - printf("%s: can't increase open file limit - continuing", -- argv[0]); -+ program); - - #if ENABLE_CORES - rlim.rlim_cur = RLIM_INFINITY; -@@ -2074,7 +2105,7 @@ int main(int argc, char *argv[]) - res = setrlimit(RLIMIT_CORE, &rlim); - if (res) - printf("%s: can't increase core file limit - continuing", -- argv[0]); -+ program); - #endif - - if (argc == 0) -@@ -2097,7 +2128,7 @@ int main(int argc, char *argv[]) - nc = cache_init_null_cache(master_list); - if (!nc) { - printf("%s: failed to init null map cache for %s", -- master_list->name, argv[0]); -+ program, master_list->name); - exit(1); - } - master_list->nc = nc; diff --git a/autofs-5.0.6-remove-move-mount-code-and-configure-option.patch b/autofs-5.0.6-remove-move-mount-code-and-configure-option.patch deleted file mode 100644 index 16113b2..0000000 --- a/autofs-5.0.6-remove-move-mount-code-and-configure-option.patch +++ /dev/null @@ -1,421 +0,0 @@ -autofs-5.0.6 - remove move mount code and configure option - -From: Ian Kent - -The code to construct a multi-mount tree in a temporary location and then -move it into place is obsolete when using a kernel which includes the -vfs-automount infrastructure. - -It is incompatible with systemd and cannot be used if systemd is being used. - -So it's being removed. ---- - - autofs.spec | 2 - configure | 18 ---- - configure.in | 10 -- - daemon/automount.c | 5 - - include/config.h.in | 3 - modules/parse_sun.c | 195 +--------------------------------------------------- - 6 files changed, 7 insertions(+), 226 deletions(-) - - ---- autofs-5.0.6.orig/autofs.spec -+++ autofs-5.0.6/autofs.spec -@@ -74,7 +74,7 @@ echo %{version}-%{release} > .version - %endif - - %build --CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move %{?systemd_configure_arg:} -+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:} - CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 - - %install ---- autofs-5.0.6.orig/configure -+++ autofs-5.0.6/configure -@@ -719,7 +719,6 @@ with_openldap - with_sasl - enable_ext_env - enable_mount_locking --enable_mount_move - enable_forced_shutdown - enable_ignore_busy - ' -@@ -1343,7 +1342,6 @@ Optional Features: - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-ext-env disable search in environment for substitution variable - --disable-mount-locking disable use of locking when spawning mount command -- --disable-mount-move disable use of mount move when when preparing tree of mounts - --enable-force-shutdown enable USR1 signal to force unlink umount of any - busy mounts during shutdown - --enable-ignore-busy enable exit without umounting busy mounts during -@@ -5447,22 +5445,6 @@ $as_echo "#define ENABLE_MOUNT_LOCKING 1 - - fi - --# --# Disable use of mount move --# --# Check whether --enable-mount-move was given. --if test "${enable_mount_move+set}" = set; then : -- enableval=$enable_mount_move; --else -- enableval=yes --fi -- --if test x$enable_mount_move = xyes -o x$enableval = xyes; then -- --$as_echo "#define ENABLE_MOUNT_MOVE 1" >>confdefs.h -- --fi -- - # - # Enable forced shutdown on USR1 signal (unlink umounts all mounts). - # ---- autofs-5.0.6.orig/configure.in -+++ autofs-5.0.6/configure.in -@@ -338,16 +338,6 @@ if test x$enable_mount_locking = xyes -o - fi - - # --# Disable use of mount move --# --AC_ARG_ENABLE(mount-move, --[ --disable-mount-move disable use of mount move when when preparing tree of mounts],, -- enableval=yes) --if test x$enable_mount_move = xyes -o x$enableval = xyes; then -- AC_DEFINE(ENABLE_MOUNT_MOVE, 1, [Disable use of mount move when preparing tree of mounts]) --fi -- --# - # Enable forced shutdown on USR1 signal (unlink umounts all mounts). - # - AC_ARG_ENABLE(forced-shutdown, ---- autofs-5.0.6.orig/daemon/automount.c -+++ autofs-5.0.6/daemon/automount.c -@@ -1748,11 +1748,6 @@ static void show_build_info(void) - count = 22; - #endif - --#ifndef ENABLE_MOUNT_MOVE -- printf("DISABLE_MOUNT_MOVE "); -- count = count + 19; --#endif -- - #ifdef ENABLE_FORCED_SHUTDOWN - printf("ENABLE_FORCED_SHUTDOWN "); - count = count + 23; ---- autofs-5.0.6.orig/include/config.h.in -+++ autofs-5.0.6/include/config.h.in -@@ -12,9 +12,6 @@ - /* Disable use of locking when spawning mount command */ - #undef ENABLE_MOUNT_LOCKING - --/* Disable use of mount move when preparing tree of mounts */ --#undef ENABLE_MOUNT_MOVE -- - /* define if you have E2FSCK */ - #undef HAVE_E2FSCK - ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -37,10 +37,6 @@ - - #define MODPREFIX "parse(sun): " - --#define MOUNT_MOVE_NONE 0x00 --#define MOUNT_MOVE_AUTOFS 0x01 --#define MOUNT_MOVE_OTHER 0x02 -- - int parse_version = AUTOFS_PARSE_VERSION; /* Required by protocol */ - - static struct mount_mod *mount_nfs = NULL; -@@ -1047,86 +1043,6 @@ static int parse_mapent(const char *ent, - return (p - ent); - } - --#ifdef ENABLE_MOUNT_MOVE --static int move_mount(struct autofs_point *ap, -- const char *mm_tmp_root, const char *mm_root, -- unsigned int move) --{ -- char buf[MAX_ERR_BUF]; -- int err; -- -- if (move == MOUNT_MOVE_NONE) -- return 1; -- -- err = mkdir_path(mm_root, 0555); -- if (err < 0 && errno != EEXIST) { -- error(ap->logopt, -- "failed to create move target mount point %s", mm_root); -- return 0; -- } -- -- if (move == MOUNT_MOVE_AUTOFS) -- err = mount(mm_tmp_root, mm_root, NULL, MS_MOVE, NULL); -- else -- err = spawn_mount(ap->logopt, -- "--move", mm_tmp_root, mm_root, NULL); -- if (err) { -- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); -- error(ap->logopt, -- "failed to move mount from %s to %s: %s", -- mm_tmp_root, mm_root, estr); -- return 0; -- } -- -- debug(ap->logopt, -- "moved mount tree from %s to %s", mm_tmp_root, mm_root); -- -- return 1; --} --#endif -- --static void cleanup_multi_root(struct autofs_point *ap, const char *root, -- const char *path, unsigned int move) --{ -- if (move == MOUNT_MOVE_NONE) -- return; -- -- if (move == MOUNT_MOVE_OTHER) -- spawn_umount(ap->logopt, root, NULL); -- else { -- struct ioctl_ops *ops = get_ioctl_ops(); -- struct autofs_point *submount; -- -- mounts_mutex_lock(ap); -- submount = __master_find_submount(ap, path); -- if (!submount) { -- mounts_mutex_unlock(ap); -- return; -- } -- -- alarm_delete(submount); -- st_remove_tasks(submount); -- st_wait_state(submount, ST_READY); -- -- submount->parent->submnt_count--; -- list_del_init(&submount->mounts); -- -- ops->catatonic(submount->logopt, submount->ioctlfd); -- -- mounts_mutex_unlock(ap); -- -- if (submount->thid) { -- pthread_cancel(submount->thid); -- close_mount_fds(submount); -- umount(root); -- destroy_logpri_fifo(submount); -- master_free_mapent_sources(submount->entry, 1); -- master_free_mapent(ap->entry); -- } -- } -- return; --} -- - static void cleanup_multi_triggers(struct autofs_point *ap, - struct mapent *me, const char *root, int start, - const char *base) -@@ -1166,49 +1082,15 @@ static void cleanup_multi_triggers(struc - return; - } - --#ifdef ENABLE_MOUNT_MOVE --static int check_fstype_autofs_option(const char *options) --{ -- char *tok, *tokbuf; -- int found; -- -- /* -- * Look for fstype= in options and return true if -- * the last occurrence is fstype=autofs. -- */ -- found = 0; -- tokbuf = alloca(strlen(options) + 2); -- strcpy(tokbuf, options); -- tok = strtok_r(tokbuf, ",", &tokbuf); -- if (tok) { -- do { -- if (strstr(tok, "fstype=")) { -- if (strstr(tok, "autofs")) -- found = 1; -- else -- found = 0; -- } -- } while ((tok = strtok_r(NULL, ",", &tokbuf))); -- } -- -- return found; --} --#endif -- - static int mount_subtree(struct autofs_point *ap, struct mapent *me, - const char *name, char *loc, char *options, void *ctxt) - { - struct mapent *mm; - struct mapent *ro; - char *mm_root, *mm_base, *mm_key; -- const char *mnt_root, *target; -+ const char *mnt_root; - unsigned int mm_root_len, mnt_root_len; - int start, ret = 0, rv; -- unsigned int move = MOUNT_MOVE_NONE; --#ifdef ENABLE_MOUNT_MOVE -- char t_dir[] = "/tmp/autoXXXXXX"; -- char *mnt_tmp_root = NULL; --#endif - - rv = 0; - -@@ -1227,26 +1109,12 @@ static int mount_subtree(struct autofs_p - } - mm_root_len = strlen(mm_root); - --#ifndef ENABLE_MOUNT_MOVE - mnt_root = mm_root; - mnt_root_len = mm_root_len; --#else -- if (ap->flags & MOUNT_FLAG_REMOUNT) { -- mnt_root = mm_root; -- mnt_root_len = mm_root_len; -- } else { -- mnt_root = mkdtemp(t_dir); -- if (!mnt_root) -- return 1; -- mnt_root_len = strlen(mnt_root); -- mnt_tmp_root = (char *) mnt_root; -- } --#endif - - if (me == me->multi) { - /* name = NULL */ - /* destination = mm_root */ -- target = mm_root; - mm_base = "/"; - - /* Mount root offset if it exists */ -@@ -1263,18 +1131,10 @@ static int mount_subtree(struct autofs_p - warn(ap->logopt, - MODPREFIX "failed to parse root offset"); - cache_delete_offset_list(me->mc, name); -- goto error_out; -+ return 1; - } - ro_len = strlen(ro_loc); - --#ifdef ENABLE_MOUNT_MOVE -- if (!(ap->flags & MOUNT_FLAG_REMOUNT)) { -- move = MOUNT_MOVE_OTHER; -- if (check_fstype_autofs_option(myoptions)) -- move = MOUNT_MOVE_AUTOFS; -- } --#endif -- - tmp = alloca(mnt_root_len + 1); - strcpy(tmp, mnt_root); - tmp[mnt_root_len] = '/'; -@@ -1293,44 +1153,25 @@ static int mount_subtree(struct autofs_p - error(ap->logopt, MODPREFIX - "failed to mount offset triggers"); - cleanup_multi_triggers(ap, me, mnt_root, start, mm_base); -- cleanup_multi_root(ap, mnt_root, mm_root, move); -- goto error_out; -+ return 1; - } - } else if (rv <= 0) { --#ifdef ENABLE_MOUNT_MOVE -- move = MOUNT_MOVE_NONE; --#endif - ret = mount_multi_triggers(ap, me, mm_root, start, mm_base); - if (ret == -1) { - error(ap->logopt, MODPREFIX - "failed to mount offset triggers"); - cleanup_multi_triggers(ap, me, mm_root, start, mm_base); -- goto error_out; -+ return 1; - } - } - } else { - int loclen = strlen(loc); - int namelen = strlen(name); - --#ifndef ENABLE_MOUNT_MOVE -- /* -- * When using move mount to mount offsets or direct mounts -- * the base of the tree can be the base of the temporary -- * mount point it needs to be the full path when not moving -- * the mount after construction. -- */ - mnt_root = name; --#else -- if (!(ap->flags & MOUNT_FLAG_REMOUNT)) { -- move = MOUNT_MOVE_OTHER; -- if (check_fstype_autofs_option(options)) -- move = MOUNT_MOVE_AUTOFS; -- } --#endif - - /* name = mm_root + mm_base */ - /* destination = mm_root + mm_base = name */ -- target = name; - mm_base = &me->key[start]; - - rv = sun_mount(ap, mnt_root, name, namelen, loc, loclen, options, ctxt); -@@ -1340,16 +1181,11 @@ static int mount_subtree(struct autofs_p - error(ap->logopt, MODPREFIX - "failed to mount offset triggers"); - cleanup_multi_triggers(ap, me, mnt_root, start, mm_base); -- cleanup_multi_root(ap, mnt_root, mm_root, move); -- goto error_out; -+ return 1; - } - } else if (rv < 0) { - char *mm_root_base = alloca(strlen(mm_root) + strlen(mm_base) + 1); - --#ifdef ENABLE_MOUNT_MOVE -- move = MOUNT_MOVE_NONE; --#endif -- - strcpy(mm_root_base, mm_root); - strcat(mm_root_base, mm_base); - -@@ -1358,22 +1194,11 @@ static int mount_subtree(struct autofs_p - error(ap->logopt, MODPREFIX - "failed to mount offset triggers"); - cleanup_multi_triggers(ap, me, mm_root, start, mm_base); -- goto error_out; -+ return 1; - } - } - } - --#ifdef ENABLE_MOUNT_MOVE -- if (!move_mount(ap, mnt_root, target, move)) { -- cleanup_multi_triggers(ap, me, mnt_root, start, mm_base); -- cleanup_multi_root(ap, mnt_root, mm_root, move); -- goto error_out; -- } -- -- if (mnt_tmp_root) -- rmdir(mnt_tmp_root); --#endif -- - /* Mount for base of tree failed */ - if (rv > 0) - return rv; -@@ -1386,14 +1211,6 @@ static int mount_subtree(struct autofs_p - rv = 0; - - return rv; -- --error_out: --#ifdef ENABLE_MOUNT_MOVE -- if (mnt_tmp_root) -- rmdir(mnt_tmp_root); --#endif -- -- return 1; - } - - /* diff --git a/autofs-5.0.6-report-map-not-read-when-debug-logging.patch b/autofs-5.0.6-report-map-not-read-when-debug-logging.patch deleted file mode 100644 index 8c14346..0000000 --- a/autofs-5.0.6-report-map-not-read-when-debug-logging.patch +++ /dev/null @@ -1,99 +0,0 @@ -autofs-5.0.6 - report map not read when debug logging - -From: Ian Kent - -When a map read is called automount will report that is is reading the -map when debug logging is set. If a map read is not actually needed the -lookup module read map function should also report that it didn't need -to read the map. ---- - - CHANGELOG | 1 + - modules/lookup_hosts.c | 4 +++- - modules/lookup_ldap.c | 4 +++- - modules/lookup_nisplus.c | 4 +++- - modules/lookup_sss.c | 4 +++- - modules/lookup_yp.c | 4 +++- - 6 files changed, 16 insertions(+), 5 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -42,6 +42,7 @@ - - fix configure string length tests for sss library. - - fix initialization in rpc create_client(). - - fix libtirpc name clash. -+- report map not read when debug logging. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/modules/lookup_hosts.c -+++ autofs-5.0.6/modules/lookup_hosts.c -@@ -94,8 +94,10 @@ int lookup_read_map(struct autofs_point - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ -- if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -+ debug(ap->logopt, "map read not needed, so not done"); - return NSS_STATUS_SUCCESS; -+ } - - mc = source->mc; - ---- autofs-5.0.6.orig/modules/lookup_ldap.c -+++ autofs-5.0.6/modules/lookup_ldap.c -@@ -2326,8 +2326,10 @@ static int read_one_map(struct autofs_po - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ -- if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -+ debug(ap->logopt, "map read not needed, so not done"); - return NSS_STATUS_SUCCESS; -+ } - - sp.ap = ap; - sp.age = age; ---- autofs-5.0.6.orig/modules/lookup_nisplus.c -+++ autofs-5.0.6/modules/lookup_nisplus.c -@@ -185,8 +185,10 @@ int lookup_read_map(struct autofs_point - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ -- if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -+ debug(ap->logopt, "map read not needed, so not done"); - return NSS_STATUS_SUCCESS; -+ } - - mc = source->mc; - ---- autofs-5.0.6.orig/modules/lookup_sss.c -+++ autofs-5.0.6/modules/lookup_sss.c -@@ -275,8 +275,10 @@ int lookup_read_map(struct autofs_point - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ -- if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -+ debug(ap->logopt, "map read not needed, so not done"); - return NSS_STATUS_SUCCESS; -+ } - - if (!setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt)) - return NSS_STATUS_UNAVAIL; ---- autofs-5.0.6.orig/modules/lookup_yp.c -+++ autofs-5.0.6/modules/lookup_yp.c -@@ -327,8 +327,10 @@ int lookup_read_map(struct autofs_point - * reading the map. We always need to read the whole map for - * direct mounts in order to mount the triggers. - */ -- if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) -+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) { -+ debug(ap->logopt, "map read not needed, so not done"); - return NSS_STATUS_SUCCESS; -+ } - - ypcb_data.ap = ap; - ypcb_data.source = source; diff --git a/autofs-5.0.6-rework-error-return-handling-in-rpc-code.patch b/autofs-5.0.6-rework-error-return-handling-in-rpc-code.patch deleted file mode 100644 index 81be29c..0000000 --- a/autofs-5.0.6-rework-error-return-handling-in-rpc-code.patch +++ /dev/null @@ -1,618 +0,0 @@ -autofs-5.0.6 - rework error return handling in rpc code - -From: Ian Kent - -With the changes to the way mount.nfs performs nfs mounts for -kernels that support passing of text based options mounts to -hosts that are down or unreachable can take a long time to -fail due to lengthy timeouts. The kernel rpc code is duty -bound to honour these timeouts so we need to find a way to -catch EHOSTUNREACH errors during host probing. - -The first thing to do is to rework the lower level autofs -rpc code to propogate error returns up to the higher levels. ---- - - CHANGELOG | 1 - lib/rpc_subs.c | 178 ++++++++++++++++++++++++++++----------------------- - modules/replicated.c | 26 +++---- - 3 files changed, 114 insertions(+), 91 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -27,6 +27,7 @@ - - add kernel verion check function. - - add function to check mount.nfs version. - - reinstate singleton mount probe. -+- rework error return handling in rpc code. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/lib/rpc_subs.c -+++ autofs-5.0.6/lib/rpc_subs.c -@@ -76,11 +76,11 @@ static int connect_nb(int fd, struct soc - - flags = fcntl(fd, F_GETFL, 0); - if (flags < 0) -- return -1; -+ return -errno; - - ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK); - if (ret < 0) -- return -1; -+ return -errno; - - /* - * From here on subsequent sys calls could change errno so -@@ -150,14 +150,16 @@ done: - } - - #ifndef WITH_LIBTIRPC --static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd) -+static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd, CLIENT **client) - { -- CLIENT *client = NULL; -+ CLIENT *clnt = NULL; - struct sockaddr_in in4_laddr; - struct sockaddr_in *in4_raddr; - int type, proto; - socklen_t slen; - -+ *client = NULL; -+ - proto = info->proto->p_proto; - if (proto == IPPROTO_UDP) - type = SOCK_DGRAM; -@@ -179,11 +181,11 @@ static CLIENT *rpc_do_create_client(stru - - *fd = open_sock(addr->sa_family, type, proto); - if (*fd < 0) -- return NULL; -+ return -errno; - - laddr = (struct sockaddr *) &in4_laddr; - if (bind(*fd, laddr, slen) < 0) -- return NULL; -+ return -errno; - } - - in4_raddr = (struct sockaddr_in *) addr; -@@ -191,26 +193,29 @@ static CLIENT *rpc_do_create_client(stru - - switch (info->proto->p_proto) { - case IPPROTO_UDP: -- client = clntudp_bufcreate(in4_raddr, -- info->program, info->version, -- info->timeout, fd, -- info->send_sz, info->recv_sz); -+ clnt = clntudp_bufcreate(in4_raddr, -+ info->program, info->version, -+ info->timeout, fd, -+ info->send_sz, info->recv_sz); - break; - - case IPPROTO_TCP: -- if (connect_nb(*fd, addr, slen, &info->timeout) < 0) -- break; -- -- client = clnttcp_create(in4_raddr, -- info->program, info->version, fd, -- info->send_sz, info->recv_sz); -+ int ret = connect_nb(*fd, addr, slen, &info->timeout); -+ if (ret < 0) -+ return ret; -+ -+ clnt = clnttcp_create(in4_raddr, -+ info->program, info->version, fd, -+ info->send_sz, info->recv_sz); - break; - - default: - break; - } - -- return client; -+ *client = clnt; -+ -+ return 0; - } - #else - struct netconfig *find_netconf(void *handle, char *family, char *proto) -@@ -226,9 +231,9 @@ struct netconfig *find_netconf(void *han - return nconf; - } - --static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd) -+static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd, CLIENT **client) - { -- CLIENT *client = NULL; -+ CLIENT *clnt = NULL; - struct sockaddr_in in4_laddr; - struct sockaddr_in6 in6_laddr; - struct sockaddr *laddr = NULL; -@@ -238,6 +243,9 @@ static CLIENT *rpc_do_create_client(stru - char *nc_family, *nc_proto; - void *handle; - size_t slen; -+ int ret; -+ -+ *client = NULL; - - proto = info->proto->p_proto; - if (proto == IPPROTO_UDP) { -@@ -272,16 +280,16 @@ static CLIENT *rpc_do_create_client(stru - slen = sizeof(struct sockaddr_in6); - nc_family = NC_INET6; - } else -- return NULL; -+ return -EINVAL; - - handle = setnetconfig(); - if (!handle) -- return NULL; -+ return -EINVAL; - - nconf = find_netconf(handle, nc_family, nc_proto); - if (!nconf) { - endnetconfig(handle); -- return NULL; -+ return -EINVAL; - } - - /* -@@ -292,13 +300,15 @@ static CLIENT *rpc_do_create_client(stru - if (!info->client) { - *fd = open_sock(addr->sa_family, type, proto); - if (*fd < 0) { -+ ret = -errno; - endnetconfig(handle); -- return NULL; -+ return ret; - } - - if (bind(*fd, laddr, slen) < 0) { -+ ret = -errno; - endnetconfig(handle); -- return NULL; -+ return ret; - } - } - -@@ -306,28 +316,30 @@ static CLIENT *rpc_do_create_client(stru - nb_addr.buf = addr; - - if (info->proto->p_proto == IPPROTO_TCP) { -- if (connect_nb(*fd, addr, slen, &info->timeout) < 0) { -+ ret = connect_nb(*fd, addr, slen, &info->timeout); -+ if (ret < 0) { - endnetconfig(handle); -- return NULL; -+ return ret; - } - } - -- client = clnt_tli_create(*fd, nconf, &nb_addr, -- info->program, info->version, -- info->send_sz, info->recv_sz); -+ clnt = clnt_tli_create(*fd, nconf, &nb_addr, -+ info->program, info->version, -+ info->send_sz, info->recv_sz); - - endnetconfig(handle); - -- return client; -+ *client = clnt; -+ -+ return 0; - } - #endif - - /* - * Create an RPC client - */ --static CLIENT *create_client(struct conn_info *info) -+static int create_client(struct conn_info *info, CLIENT **client) - { -- CLIENT *client = NULL; - struct addrinfo *ai, *haddr; - struct addrinfo hints; - int fd, ret; -@@ -346,9 +358,11 @@ static CLIENT *create_client(struct conn - } - - if (info->addr) { -- client = rpc_do_create_client(info->addr, info, &fd); -- if (client) -+ ret = rpc_do_create_client(info->addr, info, &fd, client); -+ if (ret == 0) - goto done; -+ if (ret == -EHOSTUNREACH) -+ goto out_close; - - if (!info->client && fd != RPC_ANYSOCK) { - close(fd); -@@ -376,9 +390,11 @@ static CLIENT *create_client(struct conn - continue; - } - -- client = rpc_do_create_client(haddr->ai_addr, info, &fd); -- if (client) -+ ret = rpc_do_create_client(haddr->ai_addr, info, &fd, client); -+ if (ret == 0) - break; -+ if (ret == -EHOSTUNREACH) -+ goto out_close; - - if (!info->client && fd != RPC_ANYSOCK) { - close(fd); -@@ -390,24 +406,26 @@ static CLIENT *create_client(struct conn - - freeaddrinfo(ai); - -- if (!client) { -+ if (!*client) { - info->client = NULL; -+ ret = -ENOTCONN; - goto out_close; - } - done: - /* Close socket fd on destroy, as is default for rpcowned fds */ -- if (!clnt_control(client, CLSET_FD_CLOSE, NULL)) { -- clnt_destroy(client); -+ if (!clnt_control(*client, CLSET_FD_CLOSE, NULL)) { -+ clnt_destroy(*client); - info->client = NULL; -+ ret = -ENOTCONN; - goto out_close; - } - -- return client; -+ return 0; - - out_close: - if (fd != -1) - close(fd); -- return NULL; -+ return ret; - } - - int rpc_udp_getclient(struct conn_info *info, -@@ -415,11 +433,12 @@ int rpc_udp_getclient(struct conn_info * - { - struct protoent *pe_proto; - CLIENT *client; -+ int ret; - - if (!info->client) { - pe_proto = getprotobyname("udp"); - if (!pe_proto) -- return 0; -+ return -ENOENT; - - info->proto = pe_proto; - info->send_sz = UDPMSGSIZE; -@@ -429,14 +448,13 @@ int rpc_udp_getclient(struct conn_info * - info->program = program; - info->version = version; - -- client = create_client(info); -- -- if (!client) -- return 0; -+ ret = create_client(info, &client); -+ if (ret < 0) -+ return ret; - - info->client = client; - -- return 1; -+ return 0; - } - - void rpc_destroy_udp_client(struct conn_info *info) -@@ -454,11 +472,12 @@ int rpc_tcp_getclient(struct conn_info * - { - struct protoent *pe_proto; - CLIENT *client; -+ int ret; - - if (!info->client) { - pe_proto = getprotobyname("tcp"); - if (!pe_proto) -- return 0; -+ return -ENOENT; - - info->proto = pe_proto; - info->send_sz = 0; -@@ -468,14 +487,13 @@ int rpc_tcp_getclient(struct conn_info * - info->program = program; - info->version = version; - -- client = create_client(info); -- -- if (!client) -- return 0; -+ ret = create_client(info, &client); -+ if (ret < 0) -+ return ret; - - info->client = client; - -- return 1; -+ return 0; - } - - void rpc_destroy_tcp_client(struct conn_info *info) -@@ -509,10 +527,11 @@ int rpc_portmap_getclient(struct conn_in - { - struct protoent *pe_proto; - CLIENT *client; -+ int ret; - - pe_proto = getprotobyname(proto); - if (!pe_proto) -- return 0; -+ return -ENOENT; - - info->host = host; - info->addr = addr; -@@ -530,13 +549,14 @@ int rpc_portmap_getclient(struct conn_in - - if (pe_proto->p_proto == IPPROTO_TCP) - info->timeout.tv_sec = PMAP_TOUT_TCP; -- client = create_client(info); -- if (!client) -- return 0; -+ -+ ret = create_client(info, &client); -+ if (ret < 0) -+ return ret; - - info->client = client; - -- return 1; -+ return 0; - } - - unsigned short rpc_portmap_getport(struct conn_info *info, struct pmap *parms) -@@ -546,6 +566,7 @@ unsigned short rpc_portmap_getport(struc - CLIENT *client; - enum clnt_stat status; - int proto = info->proto->p_proto; -+ int ret; - - memset(&pmap_info, 0, sizeof(struct conn_info)); - -@@ -567,9 +588,9 @@ unsigned short rpc_portmap_getport(struc - pmap_info.send_sz = RPCSMALLMSGSIZE; - pmap_info.recv_sz = RPCSMALLMSGSIZE; - -- client = create_client(&pmap_info); -- if (!client) -- return 0; -+ ret = create_client(&pmap_info, &client); -+ if (ret < 0) -+ return ret; - } - - /* -@@ -611,7 +632,7 @@ unsigned short rpc_portmap_getport(struc - } - - if (status != RPC_SUCCESS) -- return 0; -+ return -EIO; - - return port; - } -@@ -621,6 +642,7 @@ int rpc_ping_proto(struct conn_info *inf - CLIENT *client; - enum clnt_stat status; - int proto = info->proto->p_proto; -+ int ret; - - if (info->client) - client = info->client; -@@ -629,9 +651,9 @@ int rpc_ping_proto(struct conn_info *inf - info->send_sz = UDPMSGSIZE; - info->recv_sz = UDPMSGSIZE; - } -- client = create_client(info); -- if (!client) -- return 0; -+ ret = create_client(info, &client); -+ if (ret < 0) -+ return ret; - } - - clnt_control(client, CLSET_TIMEOUT, (char *) &info->timeout); -@@ -665,7 +687,7 @@ int rpc_ping_proto(struct conn_info *inf - } - - if (status != RPC_SUCCESS) -- return 0; -+ return -EIO; - - return 1; - } -@@ -704,7 +726,7 @@ static unsigned int __rpc_ping(const cha - parms.pm_port = 0; - - info.port = rpc_portmap_getport(&info, &parms); -- if (!info.port) -+ if (info.port < 0) - return status; - - status = rpc_ping_proto(&info); -@@ -719,19 +741,19 @@ int rpc_ping(const char *host, long seco - unsigned int status; - - status = __rpc_ping(host, vers2, "udp", seconds, micros, option); -- if (status) -+ if (status > 0) - return RPC_PING_V2 | RPC_PING_UDP; - - status = __rpc_ping(host, vers3, "udp", seconds, micros, option); -- if (status) -+ if (status > 0) - return RPC_PING_V3 | RPC_PING_UDP; - - status = __rpc_ping(host, vers2, "tcp", seconds, micros, option); -- if (status) -+ if (status > 0) - return RPC_PING_V2 | RPC_PING_TCP; - - status = __rpc_ping(host, vers3, "tcp", seconds, micros, option); -- if (status) -+ if (status > 0) - return RPC_PING_V3 | RPC_PING_TCP; - - return status; -@@ -760,9 +782,8 @@ int rpc_time(const char *host, - status = __rpc_ping(host, vers, proto, seconds, micros, option); - gettimeofday(&end, &tz); - -- if (!status) { -- return 0; -- } -+ if (status == RPC_PING_FAIL || status < 0) -+ return status; - - taken = elapsed(start, end); - -@@ -779,13 +800,14 @@ static int rpc_get_exports_proto(struct - int proto = info->proto->p_proto; - unsigned int option = info->close_option; - int vers_entry; -+ int ret; - - if (info->proto->p_proto == IPPROTO_UDP) { - info->send_sz = UDPMSGSIZE; - info->recv_sz = UDPMSGSIZE; - } -- client = create_client(info); -- if (!client) -+ ret = create_client(info, &client); -+ if (ret < 0) - return 0; - - clnt_control(client, CLSET_TIMEOUT, (char *) &info->timeout); -@@ -894,7 +916,7 @@ exports rpc_get_exports(const char *host - parms.pm_prot = info.proto->p_proto; - - info.port = rpc_portmap_getport(&info, &parms); -- if (!info.port) -+ if (info.port < 0) - goto try_tcp; - - memset(&exportlist, '\0', sizeof(exportlist)); -@@ -911,7 +933,7 @@ try_tcp: - parms.pm_prot = info.proto->p_proto; - - info.port = rpc_portmap_getport(&info, &parms); -- if (!info.port) -+ if (info.port < 0) - return NULL; - - memset(&exportlist, '\0', sizeof(exportlist)); ---- autofs-5.0.6.orig/modules/replicated.c -+++ autofs-5.0.6/modules/replicated.c -@@ -563,11 +563,11 @@ static unsigned int get_nfs_info(unsigne - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); -- if (status) { -+ if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status) { -+ if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -589,7 +589,7 @@ v3_ver: - status = rpc_portmap_getclient(pm_info, - host->name, host->addr, host->addr_len, - proto, RPC_CLOSE_DEFAULT); -- if (!status) -+ if (status) - goto done_ver; - } - -@@ -603,7 +603,7 @@ v3_ver: - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS3_VERSION; - rpc_info->port = rpc_portmap_getport(pm_info, &parms); -- if (!rpc_info->port) -+ if (rpc_info->port < 0) - goto v2_ver; - } - -@@ -611,11 +611,11 @@ v3_ver: - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); -- if (status) { -+ if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status) { -+ if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -643,7 +643,7 @@ v2_ver: - parms.pm_prot = rpc_info->proto->p_proto; - parms.pm_vers = NFS2_VERSION; - rpc_info->port = rpc_portmap_getport(pm_info, &parms); -- if (!rpc_info->port) -+ if (rpc_info->port < 0) - goto done_ver; - } - -@@ -651,11 +651,11 @@ v2_ver: - status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); - else - status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); -- if (status) { -+ if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(rpc_info); - gettimeofday(&end, &tz); -- if (status) { -+ if (status > 0) { - double reply; - if (random_selection) { - /* Random value between 0 and 1 */ -@@ -835,12 +835,12 @@ static int get_supported_ver_and_cost(un - int ret = rpc_portmap_getclient(&pm_info, - host->name, host->addr, host->addr_len, - proto, RPC_CLOSE_DEFAULT); -- if (!ret) -+ if (ret) - return 0; - - parms.pm_prot = rpc_info.proto->p_proto; - rpc_info.port = rpc_portmap_getport(&pm_info, &parms); -- if (!rpc_info.port) -+ if (rpc_info.port < 0) - goto done; - } - -@@ -848,11 +848,11 @@ static int get_supported_ver_and_cost(un - status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); - else - status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, parms.pm_vers); -- if (status) { -+ if (!status) { - gettimeofday(&start, &tz); - status = rpc_ping_proto(&rpc_info); - gettimeofday(&end, &tz); -- if (status) { -+ if (status > 0) { - if (random_selection) { - /* Random value between 0 and 1 */ - taken = ((float) random())/((float) RAND_MAX+1); diff --git a/autofs-5.0.6-systemd-support-fixes.patch b/autofs-5.0.6-systemd-support-fixes.patch deleted file mode 100644 index 2d784ea..0000000 --- a/autofs-5.0.6-systemd-support-fixes.patch +++ /dev/null @@ -1,110 +0,0 @@ -autofs-5.0.6 - systemd support fixes - -From: Ian Kent - -Fix up some of in spec file systemd scriptlets. - -The pre-system package verion uninstall scriptlet has been commented -out in the tar spec file. It's is an example of what might need to -be done in a distro spec file. ---- - - CHANGELOG | 1 + - autofs.spec | 41 ++++++++++++++++++++++++++++++----------- - samples/autofs.service.in | 1 + - 3 files changed, 32 insertions(+), 11 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 69ade49..b9c3149 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -32,6 +32,7 @@ - - reinstate singleton mount probe. - - rework error return handling in rpc code. - - catch EHOSTUNREACH and bail out early. -+- systemd support fixes. - - 28/06/2011 autofs-5.0.6 - ----------------------- -diff --git a/autofs.spec b/autofs.spec -index d854b1f..a73fefb 100644 ---- a/autofs.spec -+++ b/autofs.spec -@@ -105,34 +105,53 @@ install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs - - %post - %if %{with_systemd} --/bin/systemctl daemon-reload >/dev/null 2>&1 || : -+if [ $1 -eq 1 ]; then -+ %{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || : -+ # autofs has been approved to be enabled by default -+ %{_bindir}/systemctl enable %{name}.service >/dev/null 2>&1 || : -+fi - %else --chkconfig --add autofs -+if [ $1 -eq 1 ]; then -+ %{_sbindir}/chkconfig --add autofs -+fi - %endif - - %preun --if [ "$1" = 0 ] ; then - %if %{with_systemd} -- /bin/systemctl --no-reload disable autofs.service > /dev/null 2>&1 || : -- /bin/systemctl stop autofs.service > /dev/null 2>&1 || : -+if [ $1 -eq 0 ] ; then -+ %{_bindir}/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || : -+ %{_bindir}/systemctl stop %{name}.service > /dev/null 2>&1 || : -+fi - %else -- /sbin/service autofs stop > /dev/null 2>&1 || : -- /sbin/chkconfig --del autofs --%endif -+if [ $1 -eq 0 ] ; then -+ %{_sbindir}/service autofs stop > /dev/null 2>&1 || : -+ %{_sbindir}/chkconfig --del autofs - fi -+%endif - - %postun - %if %{with_systemd} --/bin/systemctl daemon-reload >/dev/null 2>&1 || : -+%{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || : - if [ $1 -ge 1 ] ; then -- /bin/systemctl try-restart autofs.service >/dev/null 2>&1 || : -+ # Package upgrade, not removal -+ %{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || : - fi - %else - if [ $1 -ge 1 ] ; then -- /sbin/service autofs condrestart > /dev/null 2>&1 || : -+ %{_sbindir}/service autofs condrestart > /dev/null 2>&1 || : - fi - %endif - -+#%triggerun -- %{name} < $bla release -+## 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 CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf -diff --git a/samples/autofs.service.in b/samples/autofs.service.in -index 3756078..879b47b 100644 ---- a/samples/autofs.service.in -+++ b/samples/autofs.service.in -@@ -7,6 +7,7 @@ Type=forking - PIDFile=@@autofspiddir@@/autofs.pid - EnvironmentFile=-@@autofsconfdir@@/autofs - ExecStart=@@sbindir@@/automount ${OPTIONS} --pid-file @@autofspiddir@@/autofs.pid -+ExecReload=/usr/bin/kill -HUP $MAINPID - - [Install] - WantedBy=multi-user.target diff --git a/autofs-5.0.6-teach-automount-about-sss-source.patch b/autofs-5.0.6-teach-automount-about-sss-source.patch deleted file mode 100644 index 63bfa41..0000000 --- a/autofs-5.0.6-teach-automount-about-sss-source.patch +++ /dev/null @@ -1,83 +0,0 @@ -autofs-5.0.6 - teach automount about sss source - -From: Ian Kent - -Add parser and conditional checks to automount to handle sss source. -Note, the parsing probably needs more work, both for master map entries -and map entries, to attempt to narrow invalid map names passed down to -lower level modules. For now we have to just handle these failures in -the lookup module. ---- - - CHANGELOG | 1 + - daemon/lookup.c | 1 + - lib/master_tok.l | 2 +- - lib/nss_parse.y | 6 ++++-- - modules/parse_sun.c | 2 +- - 5 files changed, 8 insertions(+), 4 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -22,6 +22,7 @@ - - fix improve mount location error reporting. - - fix rpc build error. - - add sss lookup module. -+- teach automount about sss source. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/lookup.c -+++ autofs-5.0.6/daemon/lookup.c -@@ -177,6 +177,7 @@ int lookup_nss_read_master(struct master - !strncmp(name, "nisplus:", 8) || - !strncmp(name, "ldap:", 5) || - !strncmp(name, "ldaps:", 6) || -+ !strncmp(name, "sss:", 4) || - !strncmp(name, "dir:", 4)) { - strncpy(source, name, tmp - name); - ---- autofs-5.0.6.orig/lib/master_tok.l -+++ autofs-5.0.6/lib/master_tok.l -@@ -118,7 +118,7 @@ DNNAMESTR2 ([[:alnum:]_.\-]+) - INTMAP (-hosts|-null) - MULTI ((multi)(,(sun|hesiod))?(:{OPTWS}|{WS})) - MULTISEP ([\-]{2}[[:blank:]]+) --MTYPE ((file|program|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}|{WS})) -+MTYPE ((file|program|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}|{WS})) - - - OPTTOUT (-t{OPTWS}|-t{OPTWS}={OPTWS}|--timeout{OPTWS}|--timeout{OPTWS}={OPTWS}) ---- autofs-5.0.6.orig/lib/nss_parse.y -+++ autofs-5.0.6/lib/nss_parse.y -@@ -82,7 +82,8 @@ nss_source: SOURCE - { - if (!strcmp($1, "files") || !strcmp($1, "yp") || - !strcmp($1, "nis") || !strcmp($1, "ldap") || -- !strcmp($1, "nisplus") || !strcmp($1, "hesiod")) -+ !strcmp($1, "nisplus") || !strcmp($1, "hesiod") || -+ !strcmp($1, "sss")) - src = add_source(nss_list, $1); - else - nss_ignore($1); -@@ -92,7 +93,8 @@ nss_source: SOURCE - - if (!strcmp($1, "files") || !strcmp($1, "yp") || - !strcmp($1, "nis") || !strcmp($1, "ldap") || -- !strcmp($1, "nisplus") || !strcmp($1, "hesiod")) { -+ !strcmp($1, "nisplus") || !strcmp($1, "hesiod") || -+ !strcmp($1, "sss")) { - src = add_source(nss_list, $1); - for (a = 0; a < NSS_STATUS_MAX; a++) { - if (act[a].action != NSS_ACTION_UNKNOWN) { ---- autofs-5.0.6.orig/modules/parse_sun.c -+++ autofs-5.0.6/modules/parse_sun.c -@@ -880,7 +880,7 @@ static int validate_location(unsigned in - !strncmp(ptr, "file:", 5) || !strncmp(ptr, "yp:", 3) || - !strncmp(ptr, "nis:", 4) || !strncmp(ptr, "nisplus:", 8) || - !strncmp(ptr, "ldap:", 5) || !strncmp(ptr, "ldaps:", 6) || -- !strncmp(ptr, "dir:", 4)) -+ !strncmp(ptr, "sss:", 4) || !strncmp(ptr, "dir:", 4)) - return 1; - error(logopt, - "expected colon delimeter not found in location %s", diff --git a/autofs-5.0.6-update-timeout-function-to-not-return-timeout.patch b/autofs-5.0.6-update-timeout-function-to-not-return-timeout.patch deleted file mode 100644 index d5f8a37..0000000 --- a/autofs-5.0.6-update-timeout-function-to-not-return-timeout.patch +++ /dev/null @@ -1,171 +0,0 @@ -autofs-5.0.6 - update ->timeout() function to not return timeout - -From: Ian Kent - -The value returned by the ->timeout() autofs control interface -function is not used so make that usage explict by not using a -pass by address parameter. This saves having to take care to -always use a temporary storage location when using the function. ---- - - CHANGELOG | 1 + - daemon/direct.c | 6 +++--- - daemon/indirect.c | 2 +- - include/dev-ioctl-lib.h | 2 +- - lib/dev-ioctl-lib.c | 15 +++++++-------- - lib/master_parse.y | 3 +-- - lib/mounts.c | 4 ++-- - 7 files changed, 16 insertions(+), 17 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -44,6 +44,7 @@ - - fix libtirpc name clash. - - report map not read when debug logging. - - duplicate parent options for included maps. -+- update ->timeout() function to not return timeout. - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/daemon/direct.c -+++ autofs-5.0.6/daemon/direct.c -@@ -302,7 +302,7 @@ static int unlink_active_mounts(struct a - return 0; - } - -- ops->timeout(ap->logopt, ioctlfd, &tout); -+ ops->timeout(ap->logopt, ioctlfd, tout); - - if (save_ioctlfd == -1) - ops->close(ap->logopt, ioctlfd); -@@ -424,7 +424,7 @@ int do_mount_autofs_direct(struct autofs - goto out_umount; - } - -- ops->timeout(ap->logopt, ioctlfd, &timeout); -+ ops->timeout(ap->logopt, ioctlfd, timeout); - notify_mount_result(ap, me->key, str_direct); - cache_set_ino_index(me->mc, me->key, st.st_dev, st.st_ino); - ops->close(ap->logopt, ioctlfd); -@@ -771,7 +771,7 @@ int mount_autofs_offset(struct autofs_po - goto out_umount; - } - -- ops->timeout(ap->logopt, ioctlfd, &timeout); -+ ops->timeout(ap->logopt, ioctlfd, timeout); - cache_set_ino_index(me->mc, me->key, st.st_dev, st.st_ino); - if (ap->logopt & LOGOPT_DEBUG) - notify_mount_result(ap, mountpoint, str_offset); ---- autofs-5.0.6.orig/daemon/indirect.c -+++ autofs-5.0.6/daemon/indirect.c -@@ -172,7 +172,7 @@ static int do_mount_autofs_indirect(stru - ap->dev = st.st_dev; /* Device number for mount point checks */ - ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO; - -- ops->timeout(ap->logopt, ap->ioctlfd, &timeout); -+ ops->timeout(ap->logopt, ap->ioctlfd, timeout); - if (ap->logopt & LOGOPT_DEBUG) - notify_mount_result(ap, root, str_indirect); - else ---- autofs-5.0.6.orig/include/dev-ioctl-lib.h -+++ autofs-5.0.6/include/dev-ioctl-lib.h -@@ -45,7 +45,7 @@ struct ioctl_ops { - int (*send_fail)(unsigned int, int, unsigned int, int); - int (*setpipefd)(unsigned int, int, int); - int (*catatonic)(unsigned int, int); -- int (*timeout)(unsigned int, int, time_t *); -+ int (*timeout)(unsigned int, int, time_t); - int (*requestor)(unsigned int, int, const char *, uid_t *, gid_t *); - int (*expire)(unsigned int, int, const char *, unsigned int); - int (*askumount)(unsigned int, int, unsigned int *); ---- autofs-5.0.6.orig/lib/dev-ioctl-lib.c -+++ autofs-5.0.6/lib/dev-ioctl-lib.c -@@ -55,7 +55,7 @@ static int dev_ioctl_send_ready(unsigned - static int dev_ioctl_send_fail(unsigned int, int, unsigned int, int); - static int dev_ioctl_setpipefd(unsigned int, int, int); - static int dev_ioctl_catatonic(unsigned int, int); --static int dev_ioctl_timeout(unsigned int, int, time_t *); -+static int dev_ioctl_timeout(unsigned int, int, time_t); - static int dev_ioctl_requestor(unsigned int, int, const char *, uid_t *, gid_t *); - static int dev_ioctl_expire(unsigned int, int, const char *, unsigned int); - static int dev_ioctl_askumount(unsigned int, int, unsigned int *); -@@ -69,7 +69,7 @@ static int ioctl_close(unsigned int, int - static int ioctl_send_ready(unsigned int, int, unsigned int); - static int ioctl_send_fail(unsigned int, int, unsigned int, int); - static int ioctl_catatonic(unsigned int, int); --static int ioctl_timeout(unsigned int, int, time_t *); -+static int ioctl_timeout(unsigned int, int, time_t); - static int ioctl_expire(unsigned int, int, const char *, unsigned int); - static int ioctl_askumount(unsigned int, int, unsigned int *); - -@@ -577,25 +577,24 @@ static int ioctl_catatonic(unsigned int - } - - /* Set the autofs mount timeout */ --static int dev_ioctl_timeout(unsigned int logopt, int ioctlfd, time_t *timeout) -+static int dev_ioctl_timeout(unsigned int logopt, int ioctlfd, time_t timeout) - { - struct autofs_dev_ioctl param; - - init_autofs_dev_ioctl(¶m); - param.ioctlfd = ioctlfd; -- param.timeout.timeout = *timeout; -+ param.timeout.timeout = timeout; - - if (ioctl(ctl.devfd, AUTOFS_DEV_IOCTL_TIMEOUT, ¶m) == -1) - return -1; - -- *timeout = param.timeout.timeout; -- - return 0; - } - --static int ioctl_timeout(unsigned int logopt, int ioctlfd, time_t *timeout) -+static int ioctl_timeout(unsigned int logopt, int ioctlfd, time_t timeout) - { -- return ioctl(ioctlfd, AUTOFS_IOC_SETTIMEOUT, timeout); -+ time_t tout = timeout; -+ return ioctl(ioctlfd, AUTOFS_IOC_SETTIMEOUT, &tout); - } - - /* ---- autofs-5.0.6.orig/lib/master_parse.y -+++ autofs-5.0.6/lib/master_parse.y -@@ -801,7 +801,6 @@ int master_parse_entry(const char *buffe - } else { - struct ioctl_ops *ops = get_ioctl_ops(); - struct autofs_point *ap = entry->ap; -- time_t tout = timeout; - - /* - * Second and subsequent instances of a mount point -@@ -811,7 +810,7 @@ int master_parse_entry(const char *buffe - ap->exp_timeout = timeout; - ap->exp_runfreq = (ap->exp_timeout + CHECK_RATIO - 1) / CHECK_RATIO; - if (ap->ioctlfd != -1 && ap->type == LKP_INDIRECT) -- ops->timeout(ap->logopt, ap->ioctlfd, &tout); -+ ops->timeout(ap->logopt, ap->ioctlfd, timeout); - } - } - if (random_selection) ---- autofs-5.0.6.orig/lib/mounts.c -+++ autofs-5.0.6/lib/mounts.c -@@ -1404,7 +1404,7 @@ static int remount_active_mount(struct a - - /* Re-reading the map, set timeout and return */ - if (ap->state == ST_READMAP) { -- ops->timeout(ap->logopt, fd, &timeout); -+ ops->timeout(ap->logopt, fd, timeout); - ops->close(ap->logopt, fd); - return REMOUNT_READ_MAP; - } -@@ -1426,7 +1426,7 @@ static int remount_active_mount(struct a - ops->close(ap->logopt, fd); - return REMOUNT_OPEN_FAIL; - } -- ops->timeout(ap->logopt, fd, &timeout); -+ ops->timeout(ap->logopt, fd, timeout); - if (fstat(fd, &st) == -1) { - error(ap->logopt, - "failed to stat %s mount %s", str_type, path); diff --git a/autofs-5.0.6-use-strtok_r-in-linux_version_code.patch b/autofs-5.0.6-use-strtok_r-in-linux_version_code.patch deleted file mode 100644 index d05dd75..0000000 --- a/autofs-5.0.6-use-strtok_r-in-linux_version_code.patch +++ /dev/null @@ -1,51 +0,0 @@ -autofs-5.0.6 - use strtok_r() in linux_version_code() - -From: Ian Kent - -Use re-entrant version of strtok() in linux_version_code() function. -Also fix tab formatting. ---- - - CHANGELOG | 1 + - include/mounts.h | 17 +++++++++-------- - 2 files changed, 10 insertions(+), 8 deletions(-) - - ---- autofs-5.0.6.orig/CHANGELOG -+++ autofs-5.0.6/CHANGELOG -@@ -36,6 +36,7 @@ - - fix rework error return handling in rpc code. - - allow MOUNT_WAIT to override probe. - - improve UDP RPC timeout handling. -+- use strtok_r() in linux_version_code(). - - 28/06/2011 autofs-5.0.6 - ----------------------- ---- autofs-5.0.6.orig/include/mounts.h -+++ autofs-5.0.6/include/mounts.h -@@ -77,16 +77,17 @@ struct mnt_list { - - static inline unsigned int linux_version_code(void) - { -- struct utsname my_utsname; -- unsigned int p, q, r; -+ struct utsname my_utsname; -+ unsigned int p, q, r; -+ char *save; - -- if (uname(&my_utsname)) -- return 0; -+ if (uname(&my_utsname)) -+ return 0; - -- p = (unsigned int)atoi(strtok(my_utsname.release, ".")); -- q = (unsigned int)atoi(strtok(NULL, ".")); -- r = (unsigned int)atoi(strtok(NULL, ".")); -- return KERNEL_VERSION(p, q, r); -+ p = (unsigned int) atoi(strtok_r(my_utsname.release, ".", &save)); -+ q = (unsigned int) atoi(strtok_r(NULL, ".", &save)); -+ r = (unsigned int) atoi(strtok_r(NULL, ".", &save)); -+ return KERNEL_VERSION(p, q, r); - } - - struct nfs_mount_vers { diff --git a/autofs-5.0.7-README-update-mailing-list-subscription-info.patch b/autofs-5.0.7-README-update-mailing-list-subscription-info.patch deleted file mode 100644 index 99b6181..0000000 --- a/autofs-5.0.7-README-update-mailing-list-subscription-info.patch +++ /dev/null @@ -1,56 +0,0 @@ -autofs-5.0.7 - README: update mailing list subscription info - -From: Chris Packham - -Following the kernel.org compromise the mailing list was moved to -vger.kernel.org. Update the subscription info and add URLs for the gmane -mailing list archive. - -Signed-off-by: Chris Packham ---- - - CHANGELOG | 1 + - README | 17 ++++++++++++++--- - 2 files changed, 15 insertions(+), 3 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index fe801e8..44c9fb2 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -10,6 +10,7 @@ - - fix null map entry order handling. - - make description of default MOUNT_WAIT setting clear. - - configure.in: allow cross compilation. -+- README: update mailing list subscription info. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/README b/README -index cef16a9..9024e64 100644 ---- a/README -+++ b/README -@@ -43,9 +43,20 @@ Fitzhardinge's work on autofs 3. Further enhancements - have been made by Ian Kent . - - If you use or want to help develop autofs, please join the autofs --mailing list by visiting: -+mailing list by sending an email to: - -- http://linux.kernel.org/mailman/listinfo/autofs -+ majordomo@vger.kernel.org - --and folling the instructions there to subscribe to the autofs mailing list. -+With the body text: -+ -+ subscribe autofs -+ -+Once subscribed you can send patches to: -+ -+ autofs@vger.kernel.org -+ -+The autofs mailing list archive can be viewed on gmane: -+ -+ http://news.gmane.org/gmane.linux.kernel.autofs -+ http://blog.gmane.org/gmane.linux.kernel.autofs - diff --git a/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch b/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch deleted file mode 100644 index 5d7d1c2..0000000 --- a/autofs-5.0.7-add-after-sssd-dependency-to-unit-file.patch +++ /dev/null @@ -1,35 +0,0 @@ -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/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch b/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch deleted file mode 100644 index a628512..0000000 --- a/autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch +++ /dev/null @@ -1,48 +0,0 @@ -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/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch b/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch deleted file mode 100644 index e8c239e..0000000 --- a/autofs-5.0.7-add-debug-alert-for-waitpid-in-check_nfs_mount_version.patch +++ /dev/null @@ -1,24 +0,0 @@ -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/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch b/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch deleted file mode 100644 index c6dd8d5..0000000 --- a/autofs-5.0.7-add-enable-sloppy-mount-option-to-configure.patch +++ /dev/null @@ -1,691 +0,0 @@ -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/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch b/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch deleted file mode 100644 index 0066b9b..0000000 --- a/autofs-5.0.7-add-initialization-of-bind_result-in.patch-do_sasl_bind.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch b/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch deleted file mode 100644 index 165eec5..0000000 --- a/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch +++ /dev/null @@ -1,25 +0,0 @@ -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/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch b/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch deleted file mode 100644 index 9cda9df..0000000 --- a/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch +++ /dev/null @@ -1,24 +0,0 @@ -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/autofs-5.0.7-add-null-check-in-extract_version.patch b/autofs-5.0.7-add-null-check-in-extract_version.patch deleted file mode 100644 index 93bd2ac..0000000 --- a/autofs-5.0.7-add-null-check-in-extract_version.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/autofs-5.0.7-add-null-check-in-parse_server_string.patch b/autofs-5.0.7-add-null-check-in-parse_server_string.patch deleted file mode 100644 index e5a0adb..0000000 --- a/autofs-5.0.7-add-null-check-in-parse_server_string.patch +++ /dev/null @@ -1,26 +0,0 @@ -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/autofs-5.0.7-add-null-check-in-read_one.patch b/autofs-5.0.7-add-null-check-in-read_one.patch deleted file mode 100644 index a830bc9..0000000 --- a/autofs-5.0.7-add-null-check-in-read_one.patch +++ /dev/null @@ -1,26 +0,0 @@ -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/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch b/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch deleted file mode 100644 index 6674f6d..0000000 --- a/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/autofs-5.0.7-add-symlink-pseudo-option.patch b/autofs-5.0.7-add-symlink-pseudo-option.patch deleted file mode 100644 index b0440f4..0000000 --- a/autofs-5.0.7-add-symlink-pseudo-option.patch +++ /dev/null @@ -1,217 +0,0 @@ -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/autofs-5.0.7-add-timeout-option-description-to-man-page.patch b/autofs-5.0.7-add-timeout-option-description-to-man-page.patch deleted file mode 100644 index ac598dd..0000000 --- a/autofs-5.0.7-add-timeout-option-description-to-man-page.patch +++ /dev/null @@ -1,42 +0,0 @@ -autofs-5.0.7 - add timeout option description to man page - -From: Ian Kent - -The pseudo option used t set the timeout for map entries is one of -the most most frequently used autofs options but is not mentioned -in auto.master(5). ---- - - CHANGELOG | 1 + - man/auto.master.5.in | 5 +++++ - 2 files changed, 6 insertions(+), 0 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 93b9c26..7b8d185 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -6,6 +6,7 @@ - - fix parse buffer initialization. - - fix typo in automount(8). - - dont wait forever to restart. -+- add timeout option description to man page. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/man/auto.master.5.in b/man/auto.master.5.in -index 54269f8..21d7544 100644 ---- a/man/auto.master.5.in -+++ b/man/auto.master.5.in -@@ -167,6 +167,11 @@ server is specified in the map entry. If no server weights are given - then each available server will be tried in the order listed, within - proximity. - .TP -+.I "\-t, \-\-timeout " -+Set the expire timeout for map entries. This option can be used to -+override the global default given either on the command line -+or in the configuration. -+.TP - .I "\-n, \-\-negative\-timeout " - Set the timeout for caching failed key lookups. This option can be - used to override the global default given either on the command line diff --git a/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/autofs-5.0.7-allow-non-root-user-to-check-status.patch deleted file mode 100644 index 6020c31..0000000 --- a/autofs-5.0.7-allow-non-root-user-to-check-status.patch +++ /dev/null @@ -1,69 +0,0 @@ -autofs-5.0.7 - allow non root user to check status - -From: Ian Kent - - ---- - - CHANGELOG | 1 + - redhat/autofs.init.in | 20 +++++++++++++------- - 2 files changed, 14 insertions(+), 7 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 44c9fb2..936c9ab 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -11,6 +11,7 @@ - - make description of default MOUNT_WAIT setting clear. - - configure.in: allow cross compilation. - - README: update mailing list subscription info. -+- allow non root user to check status. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in -index cd5cb34..fe18b3e 100644 ---- a/redhat/autofs.init.in -+++ b/redhat/autofs.init.in -@@ -167,6 +167,19 @@ function usage_message() { - - RETVAL=0 - -+# allow non-root users to read status / usage -+ -+case "$1" in -+ status) -+ status -p @@autofspiddir@@/autofs.pid -l autofs $prog -+ exit 0; -+ ;; -+ usage) -+ usage_message -+ exit 0; -+ ;; -+esac -+ - # Only the root user may change the service status - if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then - echo "insufficient privilege to change service status" -@@ -184,9 +197,6 @@ case "$1" in - stop) - stop - ;; -- status) -- status -p @@autofspiddir@@/autofs.pid -l autofs $prog -- ;; - restart|force-reload) - restart - ;; -@@ -202,10 +212,6 @@ case "$1" in - restart - fi - ;; -- usage) -- usage_message -- exit 0 -- ;; - *) - usage_message - exit 2 diff --git a/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch b/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch deleted file mode 100644 index c342d10..0000000 --- a/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch +++ /dev/null @@ -1,50 +0,0 @@ -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/autofs-5.0.7-check-for-protocol-option.patch b/autofs-5.0.7-check-for-protocol-option.patch deleted file mode 100644 index 5a3464b..0000000 --- a/autofs-5.0.7-check-for-protocol-option.patch +++ /dev/null @@ -1,38 +0,0 @@ -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/autofs-5.0.7-configure-allow-cross-compilation-update.patch b/autofs-5.0.7-configure-allow-cross-compilation-update.patch deleted file mode 100644 index a8bc3ce..0000000 --- a/autofs-5.0.7-configure-allow-cross-compilation-update.patch +++ /dev/null @@ -1,28 +0,0 @@ -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/autofs-5.0.7-configure-in-allow-cross-compilation.patch b/autofs-5.0.7-configure-in-allow-cross-compilation.patch deleted file mode 100644 index ac18bd9..0000000 --- a/autofs-5.0.7-configure-in-allow-cross-compilation.patch +++ /dev/null @@ -1,41 +0,0 @@ -autofs-5.0.7 - configure.in: allow cross compilation - -From: Chris Packham - -The default behaviour of AC_RUN_IFELSE is to stop with an error if cross -compiling. Avoid this by providing the optional 4th argument to set -gcc_supports_pie=no if support for PIE cannot be detected. - -Signed-off-by: Chris Packham ---- - - CHANGELOG | 1 + - configure.in | 2 +- - 2 files changed, 2 insertions(+), 1 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 961e340..fe801e8 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -9,6 +9,7 @@ - - add timeout option description to man page. - - fix null map entry order handling. - - make description of default MOUNT_WAIT setting clear. -+- configure.in: allow cross compilation. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/configure.in b/configure.in -index 1a24e34..90bda62 100644 ---- a/configure.in -+++ b/configure.in -@@ -307,7 +307,7 @@ DAEMON_CFLAGS= - DAEMON_LDFLAGS= - AC_MSG_CHECKING([whether gcc -fPIE works]) - AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], -- [gcc_supports_pie=yes], [gcc_supports_pie=no]) -+ [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) - AC_MSG_RESULT([$gcc_supports_pie]) - if test $gcc_supports_pie = yes ; then - DAEMON_CFLAGS="-fPIE" diff --git a/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch b/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch deleted file mode 100644 index c784de7..0000000 --- a/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch +++ /dev/null @@ -1,40 +0,0 @@ -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/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch b/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch deleted file mode 100644 index 737b5d1..0000000 --- a/autofs-5.0.7-document-allowed-map-sources-in-auto_master.patch +++ /dev/null @@ -1,48 +0,0 @@ -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/autofs-5.0.7-document-browse-option-in-man-page.patch b/autofs-5.0.7-document-browse-option-in-man-page.patch deleted file mode 100644 index 4641342..0000000 --- a/autofs-5.0.7-document-browse-option-in-man-page.patch +++ /dev/null @@ -1,46 +0,0 @@ -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/autofs-5.0.7-dont-fail-on-master-map-self-include.patch b/autofs-5.0.7-dont-fail-on-master-map-self-include.patch deleted file mode 100644 index afb908b..0000000 --- a/autofs-5.0.7-dont-fail-on-master-map-self-include.patch +++ /dev/null @@ -1,59 +0,0 @@ -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/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch b/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch deleted file mode 100644 index 33db77c..0000000 --- a/autofs-5.0.7-dont-override-LDFLAGS-in-make-rules.patch +++ /dev/null @@ -1,46 +0,0 @@ -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/autofs-5.0.7-dont-probe-rdma-mounts.patch b/autofs-5.0.7-dont-probe-rdma-mounts.patch deleted file mode 100644 index 7dda820..0000000 --- a/autofs-5.0.7-dont-probe-rdma-mounts.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch b/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch deleted file mode 100644 index 6444687..0000000 --- a/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch +++ /dev/null @@ -1,69 +0,0 @@ -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/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch b/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch deleted file mode 100644 index 9c9d99b..0000000 --- a/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch +++ /dev/null @@ -1,41 +0,0 @@ -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/autofs-5.0.7-dont-wait-forever-to-restart.patch b/autofs-5.0.7-dont-wait-forever-to-restart.patch deleted file mode 100644 index 9973b47..0000000 --- a/autofs-5.0.7-dont-wait-forever-to-restart.patch +++ /dev/null @@ -1,54 +0,0 @@ -autofs-5.0.7 - dont wait forever to restart - -From: Ian Kent - -When restarting autofs the daemon must be stopped before it is started -again if it is to function properly. At the moment the init script waits -forever which is not ok if the daemon won't exit for some reason. - -So, if the daemon is still running after the stop, run stop() again, wait -a bit longer and if it still hasn't stopped kill it with a SIGKILL to clear -the way for the startup. ---- - - CHANGELOG | 1 + - redhat/autofs.init.in | 13 ++++++++++--- - 2 files changed, 11 insertions(+), 3 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 6051723..93b9c26 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -5,6 +5,7 @@ - - fix ipv6 proximity calculation. - - fix parse buffer initialization. - - fix typo in automount(8). -+- dont wait forever to restart. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in -index ec6d5d6..cd5cb34 100644 ---- a/redhat/autofs.init.in -+++ b/redhat/autofs.init.in -@@ -129,9 +129,16 @@ function restart() { - status autofs > /dev/null 2>&1 - if [ $? -eq 0 ]; then - stop -- while [ -n "`pidof $prog`" ] ; do -- sleep 5 -- done -+ if [ -n "`pidof $prog`" ]; then -+ # If we failed to stop, try at least one more time -+ # after waiting a little while -+ sleep 20 -+ stop -+ auto_pid=`pidof $prog` -+ if [ -n "$auto_pid" ]; then -+ kill -9 $auto_pid -+ fi -+ fi - fi - start - } diff --git a/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch b/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch deleted file mode 100644 index d1703d3..0000000 --- a/autofs-5.0.7-fix-a-couple-of-compiler-warnings.patch +++ /dev/null @@ -1,51 +0,0 @@ -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/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch b/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch deleted file mode 100644 index 1e3fc20..0000000 --- a/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/autofs-5.0.7-fix-automounter-support-on-parisc.patch b/autofs-5.0.7-fix-automounter-support-on-parisc.patch deleted file mode 100644 index e00fdc1..0000000 --- a/autofs-5.0.7-fix-automounter-support-on-parisc.patch +++ /dev/null @@ -1,24 +0,0 @@ -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/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch b/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch deleted file mode 100644 index 74ba6aa..0000000 --- a/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch +++ /dev/null @@ -1,27 +0,0 @@ -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/autofs-5.0.7-fix-fcntl-return-check.patch b/autofs-5.0.7-fix-fcntl-return-check.patch deleted file mode 100644 index ebe9ea8..0000000 --- a/autofs-5.0.7-fix-fcntl-return-check.patch +++ /dev/null @@ -1,25 +0,0 @@ -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/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch b/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch deleted file mode 100644 index 8ce6c0f..0000000 --- a/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch +++ /dev/null @@ -1,179 +0,0 @@ -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/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch b/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch deleted file mode 100644 index 82092c0..0000000 --- a/autofs-5.0.7-fix-fix-map-entry-duplicate-offset-detection.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch b/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch deleted file mode 100644 index 45bd53f..0000000 --- a/autofs-5.0.7-fix-host_addr-null-reference-in-add_new_host.patch +++ /dev/null @@ -1,55 +0,0 @@ -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/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch b/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch deleted file mode 100644 index 661685f..0000000 --- a/autofs-5.0.7-fix-inconsistent-signed-usage-for-__rpc_ping.patch +++ /dev/null @@ -1,41 +0,0 @@ -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/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch b/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch deleted file mode 100644 index 9d59e34..0000000 --- a/autofs-5.0.7-fix-inconsistent-use-of-cache-lock-in-handle_packet_missing_direct.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch b/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch deleted file mode 100644 index 63312f8..0000000 --- a/autofs-5.0.7-fix-incorrect-check-in-flag_is_owned.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/autofs-5.0.7-fix-incorrect-name-in-test.patch b/autofs-5.0.7-fix-incorrect-name-in-test.patch deleted file mode 100644 index bce7c45..0000000 --- a/autofs-5.0.7-fix-incorrect-name-in-test.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch b/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch deleted file mode 100644 index a9c2031..0000000 --- a/autofs-5.0.7-fix-incorrect-value-reference-in-parse_line.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/autofs-5.0.7-fix-init-script-status-return.patch b/autofs-5.0.7-fix-init-script-status-return.patch deleted file mode 100644 index a08d62f..0000000 --- a/autofs-5.0.7-fix-init-script-status-return.patch +++ /dev/null @@ -1,39 +0,0 @@ -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/autofs-5.0.7-fix-interface-address-null-check.patch b/autofs-5.0.7-fix-interface-address-null-check.patch deleted file mode 100644 index f1a209b..0000000 --- a/autofs-5.0.7-fix-interface-address-null-check.patch +++ /dev/null @@ -1,55 +0,0 @@ -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/autofs-5.0.7-fix-ipv6-proximity-calculation.patch b/autofs-5.0.7-fix-ipv6-proximity-calculation.patch deleted file mode 100644 index b341ecd..0000000 --- a/autofs-5.0.7-fix-ipv6-proximity-calculation.patch +++ /dev/null @@ -1,297 +0,0 @@ -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/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch b/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch deleted file mode 100644 index d113eea..0000000 --- a/autofs-5.0.7-fix-leaked-ldap-percent-hack-allocation-in-lookup_one.patch +++ /dev/null @@ -1,21 +0,0 @@ -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/autofs-5.0.7-fix-libtirpc-build-option.patch b/autofs-5.0.7-fix-libtirpc-build-option.patch deleted file mode 100644 index 8ad2afa..0000000 --- a/autofs-5.0.7-fix-libtirpc-build-option.patch +++ /dev/null @@ -1,66 +0,0 @@ -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/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch b/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch deleted file mode 100644 index 126d9a2..0000000 --- a/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch b/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch deleted file mode 100644 index 7c003ff..0000000 --- a/autofs-5.0.7-fix-master-map-bogus-keywork-match.patch +++ /dev/null @@ -1,62 +0,0 @@ -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/autofs-5.0.7-fix-master-map-mount-options-matching.patch b/autofs-5.0.7-fix-master-map-mount-options-matching.patch deleted file mode 100644 index a360618..0000000 --- a/autofs-5.0.7-fix-master-map-mount-options-matching.patch +++ /dev/null @@ -1,43 +0,0 @@ -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/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch b/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch deleted file mode 100644 index 01a9236..0000000 --- a/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/autofs-5.0.7-fix-nobind-man-page-description.patch b/autofs-5.0.7-fix-nobind-man-page-description.patch deleted file mode 100644 index 41328a0..0000000 --- a/autofs-5.0.7-fix-nobind-man-page-description.patch +++ /dev/null @@ -1,46 +0,0 @@ -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/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch b/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch deleted file mode 100644 index b5d7ad2..0000000 --- a/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch +++ /dev/null @@ -1,47 +0,0 @@ -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/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/autofs-5.0.7-fix-null-map-entry-order-handling.patch deleted file mode 100644 index 610afaa..0000000 --- a/autofs-5.0.7-fix-null-map-entry-order-handling.patch +++ /dev/null @@ -1,81 +0,0 @@ -autofs-5.0.7 - fix null map entry order handling - -From: Ian Kent - -If a null map entry appears after a corresponding indirect map entry -autofs doesn't handle it properly. - -Since it appears after the map entry it should'nt affect it but autofs -doesn't account for this case and assumes the map entry is already -mounted and tries to shut it down causing attempted access to facilities -that don't exist. ---- - - CHANGELOG | 1 + - lib/master.c | 32 +++++++++++++++++++++++++++++--- - 2 files changed, 30 insertions(+), 3 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 7b8d185..79cf673 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -7,6 +7,7 @@ - - fix typo in automount(8). - - dont wait forever to restart. - - add timeout option description to man page. -+- fix null map entry order handling. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/lib/master.c b/lib/master.c -index 904b13d..a0e62f2 100644 ---- a/lib/master.c -+++ b/lib/master.c -@@ -1179,9 +1179,35 @@ int master_mount_mounts(struct master *master, time_t age, int readall) - - cache_readlock(nc); - ne = cache_lookup_distinct(nc, this->path); -- if (ne && this->age > ne->age) { -+ /* -+ * If this path matched a nulled entry the master map entry -+ * must be an indirect mount so the master map entry line -+ * number may be obtained from this->maps. -+ */ -+ if (ne) { -+ int lineno = ne->age; - cache_unlock(nc); -- st_add_task(ap, ST_SHUTDOWN_PENDING); -+ -+ /* null entry appears after map entry */ -+ if (this->maps->master_line < lineno) { -+ warn(ap->logopt, -+ "ignoring null entry that appears after " -+ "existing entry for %s", this->path); -+ goto cont; -+ } -+ if (ap->state != ST_INIT) { -+ st_add_task(ap, ST_SHUTDOWN_PENDING); -+ continue; -+ } -+ /* -+ * The map entry hasn't been started yet and we've -+ * seen a preceeding null map entry for it so just -+ * delete it from the master map entry list so it -+ * doesn't get in the road. -+ */ -+ list_del_init(&this->list); -+ master_free_mapent_sources(ap->entry, 1); -+ master_free_mapent(ap->entry); - continue; - } - nested = cache_partial_match(nc, this->path); -@@ -1194,7 +1220,7 @@ int master_mount_mounts(struct master *master, time_t age, int readall) - cache_delete(nc, nested->key); - } - cache_unlock(nc); -- -+cont: - st_mutex_lock(); - - state_pipe = this->ap->state_pipe[1]; diff --git a/autofs-5.0.7-fix-parse-buffer-initialization.patch b/autofs-5.0.7-fix-parse-buffer-initialization.patch deleted file mode 100644 index 22bd5da..0000000 --- a/autofs-5.0.7-fix-parse-buffer-initialization.patch +++ /dev/null @@ -1,51 +0,0 @@ -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/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch b/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch deleted file mode 100644 index 99aef1f..0000000 --- a/autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patch +++ /dev/null @@ -1,21 +0,0 @@ -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/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch b/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch deleted file mode 100644 index d0b33ad..0000000 --- a/autofs-5.0.7-fix-potential-null-dereference-in-lookup_mount.patch +++ /dev/null @@ -1,157 +0,0 @@ -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/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch b/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch deleted file mode 100644 index 1801878..0000000 --- a/autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch +++ /dev/null @@ -1,36 +0,0 @@ -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/autofs-5.0.7-fix-requires-in-spec-file.patch b/autofs-5.0.7-fix-requires-in-spec-file.patch deleted file mode 100644 index 404c848..0000000 --- a/autofs-5.0.7-fix-requires-in-spec-file.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/autofs-5.0.7-fix-several-off-by-one-errors.patch b/autofs-5.0.7-fix-several-off-by-one-errors.patch deleted file mode 100644 index bb94957..0000000 --- a/autofs-5.0.7-fix-several-off-by-one-errors.patch +++ /dev/null @@ -1,128 +0,0 @@ -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/autofs-5.0.7-fix-some-automount_8-typos.patch b/autofs-5.0.7-fix-some-automount_8-typos.patch deleted file mode 100644 index 5e84c6c..0000000 --- a/autofs-5.0.7-fix-some-automount_8-typos.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch b/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch deleted file mode 100644 index 2d02023..0000000 --- a/autofs-5.0.7-fix-spawn_umount-return-check-in-mount_bind-lookup_init.patch +++ /dev/null @@ -1,23 +0,0 @@ -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/autofs-5.0.7-fix-submount-offset-delete.patch b/autofs-5.0.7-fix-submount-offset-delete.patch deleted file mode 100644 index b38e214..0000000 --- a/autofs-5.0.7-fix-submount-offset-delete.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch b/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch deleted file mode 100644 index 09ed383..0000000 --- a/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch +++ /dev/null @@ -1,70 +0,0 @@ -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/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch b/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch deleted file mode 100644 index d856faf..0000000 --- a/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch +++ /dev/null @@ -1,72 +0,0 @@ -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/autofs-5.0.7-fix-typo-in-automount-8.patch b/autofs-5.0.7-fix-typo-in-automount-8.patch deleted file mode 100644 index 0dd7c2b..0000000 --- a/autofs-5.0.7-fix-typo-in-automount-8.patch +++ /dev/null @@ -1,33 +0,0 @@ -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/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch b/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch deleted file mode 100644 index a469c16..0000000 --- a/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch +++ /dev/null @@ -1,49 +0,0 @@ -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/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch b/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch deleted file mode 100644 index 74ed8fa..0000000 --- a/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch +++ /dev/null @@ -1,54 +0,0 @@ -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/autofs-5.0.7-fix-wildcard-multi-map-regression.patch b/autofs-5.0.7-fix-wildcard-multi-map-regression.patch deleted file mode 100644 index 44e4a18..0000000 --- a/autofs-5.0.7-fix-wildcard-multi-map-regression.patch +++ /dev/null @@ -1,225 +0,0 @@ -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/autofs-5.0.7-handle-new-location-of-systemd.patch b/autofs-5.0.7-handle-new-location-of-systemd.patch deleted file mode 100644 index 1c26794..0000000 --- a/autofs-5.0.7-handle-new-location-of-systemd.patch +++ /dev/null @@ -1,57 +0,0 @@ -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/autofs-5.0.7-include-usage-in-usage-message.patch b/autofs-5.0.7-include-usage-in-usage-message.patch deleted file mode 100644 index 1c8a565..0000000 --- a/autofs-5.0.7-include-usage-in-usage-message.patch +++ /dev/null @@ -1,25 +0,0 @@ -autofs-5.0.7 - include usage in usage message - -From: Ian Kent - -Since usage is a case entry we should also nclude it in the usage -message. ---- - - redhat/autofs.init.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - - -diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in -index 8e355da..ec6d5d6 100644 ---- a/redhat/autofs.init.in -+++ b/redhat/autofs.init.in -@@ -155,7 +155,7 @@ function reload() { - } - - function usage_message() { -- echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" -+ echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" - } - - RETVAL=0 diff --git a/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch b/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch deleted file mode 100644 index 22e0418..0000000 --- a/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch +++ /dev/null @@ -1,448 +0,0 @@ -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/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch b/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch deleted file mode 100644 index a3dd3fb..0000000 --- a/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch +++ /dev/null @@ -1,57 +0,0 @@ -autofs-5.0.7 - make description of default MOUNT_WAIT setting clear - -From: Ian Kent - - ---- - - CHANGELOG | 1 + - redhat/autofs.sysconfig.in | 5 +++-- - samples/autofs.conf.default.in | 5 +++-- - 3 files changed, 7 insertions(+), 4 deletions(-) - - -diff --git a/CHANGELOG b/CHANGELOG -index 79cf673..961e340 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -8,6 +8,7 @@ - - dont wait forever to restart. - - add timeout option description to man page. - - fix null map entry order handling. -+- make description of default MOUNT_WAIT setting clear. - - 25/07/2012 autofs-5.0.7 - ======================= -diff --git a/redhat/autofs.sysconfig.in b/redhat/autofs.sysconfig.in -index 36b924d..a8992c4 100644 ---- a/redhat/autofs.sysconfig.in -+++ b/redhat/autofs.sysconfig.in -@@ -18,8 +18,9 @@ TIMEOUT=300 - # Setting this timeout can cause problems when - # mount would otherwise wait for a server that - # is temporarily unavailable, such as when it's --# restarting. The defailt of waiting for mount(8) --# usually results in a wait of around 3 minutes. -+# restarting. The default setting (-1) of waiting -+# for mount(8) usually results in a wait of around -+# 3 minutes. - # - #MOUNT_WAIT=-1 - # -diff --git a/samples/autofs.conf.default.in b/samples/autofs.conf.default.in -index ac2f63b..1da89cf 100644 ---- a/samples/autofs.conf.default.in -+++ b/samples/autofs.conf.default.in -@@ -18,8 +18,9 @@ TIMEOUT=300 - # Setting this timeout can cause problems when - # mount would otherwise wait for a server that - # is temporarily unavailable, such as when it's --# restarting. The defailt of waiting for mount(8) --# usually results in a wait of around 3 minutes. -+# restarting. The default setting (-1) of waiting -+# for mount(8) usually results in a wait of around -+# 3 minutes. - # - #MOUNT_WAIT=-1 - # diff --git a/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch b/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch deleted file mode 100644 index abadcb5..0000000 --- a/autofs-5.0.7-make-dump-maps-check-for-duplicate-indirect-mounts.patch +++ /dev/null @@ -1,64 +0,0 @@ -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/autofs-5.0.7-make-yellow-pages-support-optional.patch b/autofs-5.0.7-make-yellow-pages-support-optional.patch deleted file mode 100644 index 4199690..0000000 --- a/autofs-5.0.7-make-yellow-pages-support-optional.patch +++ /dev/null @@ -1,156 +0,0 @@ -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/autofs-5.0.7-misc-man-page-fixes.patch b/autofs-5.0.7-misc-man-page-fixes.patch deleted file mode 100644 index 3e2e1a8..0000000 --- a/autofs-5.0.7-misc-man-page-fixes.patch +++ /dev/null @@ -1,73 +0,0 @@ -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/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch b/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch deleted file mode 100644 index 4516bc5..0000000 --- a/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch +++ /dev/null @@ -1,39 +0,0 @@ -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/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch b/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch deleted file mode 100644 index 9b86306..0000000 --- a/autofs-5.0.7-probe-each-nfs-version-in-turn-for-singleton-mounts.patch +++ /dev/null @@ -1,104 +0,0 @@ -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/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch b/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch deleted file mode 100644 index c0ab30a..0000000 --- a/autofs-5.0.7-recheck-valid-map-entry-lookup-return-in-do_readmap_mount.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch b/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch deleted file mode 100644 index 111e460..0000000 --- a/autofs-5.0.7-remove-debug-only-code-in-alarm-c.patch +++ /dev/null @@ -1,36 +0,0 @@ -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/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch b/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch deleted file mode 100644 index 25b40aa..0000000 --- a/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch +++ /dev/null @@ -1,73 +0,0 @@ -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/autofs-5.0.7-update-kernel-include-files.patch b/autofs-5.0.7-update-kernel-include-files.patch deleted file mode 100644 index 3b6bb92..0000000 --- a/autofs-5.0.7-update-kernel-include-files.patch +++ /dev/null @@ -1,92 +0,0 @@ -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/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch b/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch deleted file mode 100644 index 113b0a0..0000000 --- a/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch +++ /dev/null @@ -1,471 +0,0 @@ -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/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch b/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch deleted file mode 100644 index 6574597..0000000 --- a/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch b/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch deleted file mode 100644 index 6a1a49e..0000000 --- a/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch +++ /dev/null @@ -1,149 +0,0 @@ -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/autofs.spec b/autofs.spec index ce28c07..773730c 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.8 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -161,6 +161,9 @@ fi %dir /etc/auto.master.d %changelog +* Mon Oct 21 2013 Ian Kent - 1:5.0.8-2 +- remove now unused patch files (bz1020242). + * Mon Oct 21 2013 Ian Kent - 1:5.0.8-1 - update to upstream version 5.0.8 (bz1020242).