summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch')
-rw-r--r--meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch263
1 files changed, 0 insertions, 263 deletions
diff --git a/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch b/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch
deleted file mode 100644
index 99cd6b1029..0000000000
--- a/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/017-wrs-dynamic-rpc.patch
+++ /dev/null
@@ -1,263 +0,0 @@
1Upstream-Status: Inappropriate [other]
2Upstream is not making further releases of this software.
3
4Signed-off-by: Scott Garman <scott.a.garman@intel.com>
5
6# Add the ability to choose alternate RPC ports at runtime and disable
7# security so that it can run as a userland process
8# Patch origin: Wind River
9
10Index: nfs-server-2.2beta47/auth_init.c
11===================================================================
12--- nfs-server-2.2beta47.orig/auth_init.c
13+++ nfs-server-2.2beta47/auth_init.c
14@@ -409,6 +409,7 @@ auth_init(char *fname)
15 fname = EXPORTSFILE;
16 auth_file = fname; /* Save for re-initialization */
17
18+#ifdef ROOT_LEVEL_SECURITY
19 /* Check protection of exports file. */
20 switch(iCheckAccess(auth_file, EXPORTSOWNERUID, EXPORTSOWNERGID)) {
21 case FACCESSWRITABLE:
22@@ -424,6 +425,7 @@ auth_init(char *fname)
23 Dprintf(L_ERROR, "exiting because of security violation.\n");
24 exit(1);
25 }
26+#endif
27
28 if ((ef = fopen(fname, "r")) == NULL) {
29 Dprintf(L_ERROR, "Could not open exports file %s: %s\n",
30Index: nfs-server-2.2beta47/nfsd.c
31===================================================================
32--- nfs-server-2.2beta47.orig/nfsd.c
33+++ nfs-server-2.2beta47/nfsd.c
34@@ -46,6 +46,7 @@ static char pathbuf_1[NFS_MAXPATHLEN + N
35
36 extern char version[];
37 static char *program_name;
38+static int nfs_prog = NFS_PROGRAM;
39
40 /*
41 * Option table
42@@ -60,6 +61,7 @@ static struct option longopts[] = {
43 { "help", 0, 0, 'h' },
44 { "log-transfers", 0, 0, 'l' },
45 { "allow-non-root", 0, 0, 'n' },
46+ { "prog", required_argument, 0, 'g' },
47 { "port", required_argument, 0, 'P' },
48 { "promiscuous", 0, 0, 'p' },
49 { "re-export", 0, 0, 'r' },
50@@ -73,9 +75,10 @@ static struct option longopts[] = {
51 { "udp-only", 0, 0, OPT_NOTCP },
52 { "loopback-only", 0, 0, OPT_LOOPBACK },
53 { "hashed-inodes", 0, 0, 'I' },
54+ { "nfs-pid", required_argument, 0, 'N' },
55 { NULL, 0, 0, 0 }
56 };
57-static const char * shortopts = "a:d:Ff:hlnP:prR:tvz::";
58+static const char * shortopts = "a:d:Ff:g:hlnN:P:prR:tvz::";
59
60 /*
61 * Table of supported versions
62@@ -1003,6 +1006,8 @@ main(int argc, char **argv)
63 int failsafe_level = 0;
64 int c;
65 int i, ncopies = 1;
66+ char *nfs_pid_file = NULL;
67+
68
69 program_name = argv[0];
70 chdir("/");
71@@ -1026,9 +1031,15 @@ main(int argc, char **argv)
72 case 'f':
73 auth_file = optarg;
74 break;
75+ case 'g':
76+ nfs_prog = atoi(optarg);
77+ break;
78 case 'l':
79 log_transfers = 1;
80 break;
81+ case 'N':
82+ nfs_pid_file = strdup(optarg);
83+ break;
84 case 'n':
85 allow_non_root = 1;
86 break;
87@@ -1114,7 +1125,7 @@ main(int argc, char **argv)
88 log_open("nfsd", foreground);
89
90 /* Initialize RPC stuff */
91- rpc_init("nfsd", NFS_PROGRAM, nfsd_versions, nfs_dispatch,
92+ rpc_init("nfsd", nfs_prog, nfsd_versions, nfs_dispatch,
93 nfsport, NFS_MAXDATA);
94
95 if (_rpcpmstart) {
96@@ -1145,7 +1156,10 @@ main(int argc, char **argv)
97 /* Initialize the AUTH module. */
98 auth_init(auth_file);
99
100- setpidpath(_PATH_NFSD_PIDFILE);
101+ if (nfs_pid_file == 0)
102+ nfs_pid_file = _PATH_NFSD_PIDFILE;
103+ setpidpath(nfs_pid_file);
104+
105 if (failsafe_level == 0) {
106 /* Start multiple copies of the server */
107 writepid(getpid(), 1);
108@@ -1215,9 +1229,11 @@ usage(FILE *fp, int n)
109 fprintf(fp,
110 "Usage: %s [-Fhnpv] [-d kind] [-f exports-file] [-P port] [--version]\n"
111 " [--debug kind] [--exports-file=file] [--port port]\n"
112+" [--prog alternate_rpc_port_nubmer]\n"
113 " [--allow-non-root] [--promiscuous] [--version] [--foreground]\n"
114 " [--re-export] [--log-transfers] [--public-root path]\n"
115 " [--no-spoof-trace] [--no-cross-mounts] [--hashed-inodes] [--help]\n"
116+" [--nfs-pid file]\n"
117 , program_name);
118 exit(n);
119 }
120@@ -1234,7 +1250,7 @@ sigterm(int sig)
121 static void
122 terminate(void)
123 {
124- rpc_exit(NFS_PROGRAM, nfsd_versions);
125+ rpc_exit(nfs_prog, nfsd_versions);
126 efs_shutdown();
127 }
128
129Index: nfs-server-2.2beta47/mountd.c
130===================================================================
131--- nfs-server-2.2beta47.orig/mountd.c
132+++ nfs-server-2.2beta47/mountd.c
133@@ -42,6 +42,7 @@ int hashed_inodes; /* dummy */
134 static void usage(FILE *, int);
135 static void terminate(void);
136 static RETSIGTYPE sigterm(int sig);
137+int mount_prog = MOUNTPROG;
138
139 /*
140 * Option table for mountd
141@@ -55,6 +56,7 @@ static struct option longopts[] =
142 { "help", 0, 0, 'h' },
143 { "allow-non-root", 0, 0, 'n' },
144 { "port", required_argument, 0, 'P' },
145+ { "prog", required_argument, 0, 'g' },
146 { "promiscous", 0, 0, 'p' },
147 { "re-export", 0, 0, 'r' },
148 { "no-spoof-trace", 0, 0, 't' },
149@@ -63,9 +65,11 @@ static struct option longopts[] =
150 { "no-cross-mounts", 0, 0, 'x' },
151 { "no-tcp", 0, 0, OPT_NOTCP },
152 { "loopback-only", 0, 0, OPT_LOOPBACK },
153+ { "mount-pid", required_argument, 0, 'N' },
154+ { "rmtab", required_argument, 0, 'R' },
155 { NULL, 0, 0, 0 }
156 };
157-static const char * shortopts = "Fd:f:hnpP:rtvz::";
158+static const char * shortopts = "Fd:f:g:hnN:pP:rRtvz::";
159
160 /*
161 * Table of supported versions
162@@ -318,6 +322,7 @@ main(int argc, char **argv)
163 int failsafe_level = 0;
164 int port = 0;
165 int c;
166+ char *mount_pid_file = NULL;
167
168 program_name = argv[0];
169
170@@ -340,9 +345,15 @@ main(int argc, char **argv)
171 case 'f':
172 auth_file = optarg;
173 break;
174+ case 'g':
175+ mount_prog = port = atoi(optarg);
176+ break;
177 case 'n':
178 allow_non_root = 1;
179 break;
180+ case 'N':
181+ mount_pid_file = strdup(optarg);
182+ break;
183 case 'P':
184 port = atoi(optarg);
185 if (port <= 0 || port > 65535) {
186@@ -354,6 +365,9 @@ main(int argc, char **argv)
187 case 'p':
188 promiscuous = 1;
189 break;
190+ case 'R':
191+ _PATH_RMTAB = strdup(optarg);
192+ break;
193 case 'r':
194 re_export = 1;
195 break;
196@@ -401,7 +415,7 @@ main(int argc, char **argv)
197 log_open("mountd", foreground);
198
199 /* Create services and register with portmapper */
200- rpc_init("mountd", MOUNTPROG, mountd_versions, mount_dispatch, port, 0);
201+ rpc_init("mountd", mount_prog, mountd_versions, mount_dispatch, port, 0);
202
203 if (_rpcpmstart) {
204 /* Always foreground mode */
205@@ -422,7 +436,9 @@ main(int argc, char **argv)
206 auth_init(auth_file);
207
208 /* Write pidfile */
209- setpidpath(_PATH_MOUNTD_PIDFILE);
210+ if (mount_pid_file == 0)
211+ mount_pid_file = _PATH_MOUNTD_PIDFILE;
212+ setpidpath(mount_pid_file);
213 writepid(getpid(), 1);
214
215 /* Failsafe mode */
216@@ -453,7 +469,9 @@ usage(FILE *fp, int n)
217 program_name);
218 fprintf(fp, " [--debug kind] [--help] [--allow-non-root]\n");
219 fprintf(fp, " [--promiscuous] [--version] [--port portnum]\n");
220+ fprintf(fp, " [--prog alternate_rpc_port_nubmer]\n");
221 fprintf(fp, " [--exports-file=file] [--no-cross-mounts]\n");
222+ fprintf(fp, " [--mount-pid file] [--rmtab file]\n");
223 exit(n);
224 }
225
226@@ -467,7 +485,7 @@ sigterm(int sig)
227 static void
228 terminate(void)
229 {
230- rpc_exit(MOUNTPROG, mountd_versions);
231+ rpc_exit(mount_prog, mountd_versions);
232 }
233
234 RETSIGTYPE
235Index: nfs-server-2.2beta47/rmtab.c
236===================================================================
237--- nfs-server-2.2beta47.orig/rmtab.c
238+++ nfs-server-2.2beta47/rmtab.c
239@@ -14,6 +14,8 @@ static char * rmtab_gethost(struct svc_r
240 static int rmtab_insert(char *, char *);
241 static void rmtab_file(char);
242
243+char *_PATH_RMTAB = _PATH_RMTAB_VAL;
244+
245 /*
246 * global top to linklist
247 */
248Index: nfs-server-2.2beta47/rmtab.h
249===================================================================
250--- nfs-server-2.2beta47.orig/rmtab.h
251+++ nfs-server-2.2beta47/rmtab.h
252@@ -11,8 +11,9 @@
253 * Location of rmtab file. /etc/rmtab is the standard on most systems.
254 */
255 #include <paths.h>
256-#ifndef _PATH_RMTAB
257-#define _PATH_RMTAB "/etc/rmtab"
258+extern char *_PATH_RMTAB;
259+#ifndef _PATH_RMTAB_VAL
260+#define _PATH_RMTAB_VAL "/etc/rmtab"
261 #endif
262
263 extern void rmtab_add_client(dirpath, struct svc_req *);