Skip to contentSkip to conversation

Make quota compile pass when disable rpc

PATCH New [email protected] 1 participant 2 messages Jul 19, 2016

lore
Share & tools
lore
#0 lore raw

cover Make quota compile pass when disable rpc

From: Kai Kang <[email protected]>

The following changes since commit 627d01997fcf6a0581d88047735769ffb2592b82:

useradd-staticids: use map() instead of imap() (2016-07-12 23:12:00 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib kangkai/quota
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/quota

Kai Kang (1):
quota: make compile pass when disable rpc

 .../0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch  |  83 +++++++++++
 ...ing-on-systems-that-do-not-have-rpc-heade.patch | 153 +++++++++++++++++++++
 ...-rpc.rquotad-when-disable-rpc-was-request.patch |  62 +++++++++
 ...0004-Fix-warnings-due-to-missing-stdlib.h.patch |  46 +++++++
 meta/recipes-extended/quota/quota/fcntl.patch      |  28 ----
 meta/recipes-extended/quota/quota_4.03.bb          |   8 +-
 6 files changed, 350 insertions(+), 30 deletions(-)
 create mode 100644 meta/recipes-extended/quota/quota/0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch
 create mode 100644 meta/recipes-extended/quota/quota/0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch
 create mode 100644 meta/recipes-extended/quota/quota/0003-Don-t-build-rpc.rquotad-when-disable-rpc-was-request.patch
 create mode 100644 meta/recipes-extended/quota/quota/0004-Fix-warnings-due-to-missing-stdlib.h.patch
Signature · 1 line
2.6.1
#1 lore raw

PATCH 1/1 quota: make compile pass when disable rpc

From: Kai Kang <[email protected]>

When 'rpc' is not in PACKAGECONFIG, option '--disable-rpc' is passed to configure and then compile fails. Backport patches to make quota build successfully.

Update fcntl.patch that part of the patches are added by 0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch.

---
 .../0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch  |  83 +++++++++++
 ...ing-on-systems-that-do-not-have-rpc-heade.patch | 153 +++++++++++++++++++++
 ...-rpc.rquotad-when-disable-rpc-was-request.patch |  62 +++++++++
 ...0004-Fix-warnings-due-to-missing-stdlib.h.patch |  46 +++++++
 meta/recipes-extended/quota/quota/fcntl.patch      |  28 ----
 meta/recipes-extended/quota/quota_4.03.bb          |   8 +-
 6 files changed, 350 insertions(+), 30 deletions(-)
 create mode 100644 meta/recipes-extended/quota/quota/0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch
 create mode 100644 meta/recipes-extended/quota/quota/0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch
 create mode 100644 meta/recipes-extended/quota/quota/0003-Don-t-build-rpc.rquotad-when-disable-rpc-was-request.patch
 create mode 100644 meta/recipes-extended/quota/quota/0004-Fix-warnings-due-to-missing-stdlib.h.patch
meta/recipes-extended/quota/quota/0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch new file +83 -0
new file mode 100644
index 0000000..6fb2daf
@@ -0,0 +1,83 @@
+Upstream-Status: Backport
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+From feca6d2e55d992bbe176ee8faa734c105eb1b2e1 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <[email protected]>
+Date: Tue, 29 Mar 2016 20:48:05 -0400
+Subject: [PATCH] Use NGROUPS_MAX instead of NGROUPS
+
+NGRROUPS_MAX is what is defined by SuSv3; NGROUPS is not guaranteed by
+any standard, but is just an ancient BSD'ism.  Since Android's bionic
+libc has the former but not the latter, let's use NGROUPS_MAX instead.
+
+Signed-off-by: Theodore Ts'o <[email protected]>
+Signed-off-by: Jan Kara <[email protected]>
+---
+ quota.c    | 5 +++--
+ quotaops.c | 5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/quota.c b/quota.c
+index 049dac4..e195ead 100644
+--- a/quota.c
++++ b/quota.c
+@@ -48,6 +48,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <limits.h>
+ #ifdef RPC
+ #include <rpc/rpc.h>
+ #include "rquota.h"
+@@ -296,7 +297,7 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
+ int main(int argc, char **argv)
+ {
+ 	int ngroups;
+-	gid_t gidset[NGROUPS], *gidsetp;
++	gid_t gidset[NGROUPS_MAX], *gidsetp;
+ 	int i, ret;
+ 	struct option long_opts[] = {
+ 		{ "help", 0, NULL, 'h' },
+@@ -405,7 +406,7 @@ int main(int argc, char **argv)
+ 			ret |= showquotas(USRQUOTA, getuid(), argc, argv);
+ 		if (flags & FL_GROUP) {
+ 			ngroups = sysconf(_SC_NGROUPS_MAX);
+-			if (ngroups > NGROUPS) {
++			if (ngroups > NGROUPS_MAX) {
+ 				gidsetp = malloc(ngroups * sizeof(gid_t));
+ 				if (!gidsetp)
+ 					die(1, _("Gid set allocation (%d): %s\n"), ngroups, strerror(errno));
+diff --git a/quotaops.c b/quotaops.c
+index 136aec3..590dc1b 100644
+--- a/quotaops.c
++++ b/quotaops.c
+@@ -51,6 +51,7 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <ctype.h>
++#include <limits.h>
+ 
+ #if defined(RPC)
+ #include "rquota.h"
+@@ -97,7 +98,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet)
+ #if defined(BSD_BEHAVIOUR)
+ 	int j, ngroups;
+ 	uid_t euid;
+-	gid_t gidset[NGROUPS], *gidsetp;
++	gid_t gidset[NGROUPS_MAX], *gidsetp;
+ #endif
+ 
+ 	for (i = 0; handles[i]; i++) {
+@@ -115,7 +116,7 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet)
+ 				if (geteuid() == 0)
+ 					break;
+ 				ngroups = sysconf(_SC_NGROUPS_MAX);
+-				if (ngroups > NGROUPS) {
++				if (ngroups > NGROUPS_MAX) {
+ 					gidsetp = malloc(ngroups * sizeof(gid_t));
+ 					if (!gidsetp) {
+ 						gid2group(id, name);
+-- 
+2.6.1
+
meta/recipes-extended/quota/quota/0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch new file +153 -0

153 lines not on this page · raw message

meta/recipes-extended/quota/quota/0003-Don-t-build-rpc.rquotad-when-disable-rpc-was-request.patch new file +62 -0

62 lines not on this page · raw message

meta/recipes-extended/quota/quota/0004-Fix-warnings-due-to-missing-stdlib.h.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-extended/quota/quota/fcntl.patch +0 -28
index 27e60fd..2d37971 100644
@@ -59,20 +59,6 @@ Index: quota-tools/dqblk_v2.h
  #include <sys/types.h>
  #include "quota_tree.h"
  
-Index: quota-tools/quotaops.c
-===================================================================
---- quota-tools.orig/quotaops.c
-+++ quota-tools/quotaops.c
-@@ -34,7 +34,9 @@
- 
- #include "config.h"
- 
-+#if defined(RPC)
- #include <rpc/rpc.h>
-+#endif
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/file.h>
 Index: quota-tools/rquota_client.c
 ===================================================================
 --- quota-tools.orig/rquota_client.c
@@ -97,17 +83,3 @@ Index: quota-tools/rquota_client.c
  #include "common.h"
  #include "quotaio.h"
  #include "quotasys.h"
-Index: quota-tools/setquota.c
-===================================================================
---- quota-tools.orig/setquota.c
-+++ quota-tools/setquota.c
-@@ -7,7 +7,9 @@
- 
- #include "config.h"
- 
-+#if defined(RPC)
- #include <rpc/rpc.h>
-+#endif
- #include <sys/types.h>
- #include <errno.h>
- #include <stdio.h>
meta/recipes-extended/quota/quota_4.03.bb +6 -2
index 4a98046..22aab41 100644
@@ -12,6 +12,10 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV
            file://0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch \
            file://fcntl.patch \
            file://remove_non_posix_types.patch \
+           file://0001-Use-NGROUPS_MAX-instead-of-NGROUPS.patch \
+           file://0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch \
+           file://0003-Don-t-build-rpc.rquotad-when-disable-rpc-was-request.patch \
+           file://0004-Fix-warnings-due-to-missing-stdlib.h.patch \
           "
 SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch"
 
@@ -25,8 +29,8 @@ DEPENDS = "gettext-native e2fsprogs libnl dbus"
 
 inherit autotools-brokensep gettext pkgconfig
 
-CFLAGS += "-I${STAGING_INCDIR}/tirpc"
-LDFLAGS += "-ltirpc"
+CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-I${STAGING_INCDIR}/tirpc', '', d)}"
+LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-ltirpc', '', d)}"
 ASNEEDED = ""
 
 PACKAGECONFIG ??= "tcp-wrappers rpc bsd"
Signature · 1 line
2.6.1