rpms/autofs/devel autofs-4.1.4-configureable-locking.patch, NONE, 1.1 autofs-4.1.4-locking-fix.patch, NONE, 1.1 autofs-4.1.4-multi-parse-fix.patch, NONE, 1.1 autofs-4.1.4-reentrant-syslog-copyright.patch, NONE, 1.1 autofs-4.1.4-sockopt-len-type.patch, NONE, 1.1 autofs-4.1.4-sol10-schema.patch, NONE, 1.1 autofs-4.1.4-yp_order-order-type.patch, NONE, 1.1 autofs.spec, 1.71, 1.72 autofs-4.1.4-check-is-multi.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Jan 19 12:39:35 UTC 2006


Author: ikent

Update of /cvs/dist/rpms/autofs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1144

Modified Files:
	autofs.spec 
Added Files:
	autofs-4.1.4-configureable-locking.patch 
	autofs-4.1.4-locking-fix.patch 
	autofs-4.1.4-multi-parse-fix.patch 
	autofs-4.1.4-reentrant-syslog-copyright.patch 
	autofs-4.1.4-sockopt-len-type.patch 
	autofs-4.1.4-sol10-schema.patch 
	autofs-4.1.4-yp_order-order-type.patch 
Removed Files:
	autofs-4.1.4-check-is-multi.patch 
Log Message:
* Mon Jan 17 2006 Ian Kent <ikent at redhat.com> - 1:4.1.4-16
- Replace check-is-multi with more general multi-parse-fix.
- Add fix for premature return when waiting for lock file.
- Update copyright declaration for reentrant-syslog source.
- Add patch for configure option to disable locking during mount.
  But don't disable locking by default.
- Add ability to handle automount schema used in Sun directory server.
- Quell compiler warning about getsockopt parameter.
- Quell compiler warning about yp_order parameter.


autofs-4.1.4-configureable-locking.patch:
 configure                            |   18 ++++++++++++++++++
 configure.in                         |   10 ++++++++++
 daemon/spawn.c                       |    2 ++
 include/automount.h                  |    8 ++++++--
 include/config.h.in                  |    2 ++
 patches/util-linux-2.12a-flock.patch |   26 ++++++++++++++++++++++++++
 patches/util-linux-2.12q-flock.patch |   25 +++++++++++++++++++++++++
 7 files changed, 89 insertions(+), 2 deletions(-)

--- NEW FILE autofs-4.1.4-configureable-locking.patch ---

This patch provides a configure option to disable the use of a lock
file when calling mount from autofs. It also adds a patch to the
"patches" directory that needs to be used for mount to (hopefuully)
prevent /etc/mtab corruption when rapidly mounting filesystems
when autofs does not use locking.

To disable the locking add the configure option --disable-mount-locking.

diff -Nurp autofs-4.1.4.orig/configure autofs-4.1.4/configure
--- autofs-4.1.4.orig/configure	2005-04-06 23:24:37.000000000 +0800
+++ autofs-4.1.4/configure	2005-10-23 11:33:44.000000000 +0800
@@ -842,6 +842,7 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --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
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -4308,6 +4309,23 @@ _ACEOF
 fi
 
 #
+# Disable use of locking when spawning mount command
+#
+# Check whether --enable-mount-locking or --disable-mount-locking was given.
+if test "${enable_mount_locking+set}" = set; then
+  enableval="$enable_mount_locking"
+
+else
+  enableval=yes
+fi;
+if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
+	cat >>confdefs.h <<\_ACEOF
+#define ENABLE_MOUNT_LOCKING 1
+_ACEOF
+
+fi
+
+#
 # Write Makefile.conf and include/config.h
 #
           ac_config_headers="$ac_config_headers include/config.h"
diff -Nurp autofs-4.1.4.orig/configure.in autofs-4.1.4/configure.in
--- autofs-4.1.4.orig/configure.in	2005-04-06 23:24:37.000000000 +0800
+++ autofs-4.1.4/configure.in	2005-10-23 11:33:35.000000000 +0800
@@ -167,6 +167,16 @@ if test x$enable_ext_env = xyes; then
 fi
 
 #
