X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fmount_image.c;h=ce4a58432d51f081256a26c550c1fb5d369895fa;hp=cc1c57dc90f8def293b3d186cb39703be54441e7;hb=2fa590c75e9433779557999870f0c8136157c2b7;hpb=465a630d28e93b09e55ca07b1a6cae8def3b42f5 diff --git a/src/mount_image.c b/src/mount_image.c index cc1c57dc..ce4a5843 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -1646,7 +1646,7 @@ wimfs_getxattr(const char *path, const char *name, char *value, if (!(ctx->mount_flags & WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR)) return -ENOTSUP; - if (strlen(name) < 5 || memcmp(name, "user.", 5) != 0) + if (strlen(name) <= 5 || memcmp(name, "user.", 5) != 0) return -ENOATTR; name += 5; @@ -1740,6 +1740,10 @@ wimfs_listxattr(const char *path, char *list, size_t size) p = list; for (i = 0; i < inode->i_num_ads; i++) { + + if (!ads_entry_is_named_stream(&inode->i_ads_entries[i])) + continue; + char *stream_name_mbs; size_t stream_name_mbs_nbytes; int ret; @@ -2120,7 +2124,7 @@ wimfs_setxattr(const char *path, const char *name, if (!(ctx->mount_flags & WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR)) return -ENOTSUP; - if (strlen(name) < 5 || memcmp(name, "user.", 5) != 0) + if (strlen(name) <= 5 || memcmp(name, "user.", 5) != 0) return -ENOATTR; name += 5; @@ -2238,7 +2242,7 @@ wimfs_unlink(const char *path) if (ret != 0) return ret; - if (stream_idx == 0) + if (inode_stream_name_nbytes(dentry->d_inode, stream_idx) == 0) remove_dentry(dentry, ctx->wim->lookup_table); else inode_remove_ads(dentry->d_inode, stream_idx - 1,