[PATCH 20/37] autofs-5.1.2 - fix _strncmp() usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A change to fix nfs mount options changed to using a custom strncmp()
function.

While the usage of the function is correct in the nfs and bind mount
modules it isn't correct in the autofs and ext2 mount modules.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG              |    1 +
 modules/mount_autofs.c |   12 ++++++------
 modules/mount_ext2.c   |    2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f46428c..940c6ba 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -17,6 +17,7 @@ xx/xx/2016 autofs-5.1.3
 - configure: add cache variable for Linux proc filesystem check.
 - Avoid local variable name shadowing another.
 - fix argc off by one in mount_autofs.c.
+- fix _strncmp() usage.
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c
index 65c0a06..0476a09 100644
--- a/modules/mount_autofs.c
+++ b/modules/mount_autofs.c
@@ -121,17 +121,17 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name,
 			while (*comma != '\0' && *comma != ',')
 				comma++;
 
-			if (_strncmp(cp, "nobrowse", 8) == 0)
+			if (_strncmp("nobrowse", cp, 8) == 0)
 				ghost = 0;
-			else if (_strncmp(cp, "nobind", 6) == 0)
+			else if (_strncmp("nobind", cp, 6) == 0)
 				nobind = 1;
-			else if (_strncmp(cp, "browse", 6) == 0)
+			else if (_strncmp("browse", cp, 6) == 0)
 				ghost = 1;
-			else if (_strncmp(cp, "symlink", 7) == 0)
+			else if (_strncmp("symlink", cp, 7) == 0)
 				symlnk = 1;
-			else if (_strncmp(cp, "hosts", 5) == 0)
+			else if (_strncmp("hosts", cp, 5) == 0)
 				hosts = 1;
-			else if (_strncmp(cp, "timeout=", 8) == 0) {
+			else if (_strncmp("timeout=", cp, 8) == 0) {
 				char *val = strchr(cp, '=');
 				unsigned tout;
 				if (val) {
diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c
index c00e3d5..90fc087 100644
--- a/modules/mount_ext2.c
+++ b/modules/mount_ext2.c
@@ -82,7 +82,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
 
 	if (options && options[0]) {
 		for (p = options; (p1 = strchr(p, ',')); p = p1)
-			if (!_strncmp(p, "ro", p1 - p) && ++p1 - p == sizeof("ro"))
+			if (!_strncmp("ro", p, p1 - p) && ++p1 - p == sizeof("ro"))
 				ro = 1;
 		if (!strcmp(p, "ro"))
 			ro = 1;

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux