[PATCH 2/7] cifs.idmap: get rid of useless strcmp prior to idmapping

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

 



The code copies off the key description and then ensures that it's
prefixed with "cifs.idmap". What's the point of that?

Presumably request-key would never have called this otherwise. There's
little harm in going ahead and doing the idmapping if this is called
with the wrong string.

Also, the error handling here is wrong. If the prefix doesn't match
the code will exit 0 without doing any mapping. Just remove it.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 cifs.idmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cifs.idmap.c b/cifs.idmap.c
index 80802d7..bfef58b 100644
--- a/cifs.idmap.c
+++ b/cifs.idmap.c
@@ -225,8 +225,7 @@ int main(const int argc, char *const argv[])
 
 	syslog(LOG_DEBUG, "key description: %s", buf);
 
-	if ((strncmp(buf, "cifs.idmap", sizeof("cifs.idmap") - 1) == 0))
-		rc = cifs_idmap(key, buf);
+	rc = cifs_idmap(key, buf);
 out:
 	return rc;
 }
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux