Displaying 5 results from an estimated 5 matches for "split_attr_names".
2020 Mar 16
0
[PATCH libguestfs v2 3/3] daemon: xattr: Filter out user.WofCompressedData from xattrs (RHBZ#1811539).
...c b/daemon/xattr.c
index 761f6074b..3257f241e 100644
--- a/daemon/xattr.c
+++ b/daemon/xattr.c
@@ -19,6 +19,8 @@
#include <config.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
#include <limits.h>
#include <unistd.h>
@@ -115,6 +117,29 @@ split_attr_names (char *buf, size_t len)
return take_stringsbuf (&ret);
}
+/* We hide one extended attribute automatically. This is used by NTFS
+ * to store the compressed contents of a file when using "CompactOS"
+ * (per-file compression). I justify this by:
+ *
+ * (1) The attribute is onl...
2020 Mar 16
6
[PATCH libguestfs v2 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
v1 here:
https://www.redhat.com/archives/libguestfs/2020-March/msg00099.html
This one fixes most of the points picked up in review, and does not
strdup the strings which should keep down memory usage if that is a
concern.
Rich.
2020 Mar 12
8
[PATCH libguestfs 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
https://bugzilla.redhat.com/show_bug.cgi?id=1811539
Commands including virt-diff which read extended attributes will
sometimes fail on NTFS filesystems that are using system compressed.
The reason is complex, see comment 5 of the bug linked above.
This patch filters out the troublesome xattr. For justification, see
the comment I added in patch 3.
Patch 1 & 2 are refactoring.
I was on the
2020 Mar 12
0
[PATCH libguestfs 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
..."foo\0bar\0baz"> of length
+ * C<len>. (The last string in the list is \0-terminated but the \0
+ * is not included in C<len>).
+ *
+ * This function splits it into a regular list of strings.
+ *
+ * Note the caller must free the returned string list.
+ */
+static char **
+split_attr_names (const char *buf, size_t len)
+{
+ size_t i;
+ DECLARE_STRINGSBUF (ret);
+
+ for (i = 0; i < len; i += strlen (&buf[i]) + 1) {
+ if (add_string (&ret, &buf[i]) == -1) {
+ free_stringsbuf (&ret);
+ return NULL;
+ }
+ }
+ if (end_stringsbuf (&ret) == -1) {...
2020 Mar 16
0
[PATCH libguestfs v2 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...erminated but the \0
+ * is not included in C<len>).
+ *
+ * This function splits it into a regular list of strings.
+ *
+ * B<Note> that the returned list contains pointers to the original
+ * strings in C<buf> so be careful that you do not double-free them.
+ */
+static char **
+split_attr_names (char *buf, size_t len)
+{
+ size_t i;
+ DECLARE_STRINGSBUF (ret);
+
+ for (i = 0; i < len; i += strlen (&buf[i]) + 1) {
+ if (add_string_nodup (&ret, &buf[i]) == -1)
+ return NULL;
+ }
+ if (end_stringsbuf (&ret) == -1)
+ return NULL;
+
+ return take_stringsbuf...