allow mounting/exporting of NFS files (not just directories) for diskless

swap. thanks to <ws@TooLs.DE> and <roland@frob.com>
This commit is contained in:
deraadt 1994-01-06 13:51:55 +00:00
parent 2d1eff419c
commit 2ceb867c77
4 changed files with 16 additions and 14 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)exports.5 5.2 (Berkeley) 5/10/91
.\" $Id: exports.5,v 1.5 1993/09/09 16:34:33 ws Exp $
.\" $Id: exports.5,v 1.6 1994/01/06 13:51:55 deraadt Exp $
.\"
.Dd May 10, 1991
.Dt EXPORTS 5
@ -54,7 +54,7 @@ server specification; see
.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094" .
.Pp
Each line in the file specifies one remote mount point.
The first field is the mount point directory path followed
The first field is the mount point path (a directory or regular file) followed
optionally by export options and specific hosts separated by white space.
Only the first entry for a given local file system may specify the export
options, since these are handled on a

View File

@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mountd.c 5.14 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: mountd.c,v 1.9 1993/09/09 16:34:34 ws Exp $";
static char rcsid[] = "$Id: mountd.c,v 1.10 1994/01/06 13:52:00 deraadt Exp $";
#endif not lint
#include <sys/param.h>
@ -241,8 +241,8 @@ mntsrv(rqstp, transp)
}
/* Check to see if it's a valid dirpath */
if (stat(dirpath, &stb) < 0 || (stb.st_mode&S_IFMT) !=
S_IFDIR) {
if (stat(dirpath, &stb) < 0 ||
(!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode))) {
if (!svc_sendreply(transp, xdr_long, (caddr_t)&bad))
syslog(LOG_ERR, "Can't send reply");
return;
@ -516,10 +516,11 @@ get_exportlist()
*/
savedc = *endcp;
*endcp = '\0';
if (stat(cp, &sb) < 0 || (sb.st_mode & S_IFMT) != S_IFDIR) {
if (stat(cp, &sb) < 0 ||
(!S_ISDIR(sb.st_mode) && !S_ISREG(sb.st_mode))) {
syslog(LOG_ERR,
"Bad Exports File, %s: %s, mountd Failed",
cp, "Not a directory");
cp, "Not a directory or regular file");
exit(2);
}
fep = (struct exportlist *)0;

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)exports.5 5.2 (Berkeley) 5/10/91
.\" $Id: exports.5,v 1.5 1993/09/09 16:34:33 ws Exp $
.\" $Id: exports.5,v 1.6 1994/01/06 13:51:55 deraadt Exp $
.\"
.Dd May 10, 1991
.Dt EXPORTS 5
@ -54,7 +54,7 @@ server specification; see
.%T "Network File System Protocol Specification \\*(tNRFC\\*(sP 1094" .
.Pp
Each line in the file specifies one remote mount point.
The first field is the mount point directory path followed
The first field is the mount point path (a directory or regular file) followed
optionally by export options and specific hosts separated by white space.
Only the first entry for a given local file system may specify the export
options, since these are handled on a

View File

@ -42,7 +42,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)mountd.c 5.14 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: mountd.c,v 1.9 1993/09/09 16:34:34 ws Exp $";
static char rcsid[] = "$Id: mountd.c,v 1.10 1994/01/06 13:52:00 deraadt Exp $";
#endif not lint
#include <sys/param.h>
@ -241,8 +241,8 @@ mntsrv(rqstp, transp)
}
/* Check to see if it's a valid dirpath */
if (stat(dirpath, &stb) < 0 || (stb.st_mode&S_IFMT) !=
S_IFDIR) {
if (stat(dirpath, &stb) < 0 ||
(!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode))) {
if (!svc_sendreply(transp, xdr_long, (caddr_t)&bad))
syslog(LOG_ERR, "Can't send reply");
return;
@ -516,10 +516,11 @@ get_exportlist()
*/
savedc = *endcp;
*endcp = '\0';
if (stat(cp, &sb) < 0 || (sb.st_mode & S_IFMT) != S_IFDIR) {
if (stat(cp, &sb) < 0 ||
(!S_ISDIR(sb.st_mode) && !S_ISREG(sb.st_mode))) {
syslog(LOG_ERR,
"Bad Exports File, %s: %s, mountd Failed",
cp, "Not a directory");
cp, "Not a directory or regular file");
exit(2);
}
fep = (struct exportlist *)0;