summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/quota
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/quota')
-rw-r--r--meta/recipes-extended/quota/quota/0001-Fix-building-on-musl.patch228
-rw-r--r--meta/recipes-extended/quota/quota/0001-quota-Use-realloc-3-instead-of-reallocarray-3.patch34
-rw-r--r--meta/recipes-extended/quota/quota/fcntl.patch71
-rw-r--r--meta/recipes-extended/quota/quota_4.09.bb (renamed from meta/recipes-extended/quota/quota_4.06.bb)12
4 files changed, 234 insertions, 111 deletions
diff --git a/meta/recipes-extended/quota/quota/0001-Fix-building-on-musl.patch b/meta/recipes-extended/quota/quota/0001-Fix-building-on-musl.patch
new file mode 100644
index 0000000000..ce20f672cc
--- /dev/null
+++ b/meta/recipes-extended/quota/quota/0001-Fix-building-on-musl.patch
@@ -0,0 +1,228 @@
1From e73c5b48e12c3f02e532864a1107cdc8a4feafc3 Mon Sep 17 00:00:00 2001
2From: Brahmajit Das <brahmajit.xyz@gmail.com>
3Date: Sun, 14 Jul 2024 07:58:50 +0000
4Subject: [PATCH] Fix building on musl
5
6basename(3) is defined in libgen.h in MUSL. Include libgen.h where
7basename(3) is used.
8
9Upstream-Status: Backport [https://sourceforge.net/p/linuxquota/code/ci/e73c5b48e12c3f02e532864a1107cdc8a4feafc3/]
10Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
11Signed-off-by: Jan Kara <jack@suse.cz>
12---
13 convertquota.c | 1 +
14 edquota.c | 11 ++++++-----
15 quota.c | 1 +
16 quota_nld.c | 1 +
17 quotacheck.c | 1 +
18 quotaon.c | 1 +
19 quotastats.c | 1 +
20 quotasync.c | 1 +
21 repquota.c | 1 +
22 rquota_svc.c | 1 +
23 setquota.c | 1 +
24 warnquota.c | 1 +
25 xqmstats.c | 1 +
26 13 files changed, 18 insertions(+), 5 deletions(-)
27
28diff --git a/convertquota.c b/convertquota.c
29index 6c8a553..4eb05ed 100644
30--- a/convertquota.c
31+++ b/convertquota.c
32@@ -14,6 +14,7 @@
33 #include <fcntl.h>
34 #include <errno.h>
35 #include <getopt.h>
36+#include <libgen.h>
37
38 #include <endian.h>
39
40diff --git a/edquota.c b/edquota.c
41index 20ca306..c5b27cf 100644
42--- a/edquota.c
43+++ b/edquota.c
44@@ -20,6 +20,7 @@
45 #include <stdlib.h>
46 #include <fcntl.h>
47 #include <getopt.h>
48+#include <libgen.h>
49
50 #include "pot.h"
51 #include "quotaops.h"
52@@ -38,7 +39,7 @@ char *progname;
53 static int flags, quotatype;
54 static int fmt = -1;
55 static char *protoname;
56-static char *dirname;
57+static char *dir_name;
58
59 static void usage(void)
60 {
61@@ -138,7 +139,7 @@ static int parse_options(int argc, char **argv)
62 exit(1);
63 break;
64 case 'f':
65- dirname = optarg;
66+ dir_name = optarg;
67 break;
68 case 256:
69 flags |= FL_NUMNAMES;
70@@ -176,7 +177,7 @@ static void copy_prototype(int argc, char **argv, struct quota_handle **handles)
71 protoprivs = getprivs(protoid, handles, 0);
72 while (argc-- > 0) {
73 id = name2id(*argv, quotatype, !!(flags & FL_NUMNAMES), NULL);
74- curprivs = getprivs(id, handles, !dirname);
75+ curprivs = getprivs(id, handles, !dir_name);
76 if (!curprivs)
77 die(1, _("Cannot get quota information for user %s\n"), *argv);
78 argv++;
79@@ -223,7 +224,7 @@ int main(int argc, char **argv)
80 argv += ret;
81
82 init_kernel_interface();
83- handles = create_handle_list(dirname ? 1 : 0, dirname ? &dirname : NULL, quotatype, fmt,
84+ handles = create_handle_list(dir_name ? 1 : 0, dir_name ? &dir_name : NULL, quotatype, fmt,
85 (flags & FL_NO_MIXED_PATHS) ? 0 : IOI_NFS_MIXED_PATHS,
86 (flags & FL_REMOTE) ? 0 : MS_LOCALONLY);
87 if (!handles[0]) {
88@@ -296,7 +297,7 @@ int main(int argc, char **argv)
89 else {
90 for (; argc > 0; argc--, argv++) {
91 id = name2id(*argv, quotatype, !!(flags & FL_NUMNAMES), NULL);
92- curprivs = getprivs(id, handles, !dirname);
93+ curprivs = getprivs(id, handles, !dir_name);
94 if (!curprivs)
95 die(1, _("Cannot get quota information for user %s.\n"), *argv);
96 if (flags & FL_EDIT_TIMES) {
97diff --git a/quota.c b/quota.c
98index a60de12..66b0fa3 100644
99--- a/quota.c
100+++ b/quota.c
101@@ -20,6 +20,7 @@
102 #include <unistd.h>
103 #include <limits.h>
104 #include <ctype.h>
105+#include <libgen.h>
106 #ifdef RPC
107 #include <rpc/rpc.h>
108 #include "rquota.h"
109diff --git a/quota_nld.c b/quota_nld.c
110index 58a62af..710b556 100644
111--- a/quota_nld.c
112+++ b/quota_nld.c
113@@ -26,6 +26,7 @@
114 #include <fcntl.h>
115 #include <limits.h>
116 #include <signal.h>
117+#include <libgen.h>
118 #include <sys/stat.h>
119 #include <asm/types.h>
120
121diff --git a/quotacheck.c b/quotacheck.c
122index e2c3bbd..fa1d297 100644
123--- a/quotacheck.c
124+++ b/quotacheck.c
125@@ -19,6 +19,7 @@
126 #include <unistd.h>
127 #include <stdlib.h>
128 #include <errno.h>
129+#include <libgen.h>
130
131 #include <sys/stat.h>
132 #include <sys/types.h>
133diff --git a/quotaon.c b/quotaon.c
134index 351c851..17b6bcc 100644
135--- a/quotaon.c
136+++ b/quotaon.c
137@@ -13,6 +13,7 @@
138 #include <string.h>
139 #include <stdlib.h>
140 #include <stdarg.h>
141+#include <libgen.h>
142
143 #include "quotaon.h"
144 #include "quota.h"
145diff --git a/quotastats.c b/quotastats.c
146index a059812..4076a7d 100644
147--- a/quotastats.c
148+++ b/quotastats.c
149@@ -24,6 +24,7 @@
150 #include <errno.h>
151 #include <string.h>
152 #include <signal.h>
153+#include <libgen.h>
154
155 #include "pot.h"
156 #include "common.h"
157diff --git a/quotasync.c b/quotasync.c
158index cad2a20..e90b24a 100644
159--- a/quotasync.c
160+++ b/quotasync.c
161@@ -7,6 +7,7 @@
162 #include <string.h>
163 #include <errno.h>
164 #include <getopt.h>
165+#include <libgen.h>
166
167 #include "pot.h"
168 #include "common.h"
169diff --git a/repquota.c b/repquota.c
170index e79fc4d..8e509bd 100644
171--- a/repquota.c
172+++ b/repquota.c
173@@ -18,6 +18,7 @@
174 #include <pwd.h>
175 #include <grp.h>
176 #include <getopt.h>
177+#include <libgen.h>
178
179 #include "pot.h"
180 #include "common.h"
181diff --git a/rquota_svc.c b/rquota_svc.c
182index 6e856bb..c17df13 100644
183--- a/rquota_svc.c
184+++ b/rquota_svc.c
185@@ -34,6 +34,7 @@
186 #include <signal.h>
187 #include <errno.h>
188 #include <netconfig.h>
189+#include <libgen.h>
190 #ifdef HOSTS_ACCESS
191 #include <tcpd.h>
192 #include <netdb.h>
193diff --git a/setquota.c b/setquota.c
194index c517ab1..9e4b2fa 100644
195--- a/setquota.c
196+++ b/setquota.c
197@@ -18,6 +18,7 @@
198 #include <time.h>
199 #include <ctype.h>
200 #include <stdlib.h>
201+#include <libgen.h>
202
203 #if defined(RPC)
204 #include "rquota.h"
205diff --git a/warnquota.c b/warnquota.c
206index 2882fee..6f63ce7 100644
207--- a/warnquota.c
208+++ b/warnquota.c
209@@ -31,6 +31,7 @@
210 #include <time.h>
211 #include <getopt.h>
212 #include <locale.h>
213+#include <libgen.h>
214 #ifdef HAVE_NL_LANGINFO
215 #include <langinfo.h>
216 #endif
217diff --git a/xqmstats.c b/xqmstats.c
218index 59b1d66..345b060 100644
219--- a/xqmstats.c
220+++ b/xqmstats.c
221@@ -8,6 +8,7 @@
222 #include <stdio.h>
223 #include <unistd.h>
224 #include <string.h>
225+#include <libgen.h>
226 #include "common.h"
227 #include "pot.h"
228
diff --git a/meta/recipes-extended/quota/quota/0001-quota-Use-realloc-3-instead-of-reallocarray-3.patch b/meta/recipes-extended/quota/quota/0001-quota-Use-realloc-3-instead-of-reallocarray-3.patch
deleted file mode 100644
index 34ded2d857..0000000000
--- a/meta/recipes-extended/quota/quota/0001-quota-Use-realloc-3-instead-of-reallocarray-3.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 02b222a335527f1031cc9495d8c5ebc1bc5b1d4e Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Wed, 11 Nov 2020 15:00:47 +0100
4Subject: [PATCH] quota: Use realloc(3) instead of reallocarray(3)
5
6reallocarray(3) has been added to glibc relatively recently (version
72.26, from 2017) and apparently not all users run new enough glibc. Just
8use realloc(3) for now since in this case there's no real risk of
9overflow.
10
11Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
12Signed-off-by: Jan Kara <jack@suse.cz>
13Upstream-Status: Backport
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
15---
16 quota.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/quota.c b/quota.c
20index a6ed61f..a60de12 100644
21--- a/quota.c
22+++ b/quota.c
23@@ -385,7 +385,7 @@ int main(int argc, char **argv)
24 break;
25 case 259:
26 fscount++;
27- fsnames = reallocarray(fsnames, fscount, sizeof(char *));
28+ fsnames = realloc(fsnames, fscount * sizeof(char *));
29 if (!fsnames)
30 die(1, _("Not enough memory for filesystem names"));
31 fsnames[fscount - 1] = optarg;
32--
332.17.1
34
diff --git a/meta/recipes-extended/quota/quota/fcntl.patch b/meta/recipes-extended/quota/quota/fcntl.patch
deleted file mode 100644
index 51a770ce6e..0000000000
--- a/meta/recipes-extended/quota/quota/fcntl.patch
+++ /dev/null
@@ -1,71 +0,0 @@
1Include fcntl.h to pacify compiler errors on musl
2like
3
4error: unknown type name 'loff_t'
5Cover rpc headers under proper conditional
6Dont use __P its undefined
7
8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12diff --git a/quota.h b/quota.h
13index 4c21411..d20c217 100644
14--- a/quota.h
15+++ b/quota.h
16@@ -182,6 +182,6 @@ enum {
17 #endif
18 #endif
19
20-long quotactl __P((int, const char *, qid_t, caddr_t));
21+long quotactl (int, const char *, qid_t, caddr_t);
22
23 #endif /* _QUOTA_ */
24diff --git a/quotacheck.c b/quotacheck.c
25index 2cdf475..07c18a7 100644
26--- a/quotacheck.c
27+++ b/quotacheck.c
28@@ -19,6 +19,7 @@
29 #include <unistd.h>
30 #include <stdlib.h>
31 #include <errno.h>
32+#include <fcntl.h>
33
34 #include <sys/stat.h>
35 #include <sys/types.h>
36diff --git a/quotaio.c b/quotaio.c
37index 94ae458..d57fc1a 100644
38--- a/quotaio.c
39+++ b/quotaio.c
40@@ -12,6 +12,7 @@
41 #include <string.h>
42 #include <unistd.h>
43 #include <stdlib.h>
44+#include <fcntl.h>
45 #include <sys/types.h>
46 #include <sys/stat.h>
47 #include <sys/file.h>
48diff --git a/rquota_client.c b/rquota_client.c
49index a3a4ae3..0ffe7a9 100644
50--- a/rquota_client.c
51+++ b/rquota_client.c
52@@ -19,7 +19,9 @@
53
54 #include "config.h"
55
56+#if defined(RPC)
57 #include <rpc/rpc.h>
58+#endif
59 #include <sys/types.h>
60 #include <sys/param.h>
61 #include <sys/stat.h>
62@@ -35,7 +37,9 @@
63 #include <stdint.h>
64
65 #include "mntopt.h"
66+#if defined(RPC)
67 #include "rquota.h"
68+#endif
69 #include "common.h"
70 #include "quotaio.h"
71 #include "quotasys.h"
diff --git a/meta/recipes-extended/quota/quota_4.06.bb b/meta/recipes-extended/quota/quota_4.09.bb
index 19ccbd588a..8e4d4aed8b 100644
--- a/meta/recipes-extended/quota/quota_4.06.bb
+++ b/meta/recipes-extended/quota/quota_4.09.bb
@@ -1,16 +1,16 @@
1SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem" 1SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem"
2SECTION = "base" 2SECTION = "base"
3HOMEPAGE = "http://sourceforge.net/projects/linuxquota/" 3HOMEPAGE = "http://sourceforge.net/projects/linuxquota/"
4DESCRIPTION = "Tools and patches for the Linux Diskquota system as part of the Linux kernel"
4BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136" 5BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136"
5LICENSE = "BSD & GPLv2+ & LGPLv2.1+" 6LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
6LIC_FILES_CHKSUM = "file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \ 7LIC_FILES_CHKSUM = "file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \
7 file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb" 8 file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb"
8 9
9SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \ 10SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \
10 file://fcntl.patch \ 11 file://0001-Fix-building-on-musl.patch \
11 file://0001-quota-Use-realloc-3-instead-of-reallocarray-3.patch \ 12 "
12 " 13SRC_URI[sha256sum] = "9cdaca154bc92afc3117f0e5f5b3208dd5f84583af1cf061c39baa0a2bb142f9"
13SRC_URI[sha256sum] = "2f3e03039f378d4f0d97acdb49daf581dcaad64d2e1ddf129495fd579fbd268d"
14 14
15CVE_PRODUCT = "linux_diskquota" 15CVE_PRODUCT = "linux_diskquota"
16 16
@@ -26,7 +26,7 @@ LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-ltirpc', '', d)}"
26ASNEEDED = "" 26ASNEEDED = ""
27 27
28PACKAGECONFIG ??= "tcp-wrappers rpc bsd" 28PACKAGECONFIG ??= "tcp-wrappers rpc bsd"
29PACKAGECONFIG_libc-musl = "tcp-wrappers rpc" 29PACKAGECONFIG:libc-musl = "tcp-wrappers rpc"
30 30
31PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" 31PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
32PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc" 32PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc"