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

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