Blame SOURCES/autofs-5.1.7-rename-path-to-m_offset-in-update_offset_entry.patch

49b67f
autofs-5.1.7 - rename path to m_offset in update_offset_entry()
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
Rename local variable from path to m_offset in update_offset_entry() to
49b67f
make the meaning of this variable clear.
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG           |    1 +
49b67f
 modules/parse_sun.c |   46 +++++++++++++++++++++++-----------------------
49b67f
 2 files changed, 24 insertions(+), 23 deletions(-)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -24,6 +24,7 @@
49b67f
 - don't add offset mounts to mounted mounts table.
49b67f
 - reduce umount EBUSY check delay.
49b67f
 - cleanup cache_delete() a little.
49b67f
+- rename path to m_offset in update_offset_entry().
49b67f
 
49b67f
 xx/xx/2018 autofs-5.1.5
49b67f
 - fix flag file permission.
49b67f
--- autofs-5.1.4.orig/modules/parse_sun.c
49b67f
+++ autofs-5.1.4/modules/parse_sun.c
49b67f
@@ -798,36 +798,36 @@ static int
49b67f
 update_offset_entry(struct autofs_point *ap,
49b67f
 		    struct mapent_cache *mc, const char *name,
49b67f
 		    const char *m_root, int m_root_len,
49b67f
-		    const char *path, const char *myoptions,
49b67f
+		    const char *m_offset, const char *myoptions,
49b67f
 		    const char *loc, time_t age)
49b67f
 {
49b67f
 	char m_key[PATH_MAX + 1];
49b67f
 	char m_mapent[MAPENT_MAX_LEN + 1];
49b67f
-	int p_len, m_key_len, m_options_len, m_mapent_len;
49b67f
+	int o_len, m_key_len, m_options_len, m_mapent_len;
49b67f
 	int ret;
49b67f
 
49b67f
 	memset(m_mapent, 0, MAPENT_MAX_LEN + 1);
49b67f
 
49b67f
 	/* Internal hosts map may have loc == NULL */
49b67f
-	if (!*path) {
49b67f
+	if (!*m_offset) {
49b67f
 		error(ap->logopt,
49b67f
-		      MODPREFIX "syntax error in offset %s -> %s", path, loc);
49b67f
+		      MODPREFIX "syntax error in offset %s -> %s", m_offset, loc);
49b67f
 		return CHE_FAIL;
49b67f
 	}
49b67f
 
49b67f
-	p_len = strlen(path);
49b67f
+	o_len = strlen(m_offset);
49b67f
 	/* Trailing '/' causes us pain */
49b67f
-	if (p_len > 1) {
49b67f
-		while (p_len > 1 && path[p_len - 1] == '/')
49b67f
-			p_len--;
49b67f
+	if (o_len > 1) {
49b67f
+		while (o_len > 1 && m_offset[o_len - 1] == '/')
49b67f
+			o_len--;
49b67f
 	}
49b67f
-	m_key_len = m_root_len + p_len;
49b67f
+	m_key_len = m_root_len + o_len;
49b67f
 	if (m_key_len > PATH_MAX) {
49b67f
 		error(ap->logopt, MODPREFIX "multi mount key too long");
49b67f
 		return CHE_FAIL;
49b67f
 	}
49b67f
 	strcpy(m_key, m_root);
49b67f
-	strncat(m_key, path, p_len);
49b67f
+	strncat(m_key, m_offset, o_len);
49b67f
 	m_key[m_key_len] = '\0';
49b67f
 
49b67f
 	m_options_len = 0;
49b67f
@@ -862,15 +862,15 @@ update_offset_entry(struct autofs_point
49b67f
 
49b67f
 	if (ret == CHE_DUPLICATE) {
49b67f
 		warn(ap->logopt, MODPREFIX
49b67f
-		     "syntax error or duplicate offset %s -> %s", path, loc);
49b67f
+		     "syntax error or duplicate offset %s -> %s", m_offset, loc);
49b67f
 		ret = CHE_OK;
49b67f
 	} else if (ret == CHE_FAIL)
49b67f
 		debug(ap->logopt, MODPREFIX
49b67f
-		      "failed to update multi-mount offset %s -> %s", path, m_mapent);
49b67f
+		      "failed to update multi-mount offset %s -> %s", m_offset, m_mapent);
49b67f
 	else {
49b67f
 		ret = CHE_OK;
49b67f
 		debug(ap->logopt, MODPREFIX
49b67f
-		      "updated multi-mount offset %s -> %s", path, m_mapent);
49b67f
+		      "updated multi-mount offset %s -> %s", m_offset, m_mapent);
49b67f
 	}
