1 $NetBSD: patch-ab,v 1.6 2006/02/02 15:03:19 joerg Exp $
3 --- plpnfsd/mp_mount.c.orig 2002-07-12 14:45:41.000000000 +0000
5 @@ -21,7 +21,7 @@ extern int inet_addr(char *);
6 #define PORTMAP /* I need svcudp_create in rpc/svc_soc.h, sol 2.4 */
14 @@ -31,7 +31,7 @@ extern int inet_addr(char *);
18 -#if defined(__NetBSD__) || defined(__FreeBSD__)
19 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
20 #include <sys/param.h> /* Needs NGROUPS for mount.h */
21 #define umount(dir) unmount(dir, 1)
23 @@ -47,22 +47,33 @@ extern int inet_addr(char *);
24 static char nfshost[128];
28 +#if defined(__FreeBSD__) || defined(__DragonFly__)
30 #endif /* __FreeBSD__ */
31 #include <sys/mount.h>
34 +#if defined(__FreeBSD__) || defined(__DragonFly__)
35 #include <sys/socket.h>
36 #include <netinet/in.h>
37 #include <arpa/inet.h>
39 #include <nfs/rpcv2.h>
40 -#if __FreeBSD_version >= 300001
41 +#if defined(__DragonFly__) || __FreeBSD_version >= 300001
44 #endif /* __FreeBSD__ */
47 +#include <sys/socket.h>
48 +#include <netinet/in.h>
49 +#include <arpa/inet.h>
50 +#include <sys/types.h>
54 +#include <nfs/nfsmount.h>
55 +#endif /* __NetBSD__ */
60 @@ -156,7 +167,7 @@ static void doexit() {
65 +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
69 @@ -277,7 +288,7 @@ mount_and_run(char *dir, void (*proc)(),
71 struct nfs_args nfs_args;
74 +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
78 @@ -427,8 +438,8 @@ mount_and_run(char *dir, void (*proc)(),
79 NFSMNT_RETRANS | NFSMNT_TIMEO | NFSMNT_WSIZE | NFSMNT_RSIZE;
83 -#if __FreeBSD_version >= 300001
84 +#if defined(__FreeBSD__) || defined(__DragonFly__)
85 +#if defined(__DragonFly__) || __FreeBSD_version >= 300001
86 nfs_args.version = NFS_ARGSVERSION;
88 nfs_args.addr = (struct sockaddr *) &sain;
89 @@ -453,20 +464,23 @@ mount_and_run(char *dir, void (*proc)(),
93 + nfs_args.version = NFS_ARGSVERSION;
94 nfs_args.addrlen = sizeof(sain);
95 nfs_args.sotype = SOCK_DGRAM;
96 nfs_args.maxgrouplist = NGROUPS;
97 nfs_args.readahead = 1;
98 nfs_args.addr = (struct sockaddr *) &sain;
99 nfs_args.fh = (void *) root_fh;
100 + nfs_args.fhsize = sizeof(*root_fh);
101 nfs_args.wsize = PBUFSIZE;
102 nfs_args.rsize = PBUFSIZE;
103 nfs_args.retrans = 10;
104 nfs_args.timeo = 600;
105 nfs_args.hostname = PSIONHOSTNAME;
106 nfs_args.flags = NFSMNT_INT | NFSMNT_RETRANS | NFSMNT_TIMEO
107 - | NFSMNT_NOCONN | NFSMNT_DUMBTIMR | NFSMNT_MYWRITE
108 + | NFSMNT_NOCONN | NFSMNT_DUMBTIMR
109 | NFSMNT_WSIZE | NFSMNT_RSIZE;
110 + mount_flags = MNT_NOSUID | MNT_NODEV | MNT_NOEXEC | MNT_NOATIME;
114 @@ -496,7 +510,7 @@ mount_and_run(char *dir, void (*proc)(),
115 #if defined(__sgi) || (defined(sun) && defined(__SVR4))
116 if (mount("", dir, MS_DATA, "nfs", &nfs_args, sizeof(nfs_args)))
118 -#if defined(__NetBSD__) || defined(__NeXT__)
119 +#if defined(__NeXT__)
120 if (mount(MOUNT_NFS, dir, 0, (caddr_t) & nfs_args))
123 @@ -512,8 +526,8 @@ mount_and_run(char *dir, void (*proc)(),
124 if (aix3_mount("psion:loc", dir, 0, MOUNT_TYPE_NFS, &nfs_args, "plpnfsd"))
128 -#if __FreeBSD_version >= 300001
129 +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
130 +#if defined(__DragonFly__) || __FreeBSD_version >= 300001
131 if (mount("nfs", dir, mount_flags, &nfs_args))
133 if (mount(MOUNT_NFS, dir, mount_flags, &nfs_args))