]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: fix path comparison for v4 crossmnt
authorJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 8 Mar 2010 19:59:01 +0000 (14:59 -0500)
committerSteve Dickson <steved@redhat.com>
Mon, 8 Mar 2010 19:59:01 +0000 (14:59 -0500)
This was obviously wrong, since path[strlen(path)] == '\0'
should always be true.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/cache.c

index b6c148f3a85aa534b49091c51e42946164fdfc79..45397db66dcd8c66d36aad9f6608456ab16cf1de 100644 (file)
@@ -619,7 +619,7 @@ static int is_subdirectory(char *subpath, char *path)
        int l = strlen(path);
 
        return strcmp(subpath, path) == 0
-               || (strncmp(subpath, path, l) == 0 && path[l] == '/');
+               || (strncmp(subpath, path, l) == 0 && subpath[l] == '/');
 }
 
 static int path_matches(nfs_export *exp, char *path)