Bump up to 1.3.2.

This commit is contained in:
bojan 2008-07-01 23:55:09 +00:00
parent 155aeeda0f
commit ea6fc4ba68
8 changed files with 35 additions and 354 deletions

View File

@ -1 +1 @@
apr-1.2.12.tar.bz2
apr-1.3.2.tar.bz2

View File

@ -1,157 +0,0 @@
--- apr-1.2.2/include/arch/unix/apr_arch_file_io.h.readdir64
+++ apr-1.2.2/include/arch/unix/apr_arch_file_io.h
@@ -121,11 +124,21 @@
typedef struct stat struct_stat;
#endif
+/* readdir64_r is only used in specific cases: */
+#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
+ && !defined(READDIR_IS_THREAD_SAFE) && defined(HAVE_READDIR64_R)
+#define APR_USE_READDIR64_R
+#endif
+
struct apr_dir_t {
apr_pool_t *pool;
char *dirname;
DIR *dirstruct;
+#ifdef APR_USE_READDIR64_R
+ struct dirent64 *entry;
+#else
struct dirent *entry;
+#endif
};
apr_status_t apr_unix_file_cleanup(void *);
--- apr-1.2.2/file_io/unix/dir.c.readdir64
+++ apr-1.2.2/file_io/unix/dir.c
@@ -77,8 +77,8 @@
* one-byte array. Note: gcc evaluates this at compile time.
*/
apr_size_t dirent_size =
- (sizeof((*new)->entry->d_name) > 1 ?
- sizeof(struct dirent) : sizeof (struct dirent) + 255);
+ sizeof(*(*new)->entry) +
+ (sizeof((*new)->entry->d_name) > 1 ? 0 : 255);
DIR *dir = opendir(dirname);
if (!dir) {
@@ -139,15 +139,34 @@
#endif
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
&& !defined(READDIR_IS_THREAD_SAFE)
+#ifdef APR_USE_READDIR64_R
+ struct dirent64 *retent;
+
+ /* If LFS is enabled and readdir64_r is available, readdir64_r is
+ * used in preference to readdir_r. This allows directories to be
+ * read which contain a (64-bit) inode number which doesn't fit
+ * into the 32-bit apr_ino_t, iff the caller doesn't actually care
+ * about the inode number (i.e. wanted & APR_FINFO_INODE == 0).
+ * (such inodes may be seen in some wonky NFS environments)
+ *
+ * Similarly, if the d_off field cannot be reprented in a 32-bit
+ * offset, the libc readdir_r() would barf; using readdir64_r
+ * bypasses that case entirely since APR does not care about
+ * d_off. */
+
+ ret = readdir64_r(thedir->dirstruct, thedir->entry, &retent);
+#else
+
struct dirent *retent;
ret = readdir_r(thedir->dirstruct, thedir->entry, &retent);
+#endif
- /* Avoid the Linux problem where at end-of-directory thedir->entry
- * is set to NULL, but ret = APR_SUCCESS.
- */
- if(!ret && thedir->entry != retent)
+ /* POSIX treats "end of directory" as a non-error case, so ret
+ * will be zero and retent will be set to NULL in that case. */
+ if (!ret && retent == NULL) {
ret = APR_ENOENT;
+ }
/* Solaris is a bit strange, if there are no more entries in the
* directory, it returns EINVAL. Since this is against POSIX, we
@@ -191,21 +210,38 @@
#endif
#ifdef DIRENT_INODE
if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE != -1) {
+#ifdef APR_USE_READDIR64_R
+ /* If readdir64_r is used, check for the overflow case of trying
+ * to fit a 64-bit integer into a 32-bit integer. */
+ if (sizeof(apr_ino_t) >= sizeof(retent->DIRENT_INODE)
+ || (apr_ino_t)retent->DIRENT_INODE == retent->DIRENT_INODE) {
+ wanted &= ~APR_FINFO_INODE;
+ } else {
+ /* Prevent the fallback code below from filling in the
+ * inode if the stat call fails. */
+ retent->DIRENT_INODE = 0;
+ }
+#else
wanted &= ~APR_FINFO_INODE;
+#endif /* APR_USE_READDIR64_R */
}
-#endif
+#endif /* DIRENT_INODE */
wanted &= ~APR_FINFO_NAME;
if (wanted)
{
char fspec[APR_PATH_MAX];
- int off;
- apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
- off = strlen(fspec);
- if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec)))
- fspec[off++] = '/';
- apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off);
+ char *end;
+
+ end = apr_cpystrn(fspec, thedir->dirname, sizeof fspec);
+
+ if (end > fspec && end[-1] != '/' && (end < fspec + APR_PATH_MAX))
+ *end++ = '/';
+
+ apr_cpystrn(end, thedir->entry->d_name,
+ sizeof fspec - (end - fspec));
+
ret = apr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool);
/* We passed a stack name that will disappear */
finfo->fname = NULL;
--- apr-1.2.2/file_io/unix/filestat.c.readdir64
+++ apr-1.2.2/file_io/unix/filestat.c
@@ -77,9 +77,18 @@
finfo->user = info->st_uid;
finfo->group = info->st_gid;
finfo->size = info->st_size;
- finfo->inode = info->st_ino;
finfo->device = info->st_dev;
finfo->nlink = info->st_nlink;
+
+ /* Check for overflow if storing a 64-bit st_ino in a 32-bit
+ * apr_ino_t for LFS builds: */
+ if (sizeof(apr_ino_t) >= sizeof(info->st_ino)
+ || (apr_ino_t)info->st_ino == info->st_ino) {
+ finfo->inode = info->st_ino;
+ } else {
+ finfo->valid &= ~APR_FINFO_INODE;
+ }
+
apr_time_ansi_put(&finfo->atime, info->st_atime);
apr_time_ansi_put(&finfo->mtime, info->st_mtime);
apr_time_ansi_put(&finfo->ctime, info->st_ctime);
--- apr-1.2.2/configure.in.readdir64
+++ apr-1.2.2/configure.in
@@ -1382,6 +1382,10 @@
AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0")
AC_CHECK_FUNC($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")
+if test "$ac_cv_sizeof_long" = "4"; then
+ AC_CHECK_FUNCS([readdir64_r])
+fi
+
dnl ----------------------------- We have a fallback position
if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then
int64_strfn="strtoq"

View File

@ -1,38 +0,0 @@
Author: jorton
Date: Wed Jul 19 04:07:31 2006
New Revision: 423435
URL: http://svn.apache.org/viewvc?rev=423435&view=rev
Log:
* build/apr_common.m4 (APR_CONFIG_NICE, APR_PARSE_ARGUMENTS): Fix to
remove assumption that $@ is preserved forever - it never was in any
autoconf release; autoconf 2.60 happens to overwrite it earlier.
--- apr-1.2.7/build/apr_common.m4.ac260
+++ apr-1.2.7/build/apr_common.m4
@@ -64,7 +64,12 @@
echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1
fi
- for arg in [$]0 "[$]@"; do
+ # Retrieve command-line arguments.
+ eval "set x $[0] $ac_configure_args"
+ shift
+
+ for arg
+ do
APR_EXPAND_VAR(arg, $arg)
echo "\"[$]arg\" \\" >> $1
done
@@ -800,6 +805,10 @@
dnl set ups.
AC_DEFUN(APR_PARSE_ARGUMENTS,[
ac_prev=
+# Retrieve the command-line arguments. The eval is needed because
+# the arguments are quoted to preserve accuracy.
+eval "set x $ac_configure_args"
+shift
for ac_option
do
# If the previous option needs an argument, assign it.

View File

@ -1,132 +0,0 @@
--- apr-1.2.7/test/testsock.c.psprintfpi
+++ apr-1.2.7/test/testsock.c
@@ -207,6 +207,29 @@
APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv);
}
+static void test_print_addr(abts_case *tc, void *data)
+{
+ apr_sockaddr_t *sa;
+ char *s;
+
+ APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr",
+ apr_sockaddr_info_get(&sa, "0.0.0.0", APR_INET, 80, 0, p));
+
+ s = apr_psprintf(p, "foo %pI bar", sa);
+
+ ABTS_STR_EQUAL(tc, "foo 0.0.0.0:80 bar", s);
+
+#if APR_HAVE_IPV6
+ if (apr_sockaddr_info_get(&sa, "::ffff:0.0.0.0", APR_INET6, 80, 0, p) == APR_SUCCESS) {
+ /* sa should now be a v4-mapped IPv6 address. */
+
+ s = apr_psprintf(p, "%pI", sa);
+
+ ABTS_STR_EQUAL(tc, "0.0.0.0:80", s);
+ }
+#endif
+}
+
static void test_get_addr(abts_case *tc, void *data)
{
apr_status_t rv;
@@ -284,6 +307,7 @@
abts_run_test(suite, test_send, NULL);
abts_run_test(suite, test_recv, NULL);
abts_run_test(suite, test_timeout, NULL);
+ abts_run_test(suite, test_print_addr, NULL);
abts_run_test(suite, test_get_addr, NULL);
return suite;
--- apr-1.2.7/strings/apr_snprintf.c.psprintfpi
+++ apr-1.2.7/strings/apr_snprintf.c
@@ -473,7 +474,14 @@
p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len);
*--p = ':';
- apr_sockaddr_ip_get(&ipaddr_str, sa);
+ ipaddr_str = buf_end - NUM_BUF_SIZE;
+ if (apr__sockaddr_ip_getbuf(ipaddr_str, sa->addr_str_len, sa)) {
+ /* Should only fail if the buffer is too small, which it
+ * should not be; but fail safe anyway: */
+ *--p = '?';
+ *len = buf_end - p;
+ return p;
+ }
sub_len = strlen(ipaddr_str);
#if APR_HAVE_IPV6
if (sa->family == APR_INET6 &&
--- apr-1.2.7/include/arch/apr_private_common.h.psprintfpi
+++ apr-1.2.7/include/arch/apr_private_common.h
@@ -23,6 +23,7 @@
#include "apr_pools.h"
#include "apr_tables.h"
+#include "apr_network_io.h"
apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts,
const char *liststr,
@@ -34,6 +35,13 @@
char separator,
apr_pool_t *p);
+/* This is a non-allocating version of apr_sockaddr_ip_get() which is
+ * used internally (in 1.2.x) by the vformatter implementation.
+ * Writes the address to @param buf which is of length @buflen.
+ */
+apr_status_t apr__sockaddr_ip_getbuf(char *buf, apr_size_t buflen,
+ apr_sockaddr_t *sockaddr);
+
/* temporary defines to handle 64bit compile mismatches */
#define APR_INT_TRUNC_CAST int
#define APR_UINT32_TRUNC_CAST apr_uint32_t
--- apr-1.2.7/network_io/unix/sockaddr.c.psprintfpi
+++ apr-1.2.7/network_io/unix/sockaddr.c
@@ -98,27 +98,37 @@
}
}
-APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
- apr_sockaddr_t *sockaddr)
+apr_status_t apr__sockaddr_ip_getbuf(char *buf, apr_size_t buflen,
+ apr_sockaddr_t *sockaddr)
{
- *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len);
- apr_inet_ntop(sockaddr->family,
- sockaddr->ipaddr_ptr,
- *addr,
- sockaddr->addr_str_len);
+ if (!apr_inet_ntop(sockaddr->family, sockaddr->ipaddr_ptr, buf, buflen)) {
+ return APR_ENOSPC;
+ }
+
#if APR_HAVE_IPV6
- if (sockaddr->family == AF_INET6 &&
- IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) {
+ if (sockaddr->family == AF_INET6
+ && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)
+ && buflen > strlen("::ffff:")) {
/* This is an IPv4-mapped IPv6 address; drop the leading
* part of the address string so we're left with the familiar
* IPv4 format.
*/
- *addr += strlen("::ffff:");
+ memmove(buf, buf + strlen("::ffff:"),
+ strlen(buf + strlen("::ffff:"))+1);
}
#endif
+ /* ensure NUL termination if the buffer is too short */
+ buf[buflen-1] = '\0';
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
+ apr_sockaddr_t *sockaddr)
+{
+ *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len);
+ return apr__sockaddr_ip_getbuf(*addr, sockaddr->addr_str_len, sockaddr);
+}
+
void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port)
{
addr->family = family;

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iQEVAwUARW1y/PcTqHkQ/eB1AQLFUQf+PaY0dTvgLtl6IyDw66XCOXj2yyKZVLYe
h1peSdPKjEhM4aIc90wjkdYLeomhnSU4AkNHVtplzH0Tlq0mstiBW2zdOtSrJ1Cw
KFhhZgcKyrRBUaA0TM+MwrG82mXGYmbR581CXOuzjePPMMPIexyGZnWIIT2PKBiH
ODYiXMvAW4Iow9Nmynck+LWLD3CcvhIprsGwjaLAswcrOxSVqrGnU368MZxOFlb9
D/bT7/zXoaNW0xpJDPo+09u7ZoqbWA7t4/3k4+cYaQ/824CqkbEOgsX7Z7zl9MHa
tZ/cvZ9egYilg7nqEd6XT/7yki4nNViJ4cSlErDAQD4dwxXiBEhKbQ==
=wuT1
-----END PGP SIGNATURE-----

17
apr-1.3.2.tar.bz2.asc Normal file
View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iQIVAwUASFe704FUZ7bLm57FAQJZbxAAniEjTNwAFN7Gw/H5nhDeYnBggmJ0aT0X
qxov51B3JgS2q/lgOWV+0BzdZ+8DrtFqgvM/xdJLJG3L3rZ0ExMzNpIvGKrL9JB+
MZWcjej7lJz4d2/tt5y3jEDU96tUhUsxWYOVPjkINv5cWmxxtArjY3Ej3ja25aGi
f06KLIe1kyzP1x7TvOtN5Gp70qyDbOnW/i+Aay/oBeEzr5nAbZXXhOkf6KWW9pzF
i6UMuf1HW6lY8C/yj7bLr5fBWQ10vlOThN9RLiVixJLznsu7Q1GnWu1AVNDKRoge
O9PtqM2EJuzfFt3o9Gm3KWwRGNNM2tzPkt3Tr5yz7/GgleON4zkKg9jBTf+vgzMT
dDGljyuATTjGfDm9+3vlWViytDPRnVNM3Dtqs2SMk7Rnl6BWDPjnV0VqHa41p+Oy
KO1eyhmSp/6qoNmqhZtIauqvs0AySZNNQI/o1kTFtevyrXJKPTPAY7y56daDYXbb
MZ/gUkwAa3LQilH0It16SjusRDXCcvdeBu/iF9hwctZrH5S+euSJItstPLk6Ubv+
g5s/2/I4YMFMKkIgBgQV+HFMuKx9OCYIWZ8+FYspQwNwtXPDcmPZ2pWEY9mti8bJ
lBVtLunj8oNqWs4WRzrDOnhz7iGpWoTNHy2bipjW3OOGn+HcaQYgaohdJVThhsmK
w+UbckGyY+0=
=1sfT
-----END PGP SIGNATURE-----

View File

@ -5,19 +5,17 @@
Summary: Apache Portable Runtime library
Name: apr
Version: 1.2.12
Release: 2%{?dist}
Version: 1.3.2
Release: 1%{?dist}
License: ASL 2.0
Group: System Environment/Libraries
URL: http://apr.apache.org/
Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
Source1: apr-wrapper.h
Patch1: apr-0.9.6-readdir64.patch
Patch2: apr-0.9.7-deepbind.patch
Patch3: apr-1.2.2-locktimeout.patch
Patch4: apr-1.2.2-libdir.patch
Patch5: apr-1.2.7-pkgconf.patch
Patch6: apr-1.2.7-psprintfpi.patch
Patch1: apr-0.9.7-deepbind.patch
Patch2: apr-1.2.2-locktimeout.patch
Patch3: apr-1.2.2-libdir.patch
Patch4: apr-1.2.7-pkgconf.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: autoconf, libtool, e2fsprogs-devel, python
@ -41,12 +39,10 @@ C data structures and routines.
%prep
%setup -q
%patch1 -p1 -b .readdir64
%patch2 -p1 -b .deepbind
%patch3 -p1 -b .locktimeout
%patch4 -p1 -b .libdir
%patch5 -p1 -b .pkgconf
%patch6 -p1 -b .psprintfpi
%patch1 -p1 -b .deepbind
%patch2 -p1 -b .locktimeout
%patch3 -p1 -b .libdir
%patch4 -p1 -b .pkgconf
%build
# regenerate configure script etc.
@ -121,6 +117,12 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/apr-%{aprver}/*.h
%changelog
* Thu Jun 19 2008 Bojan Smojver <bojan@rexursive.com> - 1.3.2-1
- bump up to 1.3.2
* Sun Jun 1 2008 Bojan Smojver <bojan@rexursive.com> - 1.3.0-1
- bump up to 1.3.0
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.12-2
- Autorebuild for GCC 4.3

View File

@ -1 +1 @@
c5da94517e3918f0f2b2e0a05f56aa21 apr-1.2.12.tar.bz2
a0631c63640176371dd4a5bf13beeee8 apr-1.3.2.tar.bz2