X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fntfs-3g_apply.c;h=d1cebb9cd1fa05f8ae7d052830a5263c6ebdbd40;hb=efdb571bf22033727f0d15bb161614686e5bcf66;hp=ff145a61871a2cc98184bd9599672b8a0085ee7b;hpb=57318a10de8d50cd338fa4c0e4e0b9f60e7c0143;p=wimlib diff --git a/src/ntfs-3g_apply.c b/src/ntfs-3g_apply.c index ff145a61..d1cebb9c 100644 --- a/src/ntfs-3g_apply.c +++ b/src/ntfs-3g_apply.c @@ -70,8 +70,6 @@ ntfs_3g_get_supported_features(const char *target, return 0; } -#define MAX_OPEN_ATTRS 1024 - struct ntfs_3g_apply_ctx { /* Extract flags, the pointer to the WIMStruct, etc. */ struct apply_ctx common; @@ -79,9 +77,9 @@ struct ntfs_3g_apply_ctx { /* Pointer to the open NTFS volume */ ntfs_volume *vol; - ntfs_attr *open_attrs[MAX_OPEN_ATTRS]; + ntfs_attr *open_attrs[MAX_OPEN_STREAMS]; unsigned num_open_attrs; - ntfs_inode *open_inodes[MAX_OPEN_ATTRS]; + ntfs_inode *open_inodes[MAX_OPEN_STREAMS]; unsigned num_open_inodes; struct reparse_buffer_disk rpbuf; @@ -91,8 +89,8 @@ struct ntfs_3g_apply_ctx { u64 offset; unsigned num_reparse_inodes; - ntfs_inode *ntfs_reparse_inodes[MAX_OPEN_ATTRS]; - struct wim_inode *wim_reparse_inodes[MAX_OPEN_ATTRS]; + ntfs_inode *ntfs_reparse_inodes[MAX_OPEN_STREAMS]; + struct wim_inode *wim_reparse_inodes[MAX_OPEN_STREAMS]; }; static size_t @@ -403,9 +401,10 @@ ntfs_3g_set_metadata(ntfs_inode *ni, const struct wim_inode *inode, ERROR_WITH_ERRNO("Failed to set security descriptor " "on \"%s\" in NTFS volume", dentry_full_path(one_dentry)); - fprintf(stderr, "The security descriptor is: "); - print_byte_field(desc, desc_size, stderr); - fprintf(stderr, "\n"); + fprintf(wimlib_error_file, + "The security descriptor is: "); + print_byte_field(desc, desc_size, wimlib_error_file); + fprintf(wimlib_error_file, "\n"); } return ret; } @@ -627,7 +626,6 @@ ntfs_3g_create_nondirectory(struct wim_inode *inode, /* Create additional links if present. */ next = inode->i_extraction_aliases.next; - ret = 0; do { dentry = list_entry(next, struct wim_dentry, d_extraction_alias_node); @@ -726,6 +724,9 @@ ntfs_3g_begin_extract_stream_to_attr(struct wim_lookup_table_entry *stream, return WIMLIB_ERR_NTFS_3G; } + /* This should be ensured by extract_stream_list() */ + wimlib_assert(ctx->num_open_attrs < MAX_OPEN_STREAMS); + attr = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_nchars); if (!attr) { ERROR_WITH_ERRNO("Failed to open data stream of \"%s\"", @@ -791,8 +792,7 @@ ntfs_3g_open_inode(struct wim_inode *inode, struct ntfs_3g_apply_ctx *ctx) } static int -ntfs_3g_begin_extract_stream(struct wim_lookup_table_entry *stream, - u32 flags, void *_ctx) +ntfs_3g_begin_extract_stream(struct wim_lookup_table_entry *stream, void *_ctx) { struct ntfs_3g_apply_ctx *ctx = _ctx; const struct stream_owner *owners = stream_owners(stream);