quota: apply patch to obey tcp-wrappers config

Without this, the tcpwrappers argument wasn't obeyed, and as such the build
wasn't as deterministic as we'd prefer.

(From OE-Core rev: 16bbdef239942276a1740a3b9dfe4e8c34a16b29)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Christopher Larson 2013-11-25 16:56:31 +00:00 committed by Richard Purdie
parent 3c94bfe8c5
commit 82e373fb84
2 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,75 @@
Upstream-status: Pending
--- quota-tools.orig/configure.in
+++ quota-tools/configure.in
@@ -151,33 +151,46 @@ AC_SUBST(QUOTA_NETLINK_PROG)
AC_SUBST(NETLINKLIBS)
AC_SEARCH_LIBS(gethostbyname, nsl)
-AC_MSG_CHECKING(for host_access in -lwrap)
-AC_CACHE_VAL(ac_cv_lib_wrap_main,
- saved_LIBS="$LIBS"
- LIBS="$LIBS -lwrap"
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <tcpd.h>
- struct request_info request;
- int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
- dnl We always restore LIBS as we add -lwrap in the next check
- [ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
- [ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
- ])
-if test ${ac_cv_lib_wrap_main} = yes; then
- AC_CHECK_HEADER(tcpd.h,, [
- echo 'ERROR: could not find tcpd.h - missing TCP wrappers package'
- exit 1
- ])
- LIBS="$LIBS -lwrap"
- AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
- COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
+AC_ARG_WITH(tcpwrappers,
+ [ --with-tcpwrappers=[yes/no/try] Use hosts.allow and hosts.deny for access checking of rpc.rquota [default=yes, if available.]],
+ ,
+ with_tcpwrappers="try")
+
+if test "x$with_tcpwrappers" != xno; then
+ AC_MSG_CHECKING(for host_access in -lwrap)
+ AC_CACHE_VAL(ac_cv_lib_wrap_main,
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS -lwrap"
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <tcpd.h>
+ struct request_info request;
+ int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
+ dnl We always restore LIBS as we add -lwrap in the next try
+ [ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
+ [ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
+ ])
+
+ if test "x$ac_cv_lib_wrap_main" = xyes; then
+ AC_CHECK_HEADER(tcpd.h,, [
+ if test "x$with_tcpwrappers" != xtry; then
+ AC_MSG_ERROR([could not find tcpd.h - missing TCP wrappers package])
+ fi
+ ])
+
+ LIBS="$LIBS -lwrap"
+ AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
+ COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
+ elif test "x$with_tcpwrappers" != xtry; then
+ AC_MSG_ERROR([could not find libwrap - missing TCP wrappers package])
+ fi
fi
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE

View File

@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://quota.c;beginline=1;endline=33;md5=331c7d77744bfe0ad2
file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \
file://config-tcpwrappers.patch"
SRC_URI[md5sum] = "5c2c31e321d2e1322ce12d69ae5c66d6"
SRC_URI[sha256sum] = "a36300bbc126b79b745bf937245092808b4585aa3309ef3335d4ab9d873cd206"