]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/mountd.c
exports: hide pseudo exports from clients
[nfs-utils.git] / utils / mountd / mountd.c
index b59f939ee71154e2bd1ec3535c4d7987ea26e1db..179ef17aa53ca76375d7ff775d92c3d31b926217 100644 (file)
@@ -359,6 +359,11 @@ static void set_authflavors(struct mountres3_ok *ok, nfs_export *exp)
                flavors[i] = s->flav->fnum;
                i++;
        }
+       if (i == 0) {
+               /* default when there is no sec= option: */
+               i = 1;
+               flavors[0] = AUTH_UNIX;
+       }
        ok->auth_flavors.auth_flavors_val = flavors;
        ok->auth_flavors.auth_flavors_len = i;
 }
@@ -535,6 +540,10 @@ get_exportlist(void)
 
        for (i = 0; i < MCL_MAXTYPES; i++) {
                for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
+                        /* Don't show pseudo exports */
+                       if (exp->m_export.e_flags & NFSEXP_V4ROOT)
+                               continue;
+
                        for (e = elist; e != NULL; e = e->ex_next) {
                                if (!strcmp(exp->m_export.e_path, e->ex_dir))
                                        break;