+# Disable use of locking when spawning mount command
+#
+AC_ARG_ENABLE(mount-locking,
+--disable-mount-locking          disable use of locking when spawning mount command,,
+	enableval=yes)
+if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
+	AC_DEFINE(ENABLE_MOUNT_LOCKING, 1)
+fi
+
+#
 # Write Makefile.conf and include/config.h
 #
 AC_CONFIG_HEADER(include/config.h)
diff -Nurp autofs-4.1.4.orig/daemon/spawn.c autofs-4.1.4/daemon/spawn.c
--- autofs-4.1.4.orig/daemon/spawn.c	2005-02-10 20:56:53.000000000 +0800
+++ autofs-4.1.4/daemon/spawn.c	2005-10-23 10:51:10.000000000 +0800
@@ -322,6 +322,7 @@ int spawnl(int logpri, const char *prog,
 	return do_spawn(logpri, 0, prog, (const char **) argv);
 }
 
+#ifdef ENABLE_MOUNT_LOCKING
 int spawnll(int logpri, const char *prog, ...)
 {
 	va_list arg;
@@ -342,3 +343,4 @@ int spawnll(int logpri, const char *prog
 
 	return do_spawn(logpri, 1, prog, (const char **) argv);
 }
+#endif
diff -Nurp autofs-4.1.4.orig/include/automount.h autofs-4.1.4/include/automount.h
--- autofs-4.1.4.orig/include/automount.h	2005-01-26 21:03:02.000000000 +0800
+++ autofs-4.1.4/include/automount.h	2005-10-23 10:51:10.000000000 +0800
@@ -121,9 +121,13 @@ extern struct autofs_point ap; 
 
 int aquire_lock(void);
 void release_lock(void);
-int spawnll(int logpri, const char *prog, ...);
 int spawnl(int logpri, const char *prog, ...);
-int spawnv(int logpri, const char *prog, const char *const *argv);
+#ifdef ENABLE_MOUNT_LOCKING
+int spawnll(int logpri, const char *prog, ...);
+#else
+#define spawnll	spawnl
+#endif
+int spawnv(int ogpri, const char *prog, const char *const *argv);
 void reset_signals(void);
 void ignore_signals(void);
 void discard_pending(int sig);
diff -Nurp autofs-4.1.4.orig/include/config.h.in autofs-4.1.4/include/config.h.in
--- autofs-4.1.4.orig/include/config.h.in	2004-02-03 23:23:21.000000000 +0800
+++ autofs-4.1.4/include/config.h.in	2005-10-23 10:51:10.000000000 +0800
@@ -25,3 +25,5 @@
 #undef HAVE_SLOPPY_MOUNT
 
 #undef ENABLE_EXT_ENV
+
+#undef ENABLE_MOUNT_LOCKING
diff -Nurp autofs-4.1.4.orig/patches/util-linux-2.12a-flock.patch autofs-4.1.4/patches/util-linux-2.12a-flock.patch
--- autofs-4.1.4.orig/patches/util-linux-2.12a-flock.patch	1970-01-01 08:00:00.000000000 +0800
+++ autofs-4.1.4/patches/util-linux-2.12a-flock.patch	2005-10-23 10:51:10.000000000 +0800
@@ -0,0 +1,30 @@
+--- util-linux-2.12a/mount/fstab.c.flock	2005-09-17 01:36:03.000000000 +0800
++++ util-linux-2.12a/mount/fstab.c	2005-09-17 01:41:12.000000000 +0800
+@@ -488,7 +488,7 @@ lock_mtab (void) {
+ 				}
+ 				/* proceed anyway */
+ 			}
+-			we_created_lockfile = 1;
++			we_created_lockfile = fd;
+ 		} else {
+ 			static int tries = 0;
+ 
+@@ -510,9 +510,8 @@ lock_mtab (void) {
+ 					     MOUNTED_LOCK);
+ 				sleep(1);
+ 			}
++			close(fd);
+ 		}
+-
+-		close(fd);
+ 	}
+ }
+ 
+@@ -520,6 +519,7 @@ lock_mtab (void) {
+ void
+ unlock_mtab (void) {
+ 	if (we_created_lockfile) {
++		close(we_created_lockfile);
+ 		unlink (MOUNTED_LOCK);
+ 		we_created_lockfile = 0;
+ 	}
diff -Nurp autofs-4.1.4.orig/patches/util-linux-2.12q-flock.patch autofs-4.1.4/patches/util-linux-2.12q-flock.patch
--- autofs-4.1.4.orig/patches/util-linux-2.12q-flock.patch	1970-01-01 08:00:00.000000000 +0800
+++ autofs-4.1.4/patches/util-linux-2.12q-flock.patch	2005-10-23 10:51:10.000000000 +0800
@@ -0,0 +1,29 @@
+--- util-linux-2.12q/mount/fstab.c.flock	2005-09-17 01:10:37.000000000 +0800
++++ util-linux-2.12q/mount/fstab.c	2005-09-17 01:16:51.000000000 +0800
+@@ -417,6 +417,7 @@
+ unlock_mtab (void) {
+ 	if (we_created_lockfile) {
+ 		unlink (MOUNTED_LOCK);
++		close(we_created_lock_file);
+ 		we_created_lockfile = 0;
+ 	}
+ }
+@@ -528,6 +529,7 @@
+ 				}
+ 				/* proceed anyway */
+ 			}
++			we_created_lock_file = fd;
+ 		} else {
+ 			static int tries = 0;
+ 
+@@ -549,9 +551,8 @@
+ 					     MOUNTED_LOCK);
+ 				sleep(1);
+ 			}
++			close(fd);
+ 		}
+-
+-		close(fd);
+ 	}
+ }
+ 

autofs-4.1.4-locking-fix.patch:
 daemon/spawn.c |   17 ++++++++++-------
 lib/lock.c     |    8 ++++----
 2 files changed, 14 insertions(+), 11 deletions(-)

--- NEW FILE autofs-4.1.4-locking-fix.patch ---

This patch fixes two things.

First, sloppy error handling when spawning a sub task.

Second, if the process receives a signal while waiting on the lock
file it will return a "timed out" error after only a little more
than a tenth of a second. This was due to the wait time variable
not being reset after each tenth of a second wait.

diff -Nurp autofs-4.1.4.orig/daemon/spawn.c autofs-4.1.4/daemon/spawn.c
--- autofs-4.1.4.orig/daemon/spawn.c	2005-02-10 20:56:53.000000000 +0800
+++ autofs-4.1.4/daemon/spawn.c	2005-11-01 18:36:35.000000000 +0800
@@ -214,14 +214,15 @@ static int do_spawn(int logpri, int use_
 	sigfillset(&allsignals);
 	sigprocmask(SIG_BLOCK, &allsignals, &oldsig);
 
-	if (pipe(pipefd))
+	if (pipe(pipefd)) {
+		if (use_lock)
+			release_lock();
+		sigprocmask(SIG_SETMASK, &oldsig, NULL);
 		return -1;
+	}
 
 	f = fork();
-	if (f < 0) {
-		sigprocmask(SIG_SETMASK, &oldsig, NULL);
-		return -1;
-	} else if (f == 0) {
+	if (f == 0) {
 		reset_signals();
 		close(pipefd[0]);
 		dup2(pipefd[1], STDOUT_FILENO);
@@ -243,6 +244,8 @@ static int do_spawn(int logpri, int use_
 
 		if (f < 0) {
 			close(pipefd[0]);
+			if (use_lock)
+				release_lock();
 			sigprocmask(SIG_SETMASK, &oldsig, NULL);
 			return -1;
 		}
@@ -287,11 +290,11 @@ static int do_spawn(int logpri, int use_
 		if (waitpid(f, &status, 0) != f)
 			status = -1;	/* waitpid() failed */
 
-		sigprocmask(SIG_SETMASK, &oldsig, NULL);
-
 		if (use_lock)
 			release_lock();
 
+		sigprocmask(SIG_SETMASK, &oldsig, NULL);
+
 		return status;
 	}
 }
diff -Nurp autofs-4.1.4.orig/lib/lock.c autofs-4.1.4/lib/lock.c
--- autofs-4.1.4.orig/lib/lock.c	2005-01-17 23:09:28.000000000 +0800
+++ autofs-4.1.4/lib/lock.c	2005-11-01 20:12:28.000000000 +0800
@@ -208,9 +208,6 @@ void release_lock(void)
  */
 static int wait_for_lockf(const char *lockf)
 {
-	struct timespec t = { 0, WAIT_INTERVAL };
-	struct timespec r;
-	int ts_size = sizeof(struct timespec);
 	int tries = WAIT_TRIES;
 	int status = 0;
 	struct stat st;
@@ -218,10 +215,13 @@ static int wait_for_lockf(const char *lo
 	while (tries-- && !status) {
 		status = stat(lockf, &st);
 		if (!status) {
+			struct timespec t = { 0, WAIT_INTERVAL };
+			struct timespec r;
+
 			while (nanosleep(&t, &r) == -1 && errno == EINTR) {
 				if (got_term)
 					return 0;
-				memcpy(&t, &r, ts_size);
+				memcpy(&t, &r, sizeof(struct timespec));
 			}
 		}
 	}

autofs-4.1.4-multi-parse-fix.patch:
 parse_sun.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

--- NEW FILE autofs-4.1.4-multi-parse-fix.patch ---
diff -Nurp autofs-4.1.4.orig/modules/parse_sun.c autofs-4.1.4/modules/parse_sun.c
--- autofs-4.1.4.orig/modules/parse_sun.c	2005-04-05 20:42:42.000000000 +0800
+++ autofs-4.1.4/modules/parse_sun.c	2005-04-25 10:00:13.000000000 +0800
@@ -766,7 +766,16 @@ static int check_is_multi(const char *ma
 {
 	const char *p = (char *) mapent;
 	int multi = 0;
-	int first_chunk = 0;
+	int not_first_chunk = 0;
+
+	if (!p) {
+		crit("check_is_multi: unexpected NULL map entry pointer");
+		return 0;
+	}
+	
+	/* If first character is "/" it's a multi-mount */
+	if (*p == '/')
+		return 1;
 
 	while (*p) {
 		p = skipspace(p);
@@ -779,7 +788,7 @@ static int check_is_multi(const char *ma
 		 * path that begins with '/' indicates a mutil-mount
 		 * entry.
 		 */
-		if (first_chunk) {
+		if (not_first_chunk) {
 			if (*p == '/' || *p == '-') {
 				multi = 1;
 				break;
@@ -796,7 +805,7 @@ static int check_is_multi(const char *ma
 		 * after which it's a multi mount.
 		 */
 		p += chunklen(p, check_colon(p));
-		first_chunk++;
+		not_first_chunk++;
 	}
 
 	return multi;
@@ -883,7 +892,12 @@ int parse_mount(const char *root, const 
 				return 1;
 			}
 
-			path = dequote(p, l = chunklen(p, 0));
+			if (*p != '/') {
+				l = 0;
+				path = dequote("/", 1);
+			} else
+				 path = dequote(p, l = chunklen(p, 0));
+
 			if (!path) {
 				error(MODPREFIX "out of memory");
 				free(myoptions);

autofs-4.1.4-reentrant-syslog-copyright.patch:
 COPYRIGHT |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletion(-)

--- NEW FILE autofs-4.1.4-reentrant-syslog-copyright.patch ---
--- autofs-4.1.4/COPYRIGHT.reentrant-syslog-copyright	2006-01-15 23:24:04.000000000 -0500
+++ autofs-4.1.4/COPYRIGHT	2006-01-15 23:24:46.000000000 -0500
@@ -14,4 +14,38 @@
    GNU General Public License for more details.
 
 Portions Copyright (C) 1999-2000 Jeremy Fitzhardinge
-Portions Copyright (C) 2001-2003 Ian Kent
+Portions Copyright (C) 2001-2005 Ian Kent
+
+The files lib/syslog.c and include/syslog.h are licenced under the
+BSD License and require that a copy of the notice ibelow be included in
+accompanying documentation and be distributed with binary distributions
+of the code, so be sure to include this file along with any binary
+distributions derived from this source package.
+
+Copyright (c) 1983, 1988, 1993
+     The Regents of the University of California.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the University nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+

autofs-4.1.4-sockopt-len-type.patch:
 lib/rpc_subs.c      |    3 ++-
 modules/mount_nfs.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

--- NEW FILE autofs-4.1.4-sockopt-len-type.patch ---
--- autofs-4.1.4/lib/rpc_subs.c.sockopt-len-type	2006-01-18 06:51:52.000000000 -0500
+++ autofs-4.1.4/lib/rpc_subs.c	2006-01-18 06:55:17.000000000 -0500
@@ -105,7 +105,8 @@
  */
 static int connect_nb(int fd, struct sockaddr_in *addr, struct timeval *tout)
 {
-	int flags, ret, len;
+	int flags, ret;
+	socklen_t len;
 	fd_set wset, rset;
 
 	flags = fcntl(fd, F_GETFL, 0);
--- autofs-4.1.4/modules/mount_nfs.c.sockopt-len-type	2006-01-18 06:51:03.000000000 -0500
+++ autofs-4.1.4/modules/mount_nfs.c	2006-01-18 06:54:30.000000000 -0500
@@ -71,7 +71,7 @@
 {
 	struct sockaddr_in src_addr, local_addr;
 	int src_len = sizeof(src_addr);
-	int local_len = sizeof(local_addr);
+	socklen_t local_len = sizeof(local_addr);
 	int sock, ret;
 
 	sock = socket(AF_INET, SOCK_DGRAM, udpproto);

autofs-4.1.4-sol10-schema.patch:
 modules/lookup_ldap.c             |   52 ++++++++++++++++++++++---------
 samples/autofs-ldap-auto-master.c |   62 ++++++++++++++++++++++----------------
 2 files changed, 73 insertions(+), 41 deletions(-)

--- NEW FILE autofs-4.1.4-sol10-schema.patch ---
--- autofs-4.1.4/modules/lookup_ldap.c.sol10-schema	2005-02-27 00:37:14.000000000 -0500
+++ autofs-4.1.4/modules/lookup_ldap.c	2006-01-16 21:39:59.000000000 -0500
@@ -201,6 +201,7 @@
 	char **values = NULL;
 	char *attrs[] = { key, type, NULL };
 	LDAP *ldap;
+	int found_entry = 0;
 
 	if (ctxt == NULL) {
 		crit(MODPREFIX "context was NULL");
@@ -267,6 +268,8 @@
 			continue;
 		}
 
+		found_entry = 1;
+
 		values = ldap_get_values(ldap, e, type);
 		if (!values) {
 			info(MODPREFIX "no %s defined for %s", type, query);
@@ -297,28 +300,42 @@
 	ldap_msgfree(result);
 	ldap_unbind(ldap);
 
-	return 1;
+	if (found_entry) 
+		return 1;
+	else
+		return 0;
 }
 
 static int read_map(const char *root, struct lookup_context *ctxt,
 		    const char *key, int keyvallen, time_t age, int *result_ldap)
 {
-	int rv1 = LDAP_SUCCESS, rv2 = LDAP_SUCCESS;
+	int rv = LDAP_SUCCESS;
 	int ret;
 
 	/* all else fails read entire map */
 	ret = read_one_map(root, "nisObject", "cn", 
-			  key, keyvallen, "nisMapEntry", ctxt, age, &rv1);
-	if (ret)
-		goto ret_ok;
+			  key, keyvallen, "nisMapEntry", ctxt, age, &rv);
+	if (ret) {
+		if (rv == LDAP_SUCCESS)
+			goto ret_ok;
+	}
 
 	ret = read_one_map(root, "automount", "cn", key, keyvallen, 
-			  "automountInformation", ctxt, age, &rv2);
-	if (ret)
-		goto ret_ok;
+			  "automountInformation", ctxt, age, &rv);
+	if (ret) {
+		if (rv == LDAP_SUCCESS)
+			goto ret_ok;
+	}
+
+	ret = read_one_map(root, "automount", "automountKey", key, keyvallen, 
+			  "automountInformation", ctxt, age, &rv);
+	if (ret) {
+		if (rv == LDAP_SUCCESS)
+			goto ret_ok;
+	}
 
 	if (result_ldap)
-		*result_ldap = (rv1 == LDAP_SUCCESS ? rv2 : rv1);
+		*result_ldap = rv;
 
 	return 0;
 
@@ -593,7 +610,7 @@
 int lookup_mount(const char *root, const char *name, int name_len, void *context)
 {
 	struct lookup_context *ctxt = (struct lookup_context *) context;
-	int ret, ret2;
+	int ret, ret2, ret3;
 	char key[KEY_MAX_LEN + 1];
 	int key_len;
 	char mapent[MAPENT_MAX_LEN + 1];
@@ -614,10 +631,12 @@
 	ret = lookup_one(root, key, "nisObject", "cn", "nisMapEntry", ctxt);
 	ret2 = lookup_one(root, key,
 			    "automount", "cn", "automountInformation", ctxt);
+	ret3 = lookup_one(root, key,
+			"automount", "automountKey", "automountInformation", ctxt);
 	
-   	debug("ret = %d, ret2 = %d", ret, ret2);
+   	debug("ret = %d, ret2 = %d ret3 = %d", ret, ret2, ret3);
 
-	if (!ret && !ret2)
+	if (!ret && !ret2 && ret3)
 		return 1;
 
 	me = cache_lookup_first();
@@ -625,10 +644,11 @@
 
 	if (t_last_read > ap.exp_runfreq) 
 		if ((ret & (CHE_MISSING | CHE_UPDATED)) && 
-		    (ret2 & (CHE_MISSING | CHE_UPDATED)))
+		    (ret2 & (CHE_MISSING | CHE_UPDATED)) &&
+		    (ret3 & (CHE_MISSING | CHE_UPDATED)))
 			need_hup = 1;
 
-	if (ret == CHE_MISSING && ret2 == CHE_MISSING) {
+	if (ret == CHE_MISSING && ret2 == CHE_MISSING && ret3 == CHE_MISSING) {
 		int wild = CHE_MISSING;
 
 		/* Maybe update wild card map entry */
@@ -637,10 +657,12 @@
 					  "cn", "nisMapEntry", ctxt);
 			ret2 = lookup_wild(root, "automount",
 					   "cn", "automountInformation", ctxt);
+			ret3 = lookup_wild(root, "automount", "automountKey",
+					   "automountInformation", ctxt);
 			wild = (ret & (CHE_MISSING | CHE_FAIL)) &&
 					(ret2 & (CHE_MISSING | CHE_FAIL));
 
-			if (ret & CHE_MISSING && ret2 & CHE_MISSING)
+			if (ret & CHE_MISSING && ret2 & CHE_MISSING && ret3 & CHE_MISSING)
 				cache_delete(root, "*", 0);
 		}
 
--- autofs-4.1.4/samples/autofs-ldap-auto-master.c.sol10-schema	2006-01-16 21:35:07.000000000 -0500
+++ autofs-4.1.4/samples/autofs-ldap-auto-master.c	2006-01-16 21:36:07.000000000 -0500
@@ -159,7 +159,7 @@
 {
 	LDAP *ld = NULL;
 	int result;
-	int c, mapset = 0;
+	int c, mapset = 0, default_schema = 1;
 	const char *map_key = MAPKEY, *entry_key = ENTRYKEY, *value = VALUE;
 	const char *map_oc = MAPOC, *entry_oc = ENTRYOC;
 	const char *map = MAP;
@@ -173,23 +173,27 @@
 				/* This is the object class we expect maps to
 				 * have.  The default is MAPOC. */
 				map_oc = optarg;
+				default_schema = 0;
 				break;
 			case 'e':
 				/* This is the object class we entries in the
 				 * map to be in.  The default is ENTRYOC. */
 				entry_oc = optarg;
+				default_schema = 0;
 				break;
 			case 'n':
 				/* This is the attribute which we use as the
 				 * key when looking up maps.  Usually we use
 				 * MAP_KEY. */
 				map_key = optarg;
+				default_schema = 0;
 				break;
 			case 'k':
 				/* This is the attribute which we use as the
 				 * key when looking up entries.  Usually we use
 				 * ENTRY_KEY. */
 				entry_key = optarg;
+				default_schema = 0;
 				break;
 			case 'v':
 				/* This is the attribute which we treat as
@@ -197,6 +201,7 @@
 				 * look up a map.  Usually this is the
 				 * VALUE attribute. */
 				value = optarg;
+				default_schema = 0;
 				break;
 			default:
 				fprintf(stderr, "syntax: %s\n"
@@ -245,31 +250,36 @@
 		return 2;
 	}
 
-	/* Try to dump the map given the preferred or user-supplied schema. */
-	if(!dump_map(ld, map, map_oc, entry_oc, map_key, entry_key, value) &&
-	   (mapset || !dump_map(ld, "auto_master", map_oc, entry_oc, map_key,
-		   entry_key, value))) { 
-		if(strcmp(map_oc, "automountMap") ||
-		   strcmp(entry_oc, "automount") ||
-		   strcmp(map_key, "ou") ||
-		   strcmp(entry_key, "cn") ||
-		   strcmp(value, "automountInformation")) {
-			if (!dump_map(ld,
-				 map,
-				 "automountMap",
-				 "automount",
-				 "ou",
-				 "cn",
-				 "automountInformation") && !mapset)
-				dump_map(ld,
-					"auto_master",
-					"automountMap",
-					"automount",
-					"ou",
-					"cn",
-					"automountInformation");
-		}
-	}
+	/* Try to dump the map given the preferred or user-supplied schema. 
+
+	   Behavior should be as follows:
+	   If the user specifies their own schema (ie. setting the map
+	   object class) we try to obtain a map for their settings and if they
+	   don't specify a map key, we also check 'auto_master' as the map key.
+	   If we don't find a map, then we return nothing.
+
+	   If the user doesn't specify their own schema, we try all known
+	   schemas with map names of 'auto.master' & 'auto_master', unless
+	   a map name has been specified on the command line.  If a map name
+	   is specified on the command line then we try all known schemas
+	   with that map name.
+	 */
+
+	if (dump_map(ld, map, map_oc, entry_oc, map_key,
+		     entry_key, value));
+	else if (!mapset && dump_map(ld, "auto_master", map_oc, entry_oc,
+				     map_key, entry_key, value)); 
+	else if (!default_schema);
+	else if (dump_map(ld, map, "automountMap","automount","ou",
+			  "cn","automountInformation"));
+	else if (!mapset && dump_map(ld, "auto_master", "automountMap",
+				     "automount","ou","cn",
+				     "automountInformation"));
+	else if (dump_map(ld, map, "automountMap","automount","automountMapName",
+			  "automountKey","automountInformation"));
+	else if (!mapset && dump_map(ld, "auto_master", "automountMap",
+				     "automount","automountMapName",
+				     "automountKey", "automountInformation"));
 
 	/* Close the connection to the server and quit. */
 	ldap_unbind(ld);

autofs-4.1.4-yp_order-order-type.patch:
 nsswitch.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE autofs-4.1.4-yp_order-order-type.patch ---
--- autofs-4.1.4/lib/nsswitch.c.yp_order-order-type	2006-01-17 05:53:25.000000000 -0500
+++ autofs-4.1.4/lib/nsswitch.c	2006-01-17 05:53:37.000000000 -0500
@@ -138,7 +138,7 @@
 {
 	int err;
 	char *domainname;
-	int order;
+	unsigned int order;
 
 	if ((err = yp_get_default_domain(&domainname)) != YPERR_SUCCESS) {
 		error (MODPREFIX "unable to get default yp domain");


Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/devel/autofs.spec,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- autofs.spec	9 Dec 2005 22:39:43 -0000	1.71
+++ autofs.spec	19 Jan 2006 12:39:22 -0000	1.72
@@ -4,29 +4,35 @@
 Summary: A tool for automatically mounting and unmounting filesystems.
 Name: autofs
 %define version 4.1.4
-%define release 14.1
+%define release 16
 Version: %{version}
-Release: %{release}.1
+Release: %{release}
 Epoch: 1
 License: GPL
 Group: System Environment/Daemons
 Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/v4/autofs-%{version}.tar.bz2
 Patch1: autofs-4.1.4-reentrant-syslog.patch
-Patch2: autofs-4.1.4-init-nsswitch-comment.patch
-Patch3: autofs-4.1.4-init-one-auto-master.patch
-Patch4: autofs-4.1.4-init-browse-as-non-first-option.patch
-Patch5: autofs-4.1.4-hesiod-bind.patch
-Patch6: autofs-4.1.4-non-replicated-ping.patch
-Patch7: autofs-4.1.4-check-nsswitch-submount.patch
-Patch8: autofs-4.1.3-alt-master-ldap.patch
-Patch9: autofs-4.1.4-check-is-multi.patch
-Patch10: autofs-4.1.4-cache-update-race-fix.patch
-Patch11: autofs-4.1.4-solaris-hosts-in-auto-master.patch
-Patch12: autofs-4.1.4-keylen-length-check.patch
-Patch13: autofs-4.1.4-sun-parse-fixes.patch
-Patch14: autofs-4.1.4-check-return-of-is-local-addr.patch
-Patch15: autofs-4.1.4-fix-sort-opts.patch
-Patch16: autofs-4.1.4-no-slash-misc.patch
+Patch2: autofs-4.1.4-reentrant-syslog-copyright.patch
+Patch3: autofs-4.1.4-init-nsswitch-comment.patch
+Patch4: autofs-4.1.4-init-one-auto-master.patch
+Patch5: autofs-4.1.4-init-browse-as-non-first-option.patch
+Patch6: autofs-4.1.4-hesiod-bind.patch
+Patch7: autofs-4.1.4-non-replicated-ping.patch
+Patch8: autofs-4.1.4-check-nsswitch-submount.patch
+Patch9: autofs-4.1.3-alt-master-ldap.patch
+Patch10: autofs-4.1.4-multi-parse-fix.patch
+Patch11: autofs-4.1.4-cache-update-race-fix.patch
+Patch12: autofs-4.1.4-solaris-hosts-in-auto-master.patch
+Patch13: autofs-4.1.4-keylen-length-check.patch
+Patch14: autofs-4.1.4-sun-parse-fixes.patch
+Patch15: autofs-4.1.4-check-return-of-is-local-addr.patch
+Patch16: autofs-4.1.4-fix-sort-opts.patch
+Patch17: autofs-4.1.4-no-slash-misc.patch
+Patch18: autofs-4.1.4-locking-fix.patch
+Patch19: autofs-4.1.4-configureable-locking.patch
+Patch20: autofs-4.1.4-sol10-schema.patch
+Patch21: autofs-4.1.4-sockopt-len-type.patch
+Patch22: autofs-4.1.4-yp_order-order-type.patch
 
 Buildroot: /var/tmp/autofs-tmp
 BuildPrereq: autoconf, hesiod-devel, openldap-devel, perl
@@ -82,6 +88,13 @@
 %patch14 -p1
 %patch15 -p1
 %patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -135,6 +148,16 @@
 %{_libdir}/autofs/*
 
 %changelog
+* Mon Jan 17 2006 Ian Kent <ikent at redhat.com> - 1:4.1.4-16
+- Replace check-is-multi with more general multi-parse-fix.
+- Add fix for premature return when waiting for lock file.
+- Update copyright declaration for reentrant-syslog source.
+- Add patch for configure option to disable locking during mount.
+  But don't disable locking by default.
+- Add ability to handle automount schema used in Sun directory server.
+- Quell compiler warning about getsockopt parameter.
+- Quell compiler warning about yp_order parameter.
+
 * Fri Dec 09 2005 Jesse Keating <jkeating at redhat.com>
 - rebuilt
 


--- autofs-4.1.4-check-is-multi.patch DELETED ---




More information about the fedora-cvs-commits mailing list