49b67f
 
49b67f
 	return ret;
49b67f
@@ -1540,22 +1540,22 @@ dont_expand:
49b67f
 
49b67f
 		/* It's a multi-mount; deal with it */
49b67f
 		do {
49b67f
-			char *path, *myoptions, *loc;
49b67f
+			char *m_offset, *myoptions, *loc;
49b67f
 			int status;
49b67f
 
49b67f
 			if ((*p == '"' && *(p + 1) != '/') || (*p != '"' && *p != '/')) {
49b67f
 				l = 0;
49b67f
-				path = dequote("/", 1, ap->logopt);
49b67f
+				m_offset = dequote("/", 1, ap->logopt);
49b67f
 				debug(ap->logopt,
49b67f
-				      MODPREFIX "dequote(\"/\") -> %s", path);
49b67f
+				      MODPREFIX "dequote(\"/\") -> %s", m_offset);
49b67f
 			} else {
49b67f
 				l = span_space(p, mapent_len - (p - pmapent));
49b67f
-				path = sanitize_path(p, l, LKP_MULTI, ap->logopt);
49b67f
+				m_offset = sanitize_path(p, l, LKP_MULTI, ap->logopt);
49b67f
 				debug(ap->logopt, MODPREFIX
49b67f
-				      "dequote(\"%.*s\") -> %s", l, p, path);
49b67f
+				      "dequote(\"%.*s\") -> %s", l, p, m_offset);
49b67f
 			}
49b67f
 
49b67f
-			if (!path) {
49b67f
+			if (!m_offset) {
49b67f
 				warn(ap->logopt, MODPREFIX "null path or out of memory");
49b67f
 				cache_writelock(mc);
49b67f
 				cache_delete_offset_list(mc, name);
49b67f
@@ -1577,7 +1577,7 @@ dont_expand:
49b67f
 				cache_writelock(mc);
49b67f
 				cache_delete_offset_list(mc, name);
49b67f
 				cache_unlock(mc);
49b67f
-				free(path);
49b67f
+				free(m_offset);
49b67f
 				free(options);
49b67f
 				free(pmapent);
49b67f
 				pthread_setcancelstate(cur_state, NULL);
49b67f
@@ -1589,14 +1589,14 @@ dont_expand:
49b67f
 
49b67f
 			status = update_offset_entry(ap, mc,
49b67f
 						     name, m_root, m_root_len,
49b67f
-						     path, myoptions, loc, age);
49b67f
+						     m_offset, myoptions, loc, age);
49b67f
 
49b67f
 			if (status != CHE_OK) {
49b67f
 				warn(ap->logopt, MODPREFIX "error adding multi-mount");
49b67f
 				cache_writelock(mc);
49b67f
 				cache_delete_offset_list(mc, name);
49b67f
 				cache_unlock(mc);
49b67f
-				free(path);
49b67f
+				free(m_offset);
49b67f
 				free(options);
49b67f
 				free(pmapent);
49b67f
 				free(myoptions);
49b67f
@@ -1608,7 +1608,7 @@ dont_expand:
49b67f
 
49b67f
 			if (loc)
49b67f
 				free(loc);
49b67f
-			free(path);
49b67f
+			free(m_offset);
49b67f
 			free(myoptions);
49b67f
 		} while (*p == '/' || (*p == '"' && *(p + 1) == '/'));
49b67f