X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Funix_apply.c;h=077b49db9aa9e694dbe85f6536d3c3c9907e6cea;hp=25b28f9d368d3b792eda7832e69fbe9af0e99ad7;hb=9e3ef4570081d0d9113dde0c0a1760c64498c0e4;hpb=57318a10de8d50cd338fa4c0e4e0b9f60e7c0143 diff --git a/src/unix_apply.c b/src/unix_apply.c index 25b28f9d..077b49db 100644 --- a/src/unix_apply.c +++ b/src/unix_apply.c @@ -64,7 +64,7 @@ unix_get_supported_features(const char *target, } #define NUM_PATHBUFS 2 /* We need 2 when creating hard links */ -#define MAX_OPEN_FDS 1024 /* TODO: Add special case for when the number of +#define MAX_OPEN_FDS 1000 /* TODO: Add special case for when the number of identical streams exceeds this number. */ struct unix_apply_ctx { @@ -543,6 +543,11 @@ unix_begin_extract_stream_instance(const struct wim_lookup_table_entry *stream, return 0; } + if (ctx->num_open_fds == MAX_OPEN_FDS) { + ERROR("Can't extract data: too many open files!"); + return WIMLIB_ERR_UNSUPPORTED; + } + first_dentry = inode_first_extraction_dentry(inode); first_path = unix_build_extraction_path(first_dentry, ctx); retry_create: @@ -625,13 +630,17 @@ unix_end_extract_stream(struct wim_lookup_table_entry *stream, int status, /* We finally have the symlink data, so we can create * the symlink. */ const char *path; + bool rpfix; + + rpfix = (ctx->common.extract_flags & + WIMLIB_EXTRACT_FLAG_RPFIX) && + !inode->i_not_rpfixed; path = unix_build_inode_extraction_path(inode, ctx); ret = unix_create_symlink(inode, path, ctx->reparse_data, stream->size, - (ctx->common.extract_flags & - WIMLIB_EXTRACT_FLAG_RPFIX), + rpfix, ctx->target_abspath, ctx->target_abspath_nchars); if (ret) {