summaryrefslogtreecommitdiff
path: root/cifs.idmap.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2012-10-29 15:45:37 -0400
committerJeff Layton <jlayton@samba.org>2012-10-29 15:45:37 -0400
commit1a0523fbc469e34560bec0f06ce4622bb7db7b04 (patch)
tree276d50ba8530a3ea08df3589a1bcac255e32de32 /cifs.idmap.c
parent60bca663f94e27436ed1afe1e673a8afa3342e1d (diff)
downloadcifs-utils-1a0523fbc469e34560bec0f06ce4622bb7db7b04.tar.gz
cifs-utils-1a0523fbc469e34560bec0f06ce4622bb7db7b04.tar.bz2
cifs-utils-1a0523fbc469e34560bec0f06ce4622bb7db7b04.zip
cifs.idmap: get rid of useless strcmp prior to idmapping
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. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'cifs.idmap.c')
-rw-r--r--cifs.idmap.c3
1 files changed, 1 insertions, 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;
}