rpms/autofs/FC-4 autofs-4.1.4-get_best_mount-white-space.patch, NONE, 1.1 autofs.spec, 1.68, 1.69

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue May 30 04:03:23 UTC 2006


Author: ikent

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

Modified Files:
	autofs.spec 
Added Files:
	autofs-4.1.4-get_best_mount-white-space.patch 
Log Message:
* Tue May 30 2006 Ian Kent <ikent at redhat.com> - 1:4.1.4-23
- add patch to fix white space handling in get_best_mount
  function (bz #163999).


autofs-4.1.4-get_best_mount-white-space.patch:
 mount_nfs.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

--- NEW FILE autofs-4.1.4-get_best_mount-white-space.patch ---
--- autofs-4.1.4/modules/mount_nfs.c.get_best_mount-white-space	2006-05-29 23:45:57.000000000 -0400
+++ autofs-4.1.4/modules/mount_nfs.c	2006-05-29 23:48:09.000000000 -0400
@@ -187,9 +187,11 @@
 	 *  do anything except strip whitespace from the end of the string.
 	 */
 	if (!strchr(p, ',') && (strchr(p,':') == strrchr(p,':'))) {
-		for (pstrip = p+strlen(p) - 1; pstrip >= p; pstrip--) 
-			if (isspace(*pstrip))
-				*pstrip = '\0';
+		for (pstrip = p+strlen(p) - 1; pstrip >= p; pstrip--) {
+			if (!isspace(*pstrip))
+				break;
+			*pstrip = '\0';
+		}
 
 		/* Check if the host is the localhost */
 		if (is_local_mount(p) > 0) {
@@ -241,7 +243,18 @@
 
 		if (*delim == ':') {
 			*delim = '\0';
-			next = strpbrk(delim + 1, " \t");
+			next = delim + 1;
+
+			/* Oh boy - might have spaces in the path */
+			while (*next && *next != ':')
+				next++;
+
+			/* No spaces in host names at least */
+			if (*next == ':') {
+				while (*next &&
+				      (*next != ' ' || *next != '\t'))
+					next--;
+			}
 		} else if (*delim != '\0') {
 			*delim = '\0';
 			next = delim + 1;


Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/FC-4/autofs.spec,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- autofs.spec	4 May 2006 03:11:06 -0000	1.68
+++ autofs.spec	30 May 2006 04:03:18 -0000	1.69
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems.
 Name: autofs
 %define version 4.1.4
-%define release 21
+%define release 23
 Version: %{version}
 Release: %{release}
 Epoch: 1
@@ -38,6 +38,7 @@
 Patch25: autofs-4.1.3-ldap-auto-master.patch
 Patch26: autofs-4.1.4-auto_net-escape-hash.patch
 Patch27: autofs-4.1.4-auto.smb-cifs.patch
+Patch28: autofs-4.1.4-get_best_mount-white-space.patch
 
 Buildroot: /var/tmp/autofs-tmp
 BuildPrereq: autoconf, hesiod-devel, openldap-devel, perl
@@ -104,6 +105,7 @@
 %patch25 -p1
 %patch26 -p1
 %patch27 -p1
+%patch28 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -157,6 +159,10 @@
 %{_libdir}/autofs/*
 
 %changelog
+* Tue May 30 2006 Ian Kent <ikent at redhat.com> - 1:4.1.4-23
+- add patch to fix white space handling in get_best_mount
+  function (bz #163999).
+
 * Thu May 4 2006 Ian Kent <ikent at redhat.com> - 1:4.1.4-21
 - add patch to use "cifs" instead of smbfs and escape speces
   in share names (bz #163999, #187732).




More information about the fedora-cvs-commits mailing list