diff options
author | Steve Dickson <steved@redhat.com> | 2013-03-23 10:30:17 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2013-03-25 10:09:11 -0400 |
commit | ebe2826ca571a3959c3b5c8e29686c621f2775cf (patch) | |
tree | 3c976523587b18a95a4297ef14b9978f6a76f475 /utils | |
parent | 11ba3b1e01b67b7d19f26fba94fabdb60878e809 (diff) | |
download | nfs-utils-ebe2826ca571a3959c3b5c8e29686c621f2775cf.tar.gz nfs-utils-ebe2826ca571a3959c3b5c8e29686c621f2775cf.tar.xz nfs-utils-ebe2826ca571a3959c3b5c8e29686c621f2775cf.zip |
mountd: regression in crossmounts
commit 8e2fb3fc cause a regression in mount export
that are on different local file system.
Exports like (all on different filesystems)
/home *(rw,fsid=0,crossmnt)
/home/fs1 *(rw,crossmnt)
/home/fs1/fs2/fs3 *(rw,nohide)
and then a mount of the root 'mount /home /mnt'
would end up mounting /home/fs1/fs2/fs3 not /home
Reverting the logic of commit 8e2fb3fc until
a better solution can be found for the original
problem.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/mountd/cache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index c8aa46f..978698d 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -371,8 +371,11 @@ export_matches(nfs_export *exp, char *dom, char *path, struct addrinfo *ai) static bool subexport(struct exportent *e1, struct exportent *e2) { char *p1 = e1->e_path, *p2 = e2->e_path; + size_t l2 = strlen(p2); + return e2->e_flags & NFSEXP_CROSSMOUNT - && is_subdirectory(p1, p2); + && strncmp(p1, p2, l2) == 0 + && p1[l2] == '/'; } struct parsed_fsid { |