/* Define to 1 if including even more debug messages. */
#undef ENABLE_MORE_DEBUG
+/* Define to 1 if including support for multithreaded compression */
+#undef ENABLE_MULTITHREADED_COMPRESSION
+
/* Define to 1 if using vectorized implementation of SHA1 */
#undef ENABLE_SSSE3_SHA1
*/
#undef LT_OBJDIR
-/* Define to 1 if including support for multithreaded compression */
-#undef MULTITHREADED_COMPRESSION
-
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
)
AC_MSG_RESULT([$ENABLE_MULTITHREADED_COMPRESSION])
if test "x$ENABLE_MULTITHREADED_COMPRESSION" = "xyes"; then
- AC_DEFINE([MULTITHREADED_COMPRESSION], [1],
+ AC_DEFINE([ENABLE_MULTITHREADED_COMPRESSION], [1],
[Define to 1 if including support for multithreaded
compression])
fi
+wimlib (1.1.0-1) unstable; urgency=low
+
+ * Update to v1.1.0
+
+ -- Eric Biggers <ebiggers3@gmail.com> Sun, 18 Nov 2012 13:49:54 -0600
+
wimlib (1.0.4-1) unstable; urgency=low
* Update to v1.0.4
Maintainer: Eric Biggers <ebiggers3@gmail.com>
Build-Depends: debhelper (>= 7.0.0), autotools-dev, pkg-config,
libfuse-dev, libxml2-dev, libssl-dev,
- ntfs-3g-dev (>= 2011.4.12), attr-dev, bash
+ ntfs-3g-dev (>= 2011.4.12), attr-dev, bash, attr
Standards-Version: 3.9.2
Section: libs
Homepage: http://sourceforge.net/projects/wimlib
-#!/bin/bash
+#!/usr/bin/env bash
#
# This script can make a customized bootable image of Windows PE.
#
Summary: Library to extract, create, and modify WIM files
Name: wimlib
-Version: 1.0.4
+Version: 1.1.0
Release: 1
License: GPLv3+
Group: System/Libraries
Summary: Library to extract, create, and modify WIM files
Name: wimlib
-Version: 1.0.4
+Version: 1.1.0
Release: 1
License: GPLv3+
Group: System/Libraries
Summary: Library to extract, create, and modify WIM files
Name: wimlib
-Version: 1.0.4
+Version: 1.1.0
Release: 1
License: GPLv3+
Group: System/Libraries
}
/* Read the integrity table into memory. */
- buf = MALLOC(res_entry->original_size);
- if (!buf) {
+ if ((sizeof(size_t) < sizeof(u64)
+ && res_entry->original_size > ~(size_t)0)
+ || ((buf = MALLOC(res_entry->original_size)) == NULL))
+ {
ERROR("Out of memory (needed %zu bytes for integrity table)",
- res_entry->original_size);
+ (size_t)res_entry->original_size);
ret = WIMLIB_ERR_NOMEM;
goto out;
}
void lte_decrement_num_opened_fds(struct lookup_table_entry *lte)
{
wimlib_assert(lte != NULL);
- wimlib_assert(lte->num_opened_fds != 0);
- if (atomic_dec(<e->num_opened_fds) == 0 && lte->refcnt == 0)
- finalize_lte(lte);
+ if (lte->num_opened_fds != 0) {
+ if (--lte->num_opened_fds == 0 && lte->refcnt == 0)
+ finalize_lte(lte);
+ }
}
#endif
return wimfs_get_context()->wim;
}
+static inline bool wimfs_ctx_readonly(const struct wimfs_context *ctx)
+{
+ return (ctx->mount_flags & WIMLIB_MOUNT_FLAG_READWRITE) == 0;
+}
+
static inline int get_lookup_flags(const struct wimfs_context *ctx)
{
if (ctx->mount_flags & WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS)
* @stream_id: ID of the stream we're opening
* @lte: Lookup table entry for the stream (may be NULL)
* @fd_ret: Return the allocated file descriptor if successful.
+ * @readonly: True if this is a read-only mount.
*
* Return 0 iff successful or error code if unsuccessful.
*/
static int alloc_wimlib_fd(struct inode *inode,
u32 stream_id,
struct lookup_table_entry *lte,
- struct wimlib_fd **fd_ret)
+ struct wimlib_fd **fd_ret,
+ bool readonly)
{
static const u16 fds_per_alloc = 8;
static const u16 max_fds = 0xffff;
*fd_ret = fd;
inode->fds[i] = fd;
inode->num_opened_fds++;
- if (lte)
- atomic_inc(<e->num_opened_fds);
+ if (lte && !readonly)
+ lte->num_opened_fds++;
DEBUG("Allocated fd (idx = %u)", fd->idx);
ret = 0;
break;
return ret;
}
- ret = alloc_wimlib_fd(inode, stream_id, lte, &fd);
+ ret = alloc_wimlib_fd(inode, stream_id, lte, &fd,
+ wimfs_ctx_readonly(ctx));
if (ret != 0)
return ret;
struct inode *inode;
int ret;
struct wimlib_fd *fd = NULL;
- WIMStruct *w = wimfs_get_WIMStruct();
+ struct wimfs_context *ctx = wimfs_get_context();
+ WIMStruct *w = ctx->wim;
inode = wim_pathname_to_inode(w, path);
if (!inode)
return -ENOENT;
if (!inode_is_directory(inode))
return -ENOTDIR;
- ret = alloc_wimlib_fd(inode, 0, NULL, &fd);
+ ret = alloc_wimlib_fd(inode, 0, NULL, &fd, wimfs_ctx_readonly(ctx));
fi->fh = (uintptr_t)fd;
return ret;
}
#endif
.write = wimfs_write,
+#if FUSE_MAJOR_VERSION > 2 || (FUSE_MAJOR_VERSION == 2 && FUSE_MINOR_VERSION >= 8)
.flag_nullpath_ok = 1,
+#endif
+#if FUSE_MAJOR_VERSION > 2 || (FUSE_MAJOR_VERSION == 2 && FUSE_MINOR_VERSION >= 9)
.flag_nopath = 1,
.flag_utime_omit_ok = 1,
+#endif
};
}
if (wim_resource_size(lte) >= 0xffff) {
- ERROR("Reparse data of `%s' is too long (%lu bytes)",
+ ERROR("Reparse data of `%s' is too long (%"PRIu64" bytes)",
dentry->full_path_utf8, wim_resource_size(lte));
return WIMLIB_ERR_INVALID_DENTRY;
}
# define HOT
#endif /* __GNUC__ */
+
+#if 0
#ifdef WITH_FUSE
#define atomic_inc(ptr) \
__sync_fetch_and_add(ptr, 1)
#define atomic_dec(ptr) \
__sync_sub_and_fetch(ptr, 1)
#endif
+#endif
#ifndef _NTFS_TYPES_H
typedef uint8_t u8;
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
+#else
+#include <stdlib.h>
#endif
-
/* Reopens the FILE* for a WIM read-write. */
static int reopen_rw(WIMStruct *w)
{
return ret;
}
+
+static const char *get_data_type(int ctype)
+{
+ switch (ctype) {
+ case WIM_COMPRESSION_TYPE_NONE:
+ return "uncompressed";
+ case WIM_COMPRESSION_TYPE_LZX:
+ return "LZX-compressed";
+ case WIM_COMPRESSION_TYPE_XPRESS:
+ return "XPRESS-compressed";
+ }
+}
+
static int write_stream_list_parallel(struct list_head *stream_list,
FILE *out_fp, int out_ctype,
int write_flags, u64 total_size,
}
if (write_flags & WIMLIB_WRITE_FLAG_SHOW_PROGRESS) {
- printf("Writing compressed data using %u threads...\n",
- num_threads);
+ printf("Writing %s compressed data using %u threads...\n",
+ get_data_type(out_ctype), num_threads);
}
ret = main_writer_thread_proc(stream_list,
const char *reason = "";
if (!compression_needed)
reason = " (no compression needed)";
- printf("Writing data using 1 thread%s\n", reason);
+ printf("Writing %s data using 1 thread%s\n",
+ get_data_type(out_ctype), reason);
}
return write_stream_list_serial(stream_list, out_fp,
-#!/bin/bash
+#!/usr/bin/env bash
# This script does some sanity testing of the 'imagex' program. It by no means
# tests every aspect of wimlib comprehensively.
-#!/bin/bash
+#!/usr/bin/env bash
# Test capturing and applying a WIM image in the normal (non-NTFS) capture mode
#
-#!/bin/bash
+#!/usr/bin/env bash
# Test WIM mounting
fi
cd tmp.mnt
- if ! tar xf ../test.tar; then
+ if ! tar xf ../test.tar --no-same-owner; then
error "Failed to untar archive on read-write mounted WIM"
fi
cd ..
fi
cd tmp.mnt
- if ! tar xf ../test.tar; then
+ if ! tar xf ../test.tar --no-same-owner; then
error "Failed to untar archive on read-write mounted WIM"
fi
cd ..
-#!/bin/bash
+#!/usr/bin/env bash
# This script does some sanity testing of the 'imagex' program, specifically
# checking the NTFS capture and apply features.