summaryrefslogtreecommitdiff
path: root/usr.sbin/mountd
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2006-07-13 12:00:24 +0000
committermartin <martin@NetBSD.org>2006-07-13 12:00:24 +0000
commita3b5baed423d95ab5b15e0ec830c86c3dbc950d5 (patch)
tree61370eb80dffa6ac6d8ad15f1b45c376fd607b73 /usr.sbin/mountd
parent70e8425daf410aa99bbde6ffd961c83ac9934e72 (diff)
Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ, version the getfh(2) syscall and explicitly pass the size available in the filehandle from userland. Discussed on tech-kern, with lots of help from yamt (thanks!).
Diffstat (limited to 'usr.sbin/mountd')
-rw-r--r--usr.sbin/mountd/mountd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index eaee436b251..15048ebe0d7 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mountd.c,v 1.106 2006/05/25 00:37:03 christos Exp $ */
+/* $NetBSD: mountd.c,v 1.107 2006/07/13 12:00:26 martin Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: mountd.c,v 1.106 2006/05/25 00:37:03 christos Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.107 2006/07/13 12:00:26 martin Exp $");
#endif
#endif /* not lint */
@@ -508,6 +508,7 @@ mntsrv(rqstp, transp)
sigset_t sighup_mask;
struct sockaddr_in6 *sin6;
struct sockaddr_in *sin;
+ size_t fh_size;
(void)sigemptyset(&sighup_mask);
(void)sigaddset(&sighup_mask, SIGHUP);
@@ -593,7 +594,8 @@ mntsrv(rqstp, transp)
fhr.fhr_vers = rqstp->rq_vers;
/* Get the file handle */
(void)memset(&fhr.fhr_fh, 0, sizeof(nfsfh_t));
- if (getfh(dirpath, (fhandle_t *) &fhr.fhr_fh) < 0) {
+ fh_size = sizeof(nfsfh_t);
+ if (getfh(dirpath, (fhandle_t *) &fhr.fhr_fh, &fh_size) < 0) {
bad = errno;
syslog(LOG_ERR, "Can't get fh for %s", dirpath);
if (!svc_sendreply(transp, xdr_long,