summaryrefslogtreecommitdiff
path: root/comms/plptools/patches/patch-ab
blob: 57c524326a9d91dc06a3df1a3724513596344f4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$NetBSD: patch-ab,v 1.3 2001/04/04 07:59:30 skrll Exp $

--- plpnfsd/mp_mount.c.orig	Mon Jan 17 11:49:41 2000
+++ plpnfsd/mp_mount.c
@@ -16,7 +16,7 @@
 #define PORTMAP			/* I need svcudp_create in rpc/svc_soc.h, sol 2.4 */
 #endif
 
-#include <OSdefs.h>
+#include "OSdefs.h"
 #include <stdio.h>
 #include <signal.h>
 #include <sys/stat.h>
@@ -59,6 +59,16 @@
 #endif
 #endif				/* __FreeBSD__ */
 
+#ifdef __NetBSD__
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <strings.h>
+#include <nfs/nfsmount.h>
+#endif /* __NetBSD__ */
+
 #include <rpc/rpc.h>
 #include "nfs_prot.h"
 
@@ -147,7 +157,7 @@
 	struct mntent *ent;
 #endif
 #endif
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
 	struct stat statb;
 #endif
 
@@ -229,7 +239,7 @@
 #else
 	struct nfs_args nfs_args;
 #endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 	int mount_flags;
 #endif
 
@@ -405,20 +415,23 @@
 #endif
 
 #ifdef __NetBSD__
+	nfs_args.version = NFS_ARGSVERSION;
 	nfs_args.addrlen = sizeof(sain);
 	nfs_args.sotype = SOCK_DGRAM;
 	nfs_args.maxgrouplist = NGROUPS;
 	nfs_args.readahead = 1;
 	nfs_args.addr = (struct sockaddr *) &sain;
 	nfs_args.fh = (void *) root_fh;
+	nfs_args.fhsize = sizeof(*root_fh);
 	nfs_args.wsize = PBUFSIZE;
 	nfs_args.rsize = PBUFSIZE;
 	nfs_args.retrans = 10;
 	nfs_args.timeo = 600;
 	nfs_args.hostname = PSIONHOSTNAME;
 	nfs_args.flags = NFSMNT_INT | NFSMNT_RETRANS | NFSMNT_TIMEO
-	    | NFSMNT_NOCONN | NFSMNT_DUMBTIMR | NFSMNT_MYWRITE
+	    | NFSMNT_NOCONN | NFSMNT_DUMBTIMR
 	    | NFSMNT_WSIZE | NFSMNT_RSIZE;
+	mount_flags = MNT_NOSUID | MNT_NODEV | MNT_NOEXEC | MNT_NOATIME;
 #endif
 
 #if defined(_IBMR2)
@@ -448,7 +461,7 @@
 #if defined(__sgi) || (defined(sun) && defined(__SVR4))
 			if (mount("", dir, MS_DATA, "nfs", &nfs_args, sizeof(nfs_args)))
 #endif
-#if defined(__NetBSD__) || defined(__NeXT__)
+#if defined(__NeXT__)
 			if (mount(MOUNT_NFS, dir, 0, (caddr_t) & nfs_args))
 #endif
 #ifdef hpux
@@ -464,7 +477,7 @@
 			if (aix3_mount("psion:loc", dir, 0, MOUNT_TYPE_NFS, &nfs_args, "plpnfsd"))
 #endif
 
-#ifdef __FreeBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 #if __FreeBSD_version >= 300001
 			if (mount("nfs", dir, mount_flags, &nfs_args))
 #else