]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/mountd.c
Support sec= option to specify export security
[nfs-utils.git] / utils / mountd / mountd.c
index fc9a73cd07a4f8aaa44288900fb3e68f33fd2b71..999f035d9a0227426f3bd112fda3df6fda416321 100644 (file)
@@ -29,7 +29,7 @@
 
 extern void    cache_open(void);
 extern struct nfs_fh_len *cache_get_filehandle(nfs_export *exp, int len, char *p);
-extern int cache_export(nfs_export *exp);
+extern int cache_export(nfs_export *exp, char *path);
 
 extern void my_svc_run(void);
 
@@ -399,7 +399,7 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3)
                     p, strerror(errno));
                *error = NFSERR_NOENT;
        } else if (estb.st_dev != stb.st_dev
-                  /* && (!new_cache || !(exp->m_export.e_flags & NFSEXP_CROSSMOUNT)) */
+                  && (!new_cache || !(exp->m_export.e_flags & NFSEXP_CROSSMOUNT))
                ) {
                xlog(L_WARNING, "request to export directory %s below nearest filesystem %s",
                     p, exp->m_export.e_path);
@@ -418,7 +418,7 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3)
                 */
                struct nfs_fh_len  *fh;
 
-               if (cache_export(exp)) {
+               if (cache_export(exp, p)) {
                        *error = NFSERR_ACCES;
                        return NULL;
                }
@@ -465,18 +465,18 @@ static exports
 get_exportlist(void)
 {
        static exports          elist = NULL;
-       static time_t           etime = 0;
-       time_t                  atime;
        struct exportnode       *e, *ne;
        struct groupnode        *g, *ng, *c, **cp;
        nfs_export              *exp;
        int                     i;
+       static unsigned int     ecounter;
+       unsigned int            acounter;
 
-       atime = auth_reload();
-       if (elist && atime == etime)
+       acounter = auth_reload();
+       if (elist && acounter == ecounter)
                return elist;
 
-       etime = atime;
+       ecounter = acounter;
 
        for (e = elist; e != NULL; e = ne) {
                ne = e->ex_next;