X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fmountd.c;h=c8ea3f792ba87ea835738d29e5ca44b50840b6d5;hp=dc84404aa1e81ad18d03cf811bacaa439a5dd840;hb=f35762f959cc5f29ad7817f8b7968e3792132651;hpb=1e472b3476cc6d7b95573b7d630d0fc51bebadf3 diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index dc84404..c8ea3f7 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -237,9 +237,9 @@ mount_umnt_1_svc(struct svc_req *rqstp, dirpath *argp, void *UNUSED(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; @@ -313,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; @@ -415,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; } @@ -484,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;