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

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