Blame SOURCES/autofs-5.1.2-fix-_strncmp-usage.patch

304803
autofs-5.1.2 - fix _strncmp() usage
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
A change to fix nfs mount options changed to using a custom strncmp()
304803
function.
304803
304803
While the usage of the function is correct in the nfs and bind mount
304803
modules it isn't correct in the autofs and ext2 mount modules.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG              |    1 +
304803
 modules/mount_autofs.c |   12 ++++++------
304803
 modules/mount_ext2.c   |    2 +-
304803
 3 files changed, 8 insertions(+), 7 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -221,6 +221,7 @@
304803
 - fix short memory allocation in lookup_amd_instance().
304803
 - fix count_mounts() function.
304803
 - fix argc off by one in mount_autofs.c.
304803
+- fix _strncmp() usage.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/mount_autofs.c
304803
+++ autofs-5.0.7/modules/mount_autofs.c
304803
@@ -121,17 +121,17 @@ int mount_mount(struct autofs_point *ap,
304803
 			while (*comma != '\0' && *comma != ',')
304803
 				comma++;
304803
 
304803
-			if (_strncmp(cp, "nobrowse", 8) == 0)
304803
+			if (_strncmp("nobrowse", cp, 8) == 0)
304803
 				ghost = 0;
304803
-			else if (_strncmp(cp, "nobind", 6) == 0)
304803
+			else if (_strncmp("nobind", cp, 6) == 0)
304803
 				nobind = 1;
304803
-			else if (_strncmp(cp, "browse", 6) == 0)
304803
+			else if (_strncmp("browse", cp, 6) == 0)
304803
 				ghost = 1;
304803
-			else if (_strncmp(cp, "symlink", 7) == 0)
304803
+			else if (_strncmp("symlink", cp, 7) == 0)
304803
 				symlnk = 1;
304803
-			else if (_strncmp(cp, "hosts", 5) == 0)
304803
+			else if (_strncmp("hosts", cp, 5) == 0)
304803
 				hosts = 1;
304803
-			else if (_strncmp(cp, "timeout=", 8) == 0) {
304803
+			else if (_strncmp("timeout=", cp, 8) == 0) {
304803
 				char *val = strchr(cp, '=');
304803
 				unsigned tout;
304803
 				if (val) {
304803
--- autofs-5.0.7.orig/modules/mount_ext2.c
304803
+++ autofs-5.0.7/modules/mount_ext2.c
304803
@@ -82,7 +82,7 @@ int mount_mount(struct autofs_point *ap,
304803
 
304803
 	if (options && options[0]) {
304803
 		for (p = options; (p1 = strchr(p, ',')); p = p1)
304803
-			if (!_strncmp(p, "ro", p1 - p) && ++p1 - p == sizeof("ro"))
304803
+			if (!_strncmp("ro", p, p1 - p) && ++p1 - p == sizeof("ro"))
304803
 				ro = 1;
304803
 		if (!strcmp(p, "ro"))
304803
 			ro = 1;