]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/mountd.c
mountd: add IPv6 support in auth_authenticate()
[nfs-utils.git] / utils / mountd / mountd.c
index 6571454f6dd61e7fc22f929a3c61405456f1a71e..c8ea3f792ba87ea835738d29e5ca44b50840b6d5 100644 (file)
@@ -192,7 +192,8 @@ sig_hup (int sig)
 }
 
 bool_t
-mount_null_1_svc(struct svc_req *rqstp, void *argp, void *resp)
+mount_null_1_svc(struct svc_req *UNUSED(rqstp), void *UNUSED(argp), 
+       void *UNUSED(resp))
 {
        return 1;
 }
@@ -210,7 +211,7 @@ mount_mnt_1_svc(struct svc_req *rqstp, dirpath *path, fhstatus *res)
 }
 
 bool_t
-mount_dump_1_svc(struct svc_req *rqstp, void *argp, mountlist *res)
+mount_dump_1_svc(struct svc_req *rqstp, void *UNUSED(argp), mountlist *res)
 {
        struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
@@ -221,7 +222,7 @@ mount_dump_1_svc(struct svc_req *rqstp, void *argp, mountlist *res)
 }
 
 bool_t
-mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *resp)
+mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *UNUSED(resp))
 {
        struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
        nfs_export      *exp;
@@ -236,16 +237,17 @@ mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *resp)
                p = rpath;
        }
 
-       if (!(exp = auth_authenticate("unmount", sin, p))) {
+       exp = auth_authenticate("unmount", (struct sockaddr *)sin, p);
+       if (exp == NULL)
                return 1;
-       }
 
        mountlist_del(inet_ntoa(sin->sin_addr), p);
        return 1;
 }
 
 bool_t
-mount_umntall_1_svc(struct svc_req *rqstp, void *argp, void *resp)
+mount_umntall_1_svc(struct svc_req *rqstp, void *UNUSED(argp), 
+       void *UNUSED(resp))
 {
        /* Reload /etc/xtab if necessary */
        auth_reload();
@@ -255,7 +257,7 @@ mount_umntall_1_svc(struct svc_req *rqstp, void *argp, void *resp)
 }
 
 bool_t
-mount_export_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
+mount_export_1_svc(struct svc_req *rqstp, void *UNUSED(argp), exports *resp)
 {
        struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
@@ -266,7 +268,7 @@ mount_export_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
 }
 
 bool_t
-mount_exportall_1_svc(struct svc_req *rqstp, void *argp, exports *resp)
+mount_exportall_1_svc(struct svc_req *rqstp, void *UNUSED(argp), exports *resp)
 {
        struct sockaddr_in *addr = nfs_getrpccaller_in(rqstp->rq_xprt);
 
@@ -311,10 +313,10 @@ mount_pathconf_2_svc(struct svc_req *rqstp, dirpath *path, ppathcnf *res)
        }
 
        /* Now authenticate the intruder... */
-       exp = auth_authenticate("pathconf", sin, p);
-       if (!exp) {
+       exp = auth_authenticate("pathconf", (struct sockaddr *)sin, p);
+       if (exp == NULL)
                return 1;
-       else if (stat(p, &stb) < 0) {
+       else if (stat(p, &stb) < 0) {
                xlog(L_WARNING, "can't stat exported dir %s: %s",
                                p, strerror(errno));
                return 1;
@@ -413,8 +415,8 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, nfs_export **expret,
        }
 
        /* Now authenticate the intruder... */
-       exp = auth_authenticate("mount", sin, p);
-       if (!exp) {
+       exp = auth_authenticate("mount", (struct sockaddr *)sin, p);
+       if (exp == NULL) {
                *error = NFSERR_ACCES;
                return NULL;
        }
@@ -482,14 +484,13 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, nfs_export **expret,
                        xtab_append(exp);
 
                if (v3)
-                       fh = getfh_size ((struct sockaddr *) sin, p, 64);
+                       fh = getfh_size(sin, p, 64);
                if (!v3 || (fh == NULL && errno == EINVAL)) {
                        /* We first try the new nfs syscall. */
-                       fh = getfh ((struct sockaddr *) sin, p);
+                       fh = getfh(sin, p);
                        if (fh == NULL && errno == EINVAL)
                                /* Let's try the old one. */
-                               fh = getfh_old ((struct sockaddr *) sin,
-                                               stb.st_dev, stb.st_ino);
+                               fh = getfh_old(sin, stb.st_dev, stb.st_ino);
                }
                if (fh == NULL && !did_export) {
                        exp->m_exported = 0;