diff options
author | NeilBrown <neilb@suse.de> | 2012-12-17 16:21:15 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2012-12-17 16:33:17 -0500 |
commit | 8e2fb3fc8e46e61eeba7978a03c9fb50ff01b666 (patch) | |
tree | 971cc1099bc6876e780b2598114ea55cdb9a9543 /utils/gssd/gssd_main_loop.c | |
parent | ffe1b3f8483c96e85409e5ea5ed69ab98128a3a1 (diff) | |
download | nfs-utils-8e2fb3fc8e46e61eeba7978a03c9fb50ff01b666.tar.gz nfs-utils-8e2fb3fc8e46e61eeba7978a03c9fb50ff01b666.tar.xz nfs-utils-8e2fb3fc8e46e61eeba7978a03c9fb50ff01b666.zip |
mountd: fix is_subdirectory to understand '/'
The is_subdirectory() function checks if a given 'child' is a
subdirectory of the given 'parent'. However it always fails
if 'parent' == "/" (because 'child' doesn't begin with 'parent'
followed by "/").
So change is_subdirectory() to special-case "/".
subexport() also tests if one directory is a subdirectory of the
other, and contains the same bug. So change it to use
is_subdirectory().
Finally, move is_subdirectory() and related path_matches() and
export_matches() earlier in the file to avoid a forward-reference.
This patch fixes a bug wherein if you export "/" with 'crossmnt', the
crossmnt flag is ineffective and you can only access the root
filesystem, not any descendants.
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/gssd_main_loop.c')
0 files changed, 0 insertions, 0 deletions