diff options
6 files changed, 219 insertions, 344 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch new file mode 100644 index 0000000000..69236e8278 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch | |||
@@ -0,0 +1,109 @@ | |||
1 | From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 31 Dec 2019 08:15:34 -0800 | ||
4 | Subject: [PATCH] Detect warning options during configure | ||
5 | |||
6 | Certain options maybe compiler specific therefore its better | ||
7 | to detect them before use. | ||
8 | |||
9 | nfs_error copies the format string and appends newline to it | ||
10 | but compiler can forget that it was format string since its not | ||
11 | same fmt string that was passed. Ignore the warning | ||
12 | |||
13 | Wdiscarded-qualifiers is gcc specific and this is no longer needed | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | |||
18 | --- | ||
19 | support/nfs/xcommon.c | 6 ++++++ | ||
20 | support/nfs/xlog.c | 6 ++++++ | ||
21 | support/nfsidmap/libnfsidmap.c | 3 +++ | ||
22 | utils/exportfs/exportfs.c | 3 +++ | ||
23 | 4 files changed, 18 insertions(+) | ||
24 | |||
25 | diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c | ||
26 | index 3989f0bc..ff438c18 100644 | ||
27 | --- a/support/nfs/xcommon.c | ||
28 | +++ b/support/nfs/xcommon.c | ||
29 | @@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) { | ||
30 | |||
31 | fmt2 = xstrconcat2 (fmt, "\n"); | ||
32 | va_start (args, fmt); | ||
33 | +#pragma GCC diagnostic push | ||
34 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
35 | vfprintf (stderr, fmt2, args); | ||
36 | +#pragma GCC diagnostic pop | ||
37 | va_end (args); | ||
38 | free (fmt2); | ||
39 | } | ||
40 | @@ -132,7 +135,10 @@ die(int err, const char *fmt, ...) { | ||
41 | va_list args; | ||
42 | |||
43 | va_start(args, fmt); | ||
44 | +#pragma GCC diagnostic push | ||
45 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
46 | vfprintf(stderr, fmt, args); | ||
47 | +#pragma GCC diagnostic pop | ||
48 | fprintf(stderr, "\n"); | ||
49 | va_end(args); | ||
50 | |||
51 | diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c | ||
52 | index fa125cef..dc4c9ea1 100644 | ||
53 | --- a/support/nfs/xlog.c | ||
54 | +++ b/support/nfs/xlog.c | ||
55 | @@ -178,11 +178,16 @@ xlog_backend(int kind, const char *fmt, va_list args) | ||
56 | fprintf(stderr, "%s: ", log_name); | ||
57 | #endif | ||
58 | va_copy(args2, args); | ||
59 | +#pragma GCC diagnostic push | ||
60 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
61 | vfprintf(stderr, fmt, args2); | ||
62 | +#pragma GCC diagnostic pop | ||
63 | fprintf(stderr, "\n"); | ||
64 | va_end(args2); | ||
65 | } | ||
66 | |||
67 | +#pragma GCC diagnostic push | ||
68 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
69 | if (log_syslog) { | ||
70 | switch (kind) { | ||
71 | case L_FATAL: | ||
72 | @@ -203,6 +208,7 @@ xlog_backend(int kind, const char *fmt, va_list args) | ||
73 | break; | ||
74 | } | ||
75 | } | ||
76 | +#pragma GCC diagnostic pop | ||
77 | |||
78 | if (kind == L_FATAL) | ||
79 | exit(1); | ||
80 | diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c | ||
81 | index f8c36480..1a28be0a 100644 | ||
82 | --- a/support/nfsidmap/libnfsidmap.c | ||
83 | +++ b/support/nfsidmap/libnfsidmap.c | ||
84 | @@ -99,7 +99,10 @@ static void default_logger(const char *fmt, ...) | ||
85 | va_list vp; | ||
86 | |||
87 | va_start(vp, fmt); | ||
88 | +#pragma GCC diagnostic push | ||
89 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
90 | vsyslog(LOG_WARNING, fmt, vp); | ||
91 | +#pragma GCC diagnostic pop | ||
92 | va_end(vp); | ||
93 | } | ||
94 | |||
95 | diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c | ||
96 | index b03a047b..eac1ff2a 100644 | ||
97 | --- a/utils/exportfs/exportfs.c | ||
98 | +++ b/utils/exportfs/exportfs.c | ||
99 | @@ -646,7 +646,10 @@ dumpopt(char c, char *fmt, ...) | ||
100 | |||
101 | va_start(ap, fmt); | ||
102 | printf("%c", c); | ||
103 | +#pragma GCC diagnostic push | ||
104 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
105 | vprintf(fmt, ap); | ||
106 | +#pragma GCC diagnostic pop | ||
107 | va_end(ap); | ||
108 | return ','; | ||
109 | } | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch deleted file mode 100644 index 7603eb680d..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch +++ /dev/null | |||
@@ -1,299 +0,0 @@ | |||
1 | From 690a90a5b7786e40b5447ad7c5f19a7657d27405 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
3 | Date: Fri, 14 Dec 2018 17:44:32 +0800 | ||
4 | Subject: [PATCH] Makefile.am: fix undefined function for libnsm.a | ||
5 | |||
6 | The source file of libnsm.a uses some function | ||
7 | in ../support/misc/file.c, add ../support/misc/file.c | ||
8 | to libnsm_a_SOURCES to fix build error when run | ||
9 | "make -C tests statdb_dump": | ||
10 | | ../support/nsm/libnsm.a(file.o): In function `nsm_make_pathname': | ||
11 | | /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' | ||
12 | | /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' | ||
13 | | /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' | ||
14 | | ../support/nsm/libnsm.a(file.o): In function `nsm_setup_pathnames': | ||
15 | | /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:280: undefined reference to `generic_setup_basedir' | ||
16 | | collect2: error: ld returned 1 exit status | ||
17 | |||
18 | As there is already one source file named file.c | ||
19 | as support/nsm/file.c in support/nsm/Makefile.am, | ||
20 | so rename ../support/misc/file.c to ../support/misc/misc.c. | ||
21 | |||
22 | Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=154502780423058&w=2] | ||
23 | |||
24 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
25 | |||
26 | Rebase it. | ||
27 | |||
28 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
29 | --- | ||
30 | support/misc/Makefile.am | 2 +- | ||
31 | support/misc/file.c | 115 --------------------------------------------------------------------------------------------------------------- | ||
32 | support/misc/misc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
33 | support/nsm/Makefile.am | 2 +- | ||
34 | 4 files changed, 113 insertions(+), 117 deletions(-) | ||
35 | |||
36 | diff --git a/support/misc/Makefile.am b/support/misc/Makefile.am | ||
37 | index f9993e3..8b0e9db 100644 | ||
38 | --- a/support/misc/Makefile.am | ||
39 | +++ b/support/misc/Makefile.am | ||
40 | @@ -1,7 +1,7 @@ | ||
41 | ## Process this file with automake to produce Makefile.in | ||
42 | |||
43 | noinst_LIBRARIES = libmisc.a | ||
44 | -libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c file.c \ | ||
45 | +libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c misc.c \ | ||
46 | nfsd_path.c workqueue.c xstat.c | ||
47 | |||
48 | MAINTAINERCLEANFILES = Makefile.in | ||
49 | diff --git a/support/misc/file.c b/support/misc/file.c | ||
50 | deleted file mode 100644 | ||
51 | index 06f6bb2..0000000 | ||
52 | --- a/support/misc/file.c | ||
53 | +++ /dev/null | ||
54 | @@ -1,115 +0,0 @@ | ||
55 | -/* | ||
56 | - * Copyright 2009 Oracle. All rights reserved. | ||
57 | - * Copyright 2017 Red Hat, Inc. All rights reserved. | ||
58 | - * | ||
59 | - * This file is part of nfs-utils. | ||
60 | - * | ||
61 | - * nfs-utils is free software; you can redistribute it and/or modify | ||
62 | - * it under the terms of the GNU General Public License as published by | ||
63 | - * the Free Software Foundation; either version 2 of the License, or | ||
64 | - * (at your option) any later version. | ||
65 | - * | ||
66 | - * nfs-utils is distributed in the hope that it will be useful, | ||
67 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
68 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
69 | - * GNU General Public License for more details. | ||
70 | - * | ||
71 | - * You should have received a copy of the GNU General Public License | ||
72 | - * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. | ||
73 | - */ | ||
74 | - | ||
75 | -#ifdef HAVE_CONFIG_H | ||
76 | -#include <config.h> | ||
77 | -#endif | ||
78 | - | ||
79 | -#include <sys/stat.h> | ||
80 | - | ||
81 | -#include <string.h> | ||
82 | -#include <libgen.h> | ||
83 | -#include <stdio.h> | ||
84 | -#include <errno.h> | ||
85 | -#include <dirent.h> | ||
86 | -#include <stdlib.h> | ||
87 | -#include <stdbool.h> | ||
88 | -#include <limits.h> | ||
89 | - | ||
90 | -#include "xlog.h" | ||
91 | -#include "misc.h" | ||
92 | - | ||
93 | -/* | ||
94 | - * Returns a dynamically allocated, '\0'-terminated buffer | ||
95 | - * containing an appropriate pathname, or NULL if an error | ||
96 | - * occurs. Caller must free the returned result with free(3). | ||
97 | - */ | ||
98 | -__attribute__((__malloc__)) | ||
99 | -char * | ||
100 | -generic_make_pathname(const char *base, const char *leaf) | ||
101 | -{ | ||
102 | - size_t size; | ||
103 | - char *path; | ||
104 | - int len; | ||
105 | - | ||
106 | - size = strlen(base) + strlen(leaf) + 2; | ||
107 | - if (size > PATH_MAX) | ||
108 | - return NULL; | ||
109 | - | ||
110 | - path = malloc(size); | ||
111 | - if (path == NULL) | ||
112 | - return NULL; | ||
113 | - | ||
114 | - len = snprintf(path, size, "%s/%s", base, leaf); | ||
115 | - if ((len < 0) || ((size_t)len >= size)) { | ||
116 | - free(path); | ||
117 | - return NULL; | ||
118 | - } | ||
119 | - | ||
120 | - return path; | ||
121 | -} | ||
122 | - | ||
123 | - | ||
124 | -/** | ||
125 | - * generic_setup_basedir - set up basedir | ||
126 | - * @progname: C string containing name of program, for error messages | ||
127 | - * @parentdir: C string containing pathname to on-disk state, or NULL | ||
128 | - * @base: character buffer to contain the basedir that is set up | ||
129 | - * @baselen: size of @base in bytes | ||
130 | - * | ||
131 | - * This runs before logging is set up, so error messages are directed | ||
132 | - * to stderr. | ||
133 | - * | ||
134 | - * Returns true and sets up our basedir, if @parentdir was valid | ||
135 | - * and usable; otherwise false is returned. | ||
136 | - */ | ||
137 | -_Bool | ||
138 | -generic_setup_basedir(const char *progname, const char *parentdir, char *base, | ||
139 | - const size_t baselen) | ||
140 | -{ | ||
141 | - static char buf[PATH_MAX]; | ||
142 | - struct stat st; | ||
143 | - char *path; | ||
144 | - | ||
145 | - /* First: test length of name and whether it exists */ | ||
146 | - if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { | ||
147 | - (void)fprintf(stderr, "%s: Directory name too long: %s", | ||
148 | - progname, parentdir); | ||
149 | - return false; | ||
150 | - } | ||
151 | - if (lstat(parentdir, &st) == -1) { | ||
152 | - (void)fprintf(stderr, "%s: Failed to stat %s: %s", | ||
153 | - progname, parentdir, strerror(errno)); | ||
154 | - return false; | ||
155 | - } | ||
156 | - | ||
157 | - /* Ensure we have a clean directory pathname */ | ||
158 | - strncpy(buf, parentdir, sizeof(buf)-1); | ||
159 | - path = dirname(buf); | ||
160 | - if (*path == '.') { | ||
161 | - (void)fprintf(stderr, "%s: Unusable directory %s", | ||
162 | - progname, parentdir); | ||
163 | - return false; | ||
164 | - } | ||
165 | - | ||
166 | - xlog(D_CALL, "Using %s as the state directory", parentdir); | ||
167 | - strcpy(base, parentdir); | ||
168 | - return true; | ||
169 | -} | ||
170 | diff --git a/support/misc/misc.c b/support/misc/misc.c | ||
171 | new file mode 100644 | ||
172 | index 0000000..e7c3819 | ||
173 | --- /dev/null | ||
174 | +++ b/support/misc/misc.c | ||
175 | @@ -0,0 +1,111 @@ | ||
176 | +/* | ||
177 | + * Copyright 2009 Oracle. All rights reserved. | ||
178 | + * Copyright 2017 Red Hat, Inc. All rights reserved. | ||
179 | + * | ||
180 | + * This file is part of nfs-utils. | ||
181 | + * | ||
182 | + * nfs-utils is free software; you can redistribute it and/or modify | ||
183 | + * it under the terms of the GNU General Public License as published by | ||
184 | + * the Free Software Foundation; either version 2 of the License, or | ||
185 | + * (at your option) any later version. | ||
186 | + * | ||
187 | + * nfs-utils is distributed in the hope that it will be useful, | ||
188 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
189 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
190 | + * GNU General Public License for more details. | ||
191 | + * | ||
192 | + * You should have received a copy of the GNU General Public License | ||
193 | + * along with nfs-utils. If not, see <http://www.gnu.org/licenses/>. | ||
194 | + */ | ||
195 | + | ||
196 | +#include <sys/stat.h> | ||
197 | + | ||
198 | +#include <string.h> | ||
199 | +#include <libgen.h> | ||
200 | +#include <stdio.h> | ||
201 | +#include <errno.h> | ||
202 | +#include <dirent.h> | ||
203 | +#include <stdlib.h> | ||
204 | +#include <stdbool.h> | ||
205 | +#include <limits.h> | ||
206 | + | ||
207 | +#include "xlog.h" | ||
208 | +#include "misc.h" | ||
209 | + | ||
210 | +/* | ||
211 | + * Returns a dynamically allocated, '\0'-terminated buffer | ||
212 | + * containing an appropriate pathname, or NULL if an error | ||
213 | + * occurs. Caller must free the returned result with free(3). | ||
214 | + */ | ||
215 | +__attribute__((__malloc__)) | ||
216 | +char * | ||
217 | +generic_make_pathname(const char *base, const char *leaf) | ||
218 | +{ | ||
219 | + size_t size; | ||
220 | + char *path; | ||
221 | + int len; | ||
222 | + | ||
223 | + size = strlen(base) + strlen(leaf) + 2; | ||
224 | + if (size > PATH_MAX) | ||
225 | + return NULL; | ||
226 | + | ||
227 | + path = malloc(size); | ||
228 | + if (path == NULL) | ||
229 | + return NULL; | ||
230 | + | ||
231 | + len = snprintf(path, size, "%s/%s", base, leaf); | ||
232 | + if ((len < 0) || ((size_t)len >= size)) { | ||
233 | + free(path); | ||
234 | + return NULL; | ||
235 | + } | ||
236 | + | ||
237 | + return path; | ||
238 | +} | ||
239 | + | ||
240 | + | ||
241 | +/** | ||
242 | + * generic_setup_basedir - set up basedir | ||
243 | + * @progname: C string containing name of program, for error messages | ||
244 | + * @parentdir: C string containing pathname to on-disk state, or NULL | ||
245 | + * @base: character buffer to contain the basedir that is set up | ||
246 | + * @baselen: size of @base in bytes | ||
247 | + * | ||
248 | + * This runs before logging is set up, so error messages are directed | ||
249 | + * to stderr. | ||
250 | + * | ||
251 | + * Returns true and sets up our basedir, if @parentdir was valid | ||
252 | + * and usable; otherwise false is returned. | ||
253 | + */ | ||
254 | +_Bool | ||
255 | +generic_setup_basedir(const char *progname, const char *parentdir, char *base, | ||
256 | + const size_t baselen) | ||
257 | +{ | ||
258 | + static char buf[PATH_MAX]; | ||
259 | + struct stat st; | ||
260 | + char *path; | ||
261 | + | ||
262 | + /* First: test length of name and whether it exists */ | ||
263 | + if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { | ||
264 | + (void)fprintf(stderr, "%s: Directory name too long: %s", | ||
265 | + progname, parentdir); | ||
266 | + return false; | ||
267 | + } | ||
268 | + if (lstat(parentdir, &st) == -1) { | ||
269 | + (void)fprintf(stderr, "%s: Failed to stat %s: %s", | ||
270 | + progname, parentdir, strerror(errno)); | ||
271 | + return false; | ||
272 | + } | ||
273 | + | ||
274 | + /* Ensure we have a clean directory pathname */ | ||
275 | + strncpy(buf, parentdir, sizeof(buf)-1); | ||
276 | + path = dirname(buf); | ||
277 | + if (*path == '.') { | ||
278 | + (void)fprintf(stderr, "%s: Unusable directory %s", | ||
279 | + progname, parentdir); | ||
280 | + return false; | ||
281 | + } | ||
282 | + | ||
283 | + xlog(D_CALL, "Using %s as the state directory", parentdir); | ||
284 | + strcpy(base, parentdir); | ||
285 | + return true; | ||
286 | +} | ||
287 | diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am | ||
288 | index 8f5874e..68f1a46 100644 | ||
289 | --- a/support/nsm/Makefile.am | ||
290 | +++ b/support/nsm/Makefile.am | ||
291 | @@ -10,7 +10,7 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H) | ||
292 | EXTRA_DIST = sm_inter.x | ||
293 | |||
294 | noinst_LIBRARIES = libnsm.a | ||
295 | -libnsm_a_SOURCES = $(GENFILES) file.c rpc.c | ||
296 | +libnsm_a_SOURCES = $(GENFILES) ../misc/misc.c file.c rpc.c | ||
297 | |||
298 | BUILT_SOURCES = $(GENFILES) | ||
299 | |||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch new file mode 100644 index 0000000000..bbf44d5977 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 001913c5eb0aad933a93ee966252905cd46d776b Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel McGregor <daniel.mcgregor@vecima.com> | ||
3 | Date: Tue, 6 Jun 2023 16:07:53 -0600 | ||
4 | Subject: [PATCH] Use "nogroup" for nobody group | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-core specific, configuration] | ||
7 | Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> | ||
8 | --- | ||
9 | support/nfsidmap/idmapd.conf | 2 +- | ||
10 | utils/idmapd/idmapd.c | 2 +- | ||
11 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/support/nfsidmap/idmapd.conf b/support/nfsidmap/idmapd.conf | ||
14 | index 2a2f79a1..e6f3724f 100644 | ||
15 | --- a/support/nfsidmap/idmapd.conf | ||
16 | +++ b/support/nfsidmap/idmapd.conf | ||
17 | @@ -41,7 +41,7 @@ | ||
18 | [Mapping] | ||
19 | |||
20 | #Nobody-User = nobody | ||
21 | -#Nobody-Group = nobody | ||
22 | +#Nobody-Group = nogroup | ||
23 | |||
24 | [Translation] | ||
25 | |||
26 | diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c | ||
27 | index cd9a965f..3be805e9 100644 | ||
28 | --- a/utils/idmapd/idmapd.c | ||
29 | +++ b/utils/idmapd/idmapd.c | ||
30 | @@ -89,7 +89,7 @@ | ||
31 | #endif | ||
32 | |||
33 | #ifndef NFS4NOBODY_GROUP | ||
34 | -#define NFS4NOBODY_GROUP "nobody" | ||
35 | +#define NFS4NOBODY_GROUP "nogroup" | ||
36 | #endif | ||
37 | |||
38 | /* From Niels */ | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch new file mode 100644 index 0000000000..3241e8e859 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From a2af266f013722a64c5d04e0fe097cd711393a53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel McGregor <daniel.mcgregor@vecima.com> | ||
3 | Date: Wed, 8 Nov 2023 16:24:20 -0600 | ||
4 | Subject: [PATCH] find OE provided Kerberos | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-core specific] | ||
7 | Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> | ||
8 | --- | ||
9 | aclocal/kerberos5.m4 | 6 ++++-- | ||
10 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4 | ||
13 | index f96f0fd4..ad85fdf2 100644 | ||
14 | --- a/aclocal/kerberos5.m4 | ||
15 | +++ b/aclocal/kerberos5.m4 | ||
16 | @@ -22,8 +22,8 @@ AC_DEFUN([AC_KERBEROS_V5],[ | ||
17 | dnl This ugly hack brought on by the split installation of | ||
18 | dnl MIT Kerberos on Fedora Core 1 | ||
19 | K5CONFIG="" | ||
20 | - if test -f $dir/bin/krb5-config; then | ||
21 | - K5CONFIG=$dir/bin/krb5-config | ||
22 | + if test -f $dir/bin/crossscripts/krb5-config; then | ||
23 | + K5CONFIG=$dir/bin/crossscripts/krb5-config | ||
24 | elif test -f "/usr/kerberos/bin/krb5-config"; then | ||
25 | K5CONFIG="/usr/kerberos/bin/krb5-config" | ||
26 | elif test -f "/usr/lib/mit/bin/krb5-config"; then | ||
27 | @@ -72,6 +72,7 @@ AC_DEFUN([AC_KERBEROS_V5],[ | ||
28 | AC_MSG_RESULT($KRBDIR) | ||
29 | |||
30 | dnl Check if -rpath=$(KRBDIR)/lib is needed | ||
31 | + if false; then | ||
32 | echo "The current KRBDIR is $KRBDIR" | ||
33 | if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \ | ||
34 | -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then | ||
35 | @@ -81,6 +82,7 @@ AC_DEFUN([AC_KERBEROS_V5],[ | ||
36 | else | ||
37 | KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib" | ||
38 | fi | ||
39 | + fi | ||
40 | |||
41 | dnl Now check for functions within gssapi library | ||
42 | AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch deleted file mode 100644 index fde99b599e..0000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 31 Dec 2019 08:15:34 -0800 | ||
4 | Subject: [PATCH] Detect warning options during configure | ||
5 | |||
6 | Certain options maybe compiler specific therefore its better | ||
7 | to detect them before use. | ||
8 | |||
9 | nfs_error copies the format string and appends newline to it | ||
10 | but compiler can forget that it was format string since its not | ||
11 | same fmt string that was passed. Ignore the warning | ||
12 | |||
13 | Wdiscarded-qualifiers is gcc specific and this is no longer needed | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | |||
18 | --- | ||
19 | support/nfs/xcommon.c | 3 +++ | ||
20 | 1 file changed, 3 insertions(+) | ||
21 | |||
22 | diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c | ||
23 | index 3989f0b..e080423 100644 | ||
24 | --- a/support/nfs/xcommon.c | ||
25 | +++ b/support/nfs/xcommon.c | ||
26 | @@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) { | ||
27 | |||
28 | fmt2 = xstrconcat2 (fmt, "\n"); | ||
29 | va_start (args, fmt); | ||
30 | +#pragma GCC diagnostic push | ||
31 | +#pragma GCC diagnostic ignored "-Wformat-nonliteral" | ||
32 | vfprintf (stderr, fmt2, args); | ||
33 | +#pragma GCC diagnostic pop | ||
34 | va_end (args); | ||
35 | free (fmt2); | ||
36 | } | ||
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb index f07ed2040a..abbdec7808 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb | |||
@@ -21,10 +21,11 @@ USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \ | |||
21 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ | 21 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ |
22 | file://nfsserver \ | 22 | file://nfsserver \ |
23 | file://nfscommon \ | 23 | file://nfscommon \ |
24 | file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ | ||
25 | file://clang-warnings.patch \ | ||
26 | file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ | 24 | file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ |
27 | file://0001-Fix-typecast-warning-with-clang.patch \ | 25 | file://0001-Fix-typecast-warning-with-clang.patch \ |
26 | file://0001-Detect-warning-options-during-configure.patch \ | ||
27 | file://0004-Use-nogroup-for-nobody-group.patch \ | ||
28 | file://0005-find-OE-provided-Kerberos.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15" | 31 | SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15" |
@@ -49,9 +50,8 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ | |||
49 | --enable-mountconfig \ | 50 | --enable-mountconfig \ |
50 | --enable-libmount-mount \ | 51 | --enable-libmount-mount \ |
51 | --enable-uuid \ | 52 | --enable-uuid \ |
52 | --disable-gss \ | ||
53 | --disable-nfsdcltrack \ | ||
54 | --with-statdpath=/var/lib/nfs/statd \ | 53 | --with-statdpath=/var/lib/nfs/statd \ |
54 | --with-pluginpath=${libdir}/libnfsidmap \ | ||
55 | --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \ | 55 | --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \ |
56 | " | 56 | " |
57 | 57 | ||
@@ -60,13 +60,16 @@ LDFLAGS += "-lsqlite3 -levent" | |||
60 | PACKAGECONFIG ??= "tcp-wrappers \ | 60 | PACKAGECONFIG ??= "tcp-wrappers \ |
61 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ | 61 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ |
62 | " | 62 | " |
63 | |||
63 | PACKAGECONFIG:remove:libc-musl = "tcp-wrappers" | 64 | PACKAGECONFIG:remove:libc-musl = "tcp-wrappers" |
65 | #krb5 is available in meta-oe | ||
66 | PACKAGECONFIG[gssapi] = "--with-krb5=${STAGING_EXECPREFIXDIR} --enable-gss --enable-svcgss,--disable-gss --disable-svcgss,krb5" | ||
64 | PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" | 67 | PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" |
65 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | 68 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
66 | # libdevmapper is available in meta-oe | 69 | # libdevmapper is available in meta-oe |
67 | PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper" | 70 | PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper" |
68 | # keyutils is available in meta-oe | 71 | # keyutils is available in meta-oe |
69 | PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core" | 72 | PACKAGECONFIG[nfsv4] = "--enable-nfsv4 --enable-nfsdcltrack,--disable-nfsv4 --disable-nfsdcltrack,keyutils,python3-core" |
70 | PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline," | 73 | PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline," |
71 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd" | 74 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd" |
72 | 75 | ||
@@ -76,19 +79,34 @@ CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \ | |||
76 | ${localstatedir}/lib/nfs/rmtab \ | 79 | ${localstatedir}/lib/nfs/rmtab \ |
77 | ${localstatedir}/lib/nfs/xtab \ | 80 | ${localstatedir}/lib/nfs/xtab \ |
78 | ${localstatedir}/lib/nfs/statd/state \ | 81 | ${localstatedir}/lib/nfs/statd/state \ |
82 | ${sysconfdir}/idmapd.conf \ | ||
79 | ${sysconfdir}/nfs.conf \ | 83 | ${sysconfdir}/nfs.conf \ |
80 | ${sysconfdir}/nfsmount.conf" | 84 | ${sysconfdir}/nfsmount.conf" |
81 | 85 | ||
82 | FILES:${PN}-client = "${sbindir}/*statd \ | 86 | FILES:${PN}-client = "${sbindir}/*statd \ |
83 | ${libdir}/libnfsidmap.so.* \ | ||
84 | ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ | 87 | ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ |
85 | ${sbindir}/showmount ${sbindir}/nfsstat \ | 88 | ${sbindir}/showmount ${sbindir}/nfsstat \ |
89 | ${sbindir}/rpc.gssd \ | ||
86 | ${sbindir}/nfsconf \ | 90 | ${sbindir}/nfsconf \ |
91 | ${libdir}/libnfsidmap.so.* \ | ||
92 | ${libdir}/libnfsidmap/*.so \ | ||
93 | ${libexecdir}/nfsrahead \ | ||
87 | ${localstatedir}/lib/nfs \ | 94 | ${localstatedir}/lib/nfs \ |
95 | ${sysconfdir}/idmapd.conf \ | ||
96 | ${sysconfdir}/init.d/nfscommon \ | ||
88 | ${sysconfdir}/nfs.conf \ | 97 | ${sysconfdir}/nfs.conf \ |
89 | ${sysconfdir}/nfsmount.conf \ | 98 | ${sysconfdir}/nfsmount.conf \ |
90 | ${sysconfdir}/init.d/nfscommon \ | 99 | ${systemd_system_unitdir}/auth-rpcgss-module.service \ |
91 | ${systemd_system_unitdir}/nfs-statd.service" | 100 | ${systemd_system_unitdir}/nfs-client.target \ |
101 | ${systemd_system_unitdir}/nfs-idmapd.service \ | ||
102 | ${systemd_system_unitdir}/nfs-statd.service \ | ||
103 | ${systemd_system_unitdir}/nfscommon.service \ | ||
104 | ${systemd_system_unitdir}/rpc-gssd.service \ | ||
105 | ${systemd_system_unitdir}/rpc-statd-notify.service \ | ||
106 | ${systemd_system_unitdir}/rpc-statd.service \ | ||
107 | ${systemd_system_unitdir}/rpc_pipefs.target \ | ||
108 | ${systemd_system_unitdir}/var-lib-nfs-rpc_pipefs.mount \ | ||
109 | ${nonarch_libdir}/udev/rules.d/*" | ||
92 | RDEPENDS:${PN}-client = "${PN}-mount rpcbind" | 110 | RDEPENDS:${PN}-client = "${PN}-mount rpcbind" |
93 | 111 | ||
94 | FILES:${PN}-mount = "${base_sbindir}/*mount.nfs*" | 112 | FILES:${PN}-mount = "${base_sbindir}/*mount.nfs*" |
@@ -105,7 +123,9 @@ FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modp | |||
105 | 123 | ||
106 | do_configure:prepend() { | 124 | do_configure:prepend() { |
107 | sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ | 125 | sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ |
108 | ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am | 126 | -e 's,udev_rulesdir = /usr/lib/udev/rules.d/,udev_rulesdir = ${nonarch_base_libdir}/udev/rules.d/,g' \ |
127 | ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am \ | ||
128 | ${S}/systemd/Makefile.am ${S}/tools/nfsrahead/Makefile.am | ||
109 | } | 129 | } |
110 | 130 | ||
111 | # Make clean needed because the package comes with | 131 | # Make clean needed because the package comes with |
@@ -122,6 +142,7 @@ do_install:append () { | |||
122 | install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver | 142 | install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver |
123 | install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon | 143 | install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon |
124 | 144 | ||
145 | install -m 0644 ${S}/support/nfsidmap/idmapd.conf ${D}${sysconfdir} | ||
125 | install -m 0644 ${S}/nfs.conf ${D}${sysconfdir} | 146 | install -m 0644 ${S}/nfs.conf ${D}${sysconfdir} |
126 | 147 | ||
127 | install -d ${D}${systemd_system_unitdir} | 148 | install -d ${D}${systemd_system_unitdir} |