X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fexportfs%2Fexportfs.c;h=fec2571934b0a04e263f81dfa58985cd74fd7d54;hp=99618c94ee0ed0040f29a32246b3af50d2824539;hb=ec16220910f0bf1bf2b8e1d50e78df7da11d8b1e;hpb=1374c3861abdc66f3a1410e26cc85f86760b51dd diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 99618c9..fec2571 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -12,6 +12,7 @@ #include #endif +#include #include #include #include @@ -388,6 +389,8 @@ validate_export(nfs_export *exp) */ struct stat stb; char *path = exp->m_export.e_path; + struct statfs64 stf; + int fs_has_fsid = 0; if (stat(path, &stb) < 0) { fprintf(stderr, "exportfs: Warning: %s does not exist\n", @@ -403,7 +406,12 @@ validate_export(nfs_export *exp) if (!can_test()) return; - if ((exp->m_export.e_flags & NFSEXP_FSID) || exp->m_export.e_uuid) { + if (!statfs64(path, &stf) && + (stf.f_fsid.__val[0] || stf.f_fsid.__val[1])) + fs_has_fsid = 1; + + if ((exp->m_export.e_flags & NFSEXP_FSID) || exp->m_export.e_uuid || + fs_has_fsid) { if ( !test_export(path, 1)) { fprintf(stderr, "exportfs: Warning: %s does not " "support NFS export.\n", @@ -515,6 +523,7 @@ dump(int verbose) break; #endif } + secinfo_show(stdout, ep); printf("%c\n", (c != '(')? ')' : ' '); } }