Unverified Commit 14fe7ba3 authored by Jan Kotanski's avatar Jan Kotanski
Browse files

add patches

parent c50cab0b
commit b1eb1b3ee8693e2a56b074315b521c66255acca1
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Thu Sep 1 17:24:24 2016 -0500
Replace assertion in H5O_dtype_decode_helper for number of array dimensions with a check and error. The assertion was inappropriate because it is operating on data read from the file, which the library does not always have direct control of.
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index e51d319..eae542b 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -519,7 +519,8 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
dt->shared->u.array.ndims = *(*pp)++;
/* Double-check the number of dimensions */
- HDassert(dt->shared->u.array.ndims <= H5S_MAX_RANK);
+ if(dt->shared->u.array.ndims > H5S_MAX_RANK)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "too many dimensions for array datatype")
/* Skip reserved bytes, if version has them */
if(version < H5O_DTYPE_VERSION_3)
commit 2409f991667283f8fa1dacc66f245950693495aa
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Thu Sep 8 10:48:54 2016 -0500
Fix issues in H5Znbit.c where the decompression algorithm would not check the compressed data for validity, potentially causing a buffer overflow.
Index: hdf5/src/H5Znbit.c
===================================================================
--- hdf5.orig/src/H5Znbit.c
+++ hdf5/src/H5Znbit.c
@@ -60,11 +60,11 @@ static void H5Z_nbit_decompress_one_noop
unsigned char *buffer, size_t *j, int *buf_len, unsigned size);
static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p);
-static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset,
+static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]);
-static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset,
+static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]);
-static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
const unsigned parms[]);
static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, unsigned size);
@@ -990,7 +990,8 @@ H5Z_filter_nbit(unsigned flags, size_t c
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit decompression")
/* decompress the buffer */
- H5Z_nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, cd_values);
+ if(H5Z__nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, cd_values) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, 0, "can't decompress buffer")
} /* end if */
/* output; compress */
else {
@@ -1139,12 +1140,15 @@ H5Z_nbit_decompress_one_atomic(unsigned
}
}
-static void
-H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset,
+static herr_t
+H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[])
{
unsigned i, total_size, base_class, base_size, n, begin_index;
parms_atomic p;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
total_size = parms[parms_index++];
base_class = parms[parms_index++];
@@ -1155,6 +1159,11 @@ H5Z_nbit_decompress_one_array(unsigned c
p.order = parms[parms_index++];
p.precision = parms[parms_index++];
p.offset = parms[parms_index++];
+
+ /* Check values of precision and offset */
+ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8)
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset")
+
n = total_size/p.size;
for(i = 0; i < n; i++)
H5Z_nbit_decompress_one_atomic(data, data_offset + i*p.size,
@@ -1165,8 +1174,9 @@ H5Z_nbit_decompress_one_array(unsigned c
n = total_size/base_size; /* number of base_type elements inside the array datatype */
begin_index = parms_index;
for(i = 0; i < n; i++) {
- H5Z_nbit_decompress_one_array(data, data_offset + i*base_size,
- buffer, j, buf_len, parms);
+ if(H5Z__nbit_decompress_one_array(data, data_offset + i * base_size,
+ buffer, j, buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array")
parms_index = begin_index;
}
break;
@@ -1175,8 +1185,9 @@ H5Z_nbit_decompress_one_array(unsigned c
n = total_size/base_size; /* number of base_type elements inside the array datatype */
begin_index = parms_index;
for(i = 0; i < n; i++) {
- H5Z_nbit_decompress_one_compound(data, data_offset + i*base_size,
- buffer, j, buf_len, parms);
+ if(H5Z__nbit_decompress_one_compound(data, data_offset + i * base_size,
+ buffer, j, buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound")
parms_index = begin_index;
}
break;
@@ -1187,40 +1198,62 @@ H5Z_nbit_decompress_one_array(unsigned c
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
-static void
-H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset,
+static herr_t
+H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset,
unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[])
{
- unsigned i, nmembers, member_offset, member_class, size;
+ unsigned i, nmembers, member_offset, member_class, member_size, used_size = 0, size;
parms_atomic p;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
- parms_index++; /* skip total size of compound datatype */
+ size = parms[parms_index++];
nmembers = parms[parms_index++];
for(i = 0; i < nmembers; i++) {
member_offset = parms[parms_index++];
member_class = parms[parms_index++];
+
+ /* Check for overflow */
+ member_size = parms[parms_index];
+ used_size += member_size;
+ if(used_size > size)
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "compound member offset overflowed compound size")
switch(member_class) {
case H5Z_NBIT_ATOMIC:
- p.size = parms[parms_index++];
+ p.size = member_size;
+ /* Advance past member size */
+ parms_index++;
p.order = parms[parms_index++];
p.precision = parms[parms_index++];
p.offset = parms[parms_index++];
+
+ /* Check values of precision and offset */
+ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8)
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset")
+
H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset,
buffer, j, buf_len, p);
break;
case H5Z_NBIT_ARRAY:
- H5Z_nbit_decompress_one_array(data, data_offset + member_offset,
- buffer, j, buf_len, parms);
+ if(H5Z__nbit_decompress_one_array(data, data_offset + member_offset,
+ buffer, j, buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array")
break;
case H5Z_NBIT_COMPOUND:
- H5Z_nbit_decompress_one_compound(data, data_offset+member_offset,
- buffer, j, buf_len, parms);
+ if(H5Z__nbit_decompress_one_compound(data, data_offset+member_offset,
+ buffer, j, buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound")
break;
case H5Z_NBIT_NOOPTYPE:
- size = parms[parms_index++];
+ /* Advance past member size */
+ parms_index++;
H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset,
buffer, j, buf_len, size);
break;
@@ -1228,10 +1261,13 @@ H5Z_nbit_decompress_one_compound(unsigne
HDassert(0 && "This Should never be executed!");
} /* end switch */
}
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
-static void
-H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+static herr_t
+H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
const unsigned parms[])
{
/* i: index of data, j: index of buffer,
@@ -1239,6 +1275,9 @@ H5Z_nbit_decompress(unsigned char *data,
size_t i, j, size;
int buf_len;
parms_atomic p;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
/* may not have to initialize to zeros */
for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0;
@@ -1254,6 +1293,11 @@ H5Z_nbit_decompress(unsigned char *data,
p.order = parms[5];
p.precision = parms[6];
p.offset = parms[7];
+
+ /* Check values of precision and offset */
+ if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8)
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset")
+
for(i = 0; i < d_nelmts; i++) {
H5Z_nbit_decompress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p);
}
@@ -1262,7 +1306,8 @@ H5Z_nbit_decompress(unsigned char *data,
size = parms[4];
parms_index = 4;
for(i = 0; i < d_nelmts; i++) {
- H5Z_nbit_decompress_one_array(data, i*size, buffer, &j, &buf_len, parms);
+ if(H5Z__nbit_decompress_one_array(data, i * size, buffer, &j, &buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array")
parms_index = 4;
}
break;
@@ -1270,13 +1315,17 @@ H5Z_nbit_decompress(unsigned char *data,
size = parms[4];
parms_index = 4;
for(i = 0; i < d_nelmts; i++) {
- H5Z_nbit_decompress_one_compound(data, i*size, buffer, &j, &buf_len, parms);
+ if(H5Z__nbit_decompress_one_compound(data, i * size, buffer, &j, &buf_len, parms) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound")
parms_index = 4;
}
break;
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i,
commit 391a231b76c1200ecda5d74636213e9e479fa51a
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Fri Sep 9 12:08:30 2016 -0500
Fix bug in "nooptype" decode in fix for TALOS-0177.
Index: hdf5/src/H5Znbit.c
===================================================================
--- hdf5.orig/src/H5Znbit.c
+++ hdf5/src/H5Znbit.c
@@ -1255,7 +1255,7 @@ H5Z__nbit_decompress_one_compound(unsign
/* Advance past member size */
parms_index++;
H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset,
- buffer, j, buf_len, size);
+ buffer, j, buf_len, member_size);
break;
default:
HDassert(0 && "This Should never be executed!");
commit bfae878d8f2f65bc5f22f0d4bb314f326278ba7b
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Fri Jul 1 10:31:44 2016 -0500
[svn-r30131] Fix bug reported by Cisco Talos TALOS-CAN-0178. Added check for a message that
should not be sharable being marked as sharable on disk, returns failure in
this case. Needs testing.
Tested: ummon
Index: hdf5/src/H5Ocache.c
===================================================================
--- hdf5.orig/src/H5Ocache.c
+++ hdf5/src/H5Ocache.c
@@ -1433,6 +1433,10 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && !(flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
+ if((flags & H5O_MSG_FLAG_SHAREABLE)
+ && H5O_msg_class_g[id]
+ && !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "message of unsharable class flagged as sharable")
/* Reserved bytes/creation index */
if(oh->version == H5O_VERSION_1)
Index: hdf5/src/H5Opkg.h
===================================================================
--- hdf5.orig/src/H5Opkg.h
+++ hdf5/src/H5Opkg.h
@@ -212,6 +212,7 @@
\
/* Set the message's "shared info", if it's shareable */ \
if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \
+ HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \
H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \
} /* end if */ \
\
commit bc10fd219e60fc4b9df7d80567ecb1e39ae5b6e3
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Thu Sep 8 13:47:22 2016 -0500
Change check for number of dimensions for old-style arrays in datatype decoding routine from an assertion to an if/HGOTO_ERROR check, since it is inappropriate to assert the contents of a file will be what we expect.
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index e51d319..3c3f284 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -311,7 +311,11 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
if(version == H5O_DTYPE_VERSION_1) {
/* Decode the number of dimensions */
ndims = *(*pp)++;
- HDassert(ndims <= 4);
+
+ /* Check that ndims is valid */
+ if(ndims > 4)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid number of dimensions for array")
+
*pp += 3; /*reserved bytes */
/* Skip dimension permutation */
Index: hdf5/java/src/jni/h5pFCPLImp.c
===================================================================
--- hdf5.orig/java/src/jni/h5pFCPLImp.c
+++ hdf5/java/src/jni/h5pFCPLImp.c
@@ -240,7 +240,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1sym_1k
done:
if (theArray)
- UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
+ UNPIN_INT_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1sym_1k */
Package: libhdf5-100
Version: 1.10.0-patch1+docs-3
Tags: upstream patch
User: debian-sparc@lists.debian.org
Usertags: sparc64
X-Debbugs-Cc: debian-sparc@lists.debian.org, Ghislain Vaillant <ghisvail@gmail.com>
Control: affects -1 src:h5py
Hi,
Currently libhdf5-100 performs unaligned memory accesses on sparc64 in
certain cases, and this is causing the latest version of h5py to FTBFS
due to the test suite being killed with SIGBUS when doing vlen-related
tests (the tests in question being new in the latest upstream version).
On investigating, there are two issues:
1. NO_ALIGNMENT_RESTRICTIONS is being defined on sparc64. GCC is
sufficiently smart to notice that the test program run when
configuring is performing unaligned accesses, and so instead of
using the usual multi-byte load instructions (which require the
address to be aligned), it expands it out into individual byte
loads, and therefore the test actually succeeds. This is only
because GCC can statically determine that the address is unaligned,
and therefore tries to be helpful (since it knows using multi-byte
loads will never work), whereas for a general address it will assume
the address is aligned and emit a single multi-byte load.
Adding in a few volatile qualifiers in the important places ensures
that GCC can no longer statically prove the relevant addresses are
unaligned, and therefore it uses the normal multi-byte load
instructions and the test program will crash, so configure knows not
to define NO_ALIGNMENT_RESTRICTIONS.
2. Even with that fixed, H5T_vlen_reclaim_recurse needs fixing to
ensure it doesn't perform unaligned accesses when not supported.
With the attached patch, h5py's test suite now passes again. Please feel
free to forward this patch upstream if you deem it acceptable.
Regards,
James
Index: hdf5/config/cmake/ConversionTests.c
===================================================================
--- hdf5.orig/config/cmake/ConversionTests.c
+++ hdf5/config/cmake/ConversionTests.c
@@ -259,13 +259,13 @@ main ()
char *chp = "beefs";
char **chpp = malloc (2 * sizeof (char *));
- char **chpp2;
+ char * volatile *chpp2;
hvl_t vl = { 12345, (void *) chp };
hvl_t *vlp;
- hvl_t *vlp2;
+ hvl_t * volatile vlp2;
memcpy ((void *) ((char *) chpp + 1), &chp, sizeof (char *));
- chpp2 = (char **) ((char *) chpp + 1);
+ chpp2 = (char * volatile *) (chpp + 1);
if (strcmp (*chpp2, chp)) {
free (chpp);
return 1;
@@ -274,7 +274,7 @@ main ()
vlp = malloc (2 * sizeof (hvl_t));
memcpy ((void *) ((char *) vlp + 1), &vl, sizeof (hvl_t));
- vlp2 = (hvl_t *) ((char *) vlp + 1);
+ vlp2 = (hvl_t * volatile) ((char *) vlp + 1);
if (vlp2->len != vl.len || vlp2->p != vl.p) {
free (vlp);
return 1;
Index: hdf5/src/H5Tvlen.c
===================================================================
--- hdf5.orig/src/H5Tvlen.c
+++ hdf5/src/H5Tvlen.c
@@ -1044,35 +1044,64 @@ H5T_vlen_reclaim_recurse(void *elem, con
case H5T_VLEN:
/* Recurse on the VL information if it's VL, compound, enum or array, then free VL sequence */
if(dt->shared->u.vlen.type == H5T_VLEN_SEQUENCE) {
+ void *p;
+ size_t len;
+#ifdef H5_NO_ALIGNMENT_RESTRICTIONS
hvl_t *vl = (hvl_t *)elem; /* Temp. ptr to the vl info */
+ p = vl->p;
+ len = vl->len;
+#else
+ hvl_t vl; /* The vl info */
+ HDmemcpy(&vl, elem, sizeof(hvl_t));
+ p = vl.p;
+ len = vl.len;
+#endif
/* Check if there is anything actually in this sequence */
- if(vl->len!=0) {
+ if(len!=0) {
/* Recurse if it's VL, array, enum or compound */
if(H5T_IS_COMPLEX(dt->shared->parent->shared->type)) {
void *off; /* offset of field */
/* Calculate the offset of each array element and recurse on it */
- while(vl->len > 0) {
- off = ((uint8_t *)vl->p) + (vl->len - 1) * dt->shared->parent->shared->size;
- if(H5T_vlen_reclaim_recurse(off, dt->shared->parent, free_func, free_info) < 0)
+ while(len > 0) {
+ off = ((uint8_t *)p) + (len - 1) * dt->shared->parent->shared->size;
+ if(H5T_vlen_reclaim_recurse(off, dt->shared->parent, free_func, free_info) < 0) {
+#ifdef H5_NO_ALIGNMENT_RESTRICTIONS
+ vl->len = len;
+#else
+ HDmemcpy(((uint8_t *)elem)+HOFFSET(hvl_t, len), &len, sizeof(size_t));
+#endif
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Unable to free VL element")
- vl->len--;
+ }
+ len--;
} /* end while */
+#ifdef H5_NO_ALIGNMENT_RESTRICTIONS
+ vl->len = 0;
+#else
+ HDmemset(((uint8_t *)elem)+HOFFSET(hvl_t, len), 0, sizeof(size_t));
+#endif
} /* end if */
/* Free the VL sequence */
if(free_func != NULL)
- (*free_func)(vl->p, free_info);
+ (*free_func)(p, free_info);
else
- HDfree(vl->p);
+ HDfree(p);
} /* end if */
} else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) {
/* Free the VL string */
+#ifdef H5_NO_ALIGNMENT_RESTRICTIONS
+ char *s=*(char **)elem; /* Pointer to the user's string information */
+#else
+ char *s; /* Pointer to the user's string information */
+ HDmemcpy(&s, elem, sizeof(char *));
+#endif
+
if(free_func != NULL)
- (*free_func)(*(char **)elem, free_info);
+ (*free_func)(s, free_info);
else
- HDfree(*(char **)elem);
+ HDfree(s);
} else {
HDassert(0 && "Invalid VL type");
} /* end else */
Index: hdf5/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
===================================================================
--- hdf5.orig/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
+++ hdf5/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
@@ -32,7 +32,7 @@ package hdf.hdf5lib.exceptions;
* error code returned by the HDF5 library.
*
*/
-public class HDF5Exception extends Exception {
+public class HDF5Exception extends RuntimeException {
protected String detailMessage;
/**
......@@ -9,15 +9,29 @@ Index: hdf5/src/H5Fint.c
===================================================================
--- hdf5.orig/src/H5Fint.c
+++ hdf5/src/H5Fint.c
@@ -1756,7 +1756,6 @@ H5F_build_actual_name(const H5F_t *f, co
int *fd; /* POSIX I/O file descriptor */
h5_stat_t st; /* Stat info from stat() call */
@@ -2282,10 +2282,6 @@ H5F_build_actual_name(const H5F_t *f, co
char **actual_name/*out*/)
{
hid_t new_fapl_id = -1; /* ID for duplicated FAPL */
-#ifdef H5_HAVE_SYMLINK
- /* This has to be declared here to avoid unfreed resources on errors */
- char *realname = NULL; /* Fully resolved path name of file */
-#endif /* H5_HAVE_SYMLINK */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -2319,10 +2315,6 @@ H5F_build_actual_name(const H5F_t *f, co
h5_stat_t fst; /* Stat info from fstat() call */
- char realname[PATH_MAX]; /* Fully resolved path name of file */
hbool_t want_posix_fd; /* Flag for retrieving file descriptor from VFD */
- /* Allocate realname buffer */
- if(NULL == (realname = (char *)H5MM_calloc((size_t)PATH_MAX * sizeof(char))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
/* Perform a sanity check that the file or link wasn't switched
@@ -1793,12 +1792,8 @@ H5F_build_actual_name(const H5F_t *f, co
* between when we opened it and when we called lstat(). This is
* according to the security best practices for lstat() documented
@@ -2357,12 +2349,8 @@ H5F_build_actual_name(const H5F_t *f, co
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "files' st_ino or st_dev fields changed!")
/* Get the resolved path for the file name */
......@@ -31,3 +45,14 @@ Index: hdf5/src/H5Fint.c
} /* end if */
} /* end if */
#endif /* H5_HAVE_SYMLINK */
@@ -2379,10 +2367,6 @@ done:
if(new_fapl_id > 0)
if(H5I_dec_app_ref(new_fapl_id) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL")
-#ifdef H5_HAVE_SYMLINK
- if(realname)
- realname = (char *)H5MM_xfree(realname);
-#endif /* H5_HAVE_SYMLINK */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_build_actual_name() */
......@@ -10,7 +10,7 @@ Index: hdf5/src/H5.c
===================================================================
--- hdf5.orig/src/H5.c
+++ hdf5/src/H5.c
@@ -778,8 +778,7 @@ H5check_version(unsigned majnum, unsigne
@@ -751,8 +751,7 @@ H5check_version(unsigned majnum, unsigne
disable_version_check = (unsigned int)HDstrtol (s, NULL, 0);
}
......@@ -20,3 +20,38 @@ Index: hdf5/src/H5.c
switch (disable_version_check) {
case 0:
HDfprintf(stderr, "%s%s", version_mismatch_warning,
Index: hdf5/test/testcheck_version.sh.in
===================================================================
--- hdf5.orig/test/testcheck_version.sh.in
+++ hdf5/test/testcheck_version.sh.in
@@ -152,8 +152,12 @@ TESTING() {
esac
case "$h5DisableVersion" in
1)
- # W2/OK: Different Warning, exit 0.
- WarnMesg2 > $expect
+ if [ "$wrongversionnumbers" != "r" ]; then
+ # W2/OK: Different Warning, exit 0.
+ WarnMesg2 > $expect
+ else
+ cp /dev/null $expect
+ fi
expect_code=0
;;
[2-9]|[1-9][0-9]*)
@@ -162,8 +166,13 @@ TESTING() {
expect_code=0
;;
*) # W/A: Warning, abort and exit non-0.
- WarnMesg > $expect
- expect_code=6 # Signal Abort exit code (128+6)
+ if [ "$wrongversionnumbers" != "r" ]; then
+ WarnMesg > $expect
+ expect_code=6 # Signal Abort exit code (128+6)
+ else
+ cp /dev/null $expect
+ expect_code=0
+ fi
;;
esac
fi
Index: hdf5/configure.ac
===================================================================
--- hdf5.orig/configure.ac
+++ hdf5/configure.ac
@@ -170,7 +170,7 @@ AC_MSG_RESULT([done])
## Save system information for the library settings file.
##
AC_SUBST([UNAME_INFO])
-UNAME_INFO=`uname -a`
+UNAME_INFO=Debian
## ----------------------------------------------------------------------
## Some platforms have broken basename, and/or xargs programs. Check
@@ -3004,10 +3004,10 @@ H5_VERSION="`cut -d' ' -f3 $srcdir/READM
AC_SUBST([H5_VERSION])