search for: attrval

Displaying 20 results from an estimated 54 matches for "attrval".

2020 Mar 12
0
[PATCH libguestfs 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...- reply_with_error ("extended attribute is too large"); + reply_with_error ("%s: extended attribute is too large", names[i]); goto error; } - r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]); - r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen); - r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen; + r->guestfs_int_xattr_list_val[i].attrname = strdup (&buf[i]); + r->guestfs_int_xattr_list_val[i].attrval.attrval_val = malloc (vlen); + r->guestfs_int_xattr_list_val[i].attrval....
2020 Mar 16
0
[PATCH libguestfs v2 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...- reply_with_error ("extended attribute is too large"); + reply_with_error ("%s: extended attribute is too large", names[i]); goto error; } - r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]); - r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen); - r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen; + r->guestfs_int_xattr_list_val[i].attrname = strdup (names[i]); + r->guestfs_int_xattr_list_val[i].attrval.attrval_val = malloc (vlen); + r->guestfs_int_xattr_list_val[i].attrval.att...
2014 Jan 13
0
[PATCH] New API: copy-attributes.
...b/daemon/xattr.c index ebacc02..abed5ff 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -541,8 +541,77 @@ do_lgetxattr (const char *path, const char *name, size_t *size_r) return buf; /* caller frees */ } +int +copy_xattrs (const char *src, const char *dest) +{ + ssize_t len, vlen, ret, attrval_len = 0; + CLEANUP_FREE char *buf = NULL, *attrval = NULL; + size_t i; + + buf = _listxattrs (src, listxattr, &len); + if (buf == NULL) + /* _listxattrs issues reply_with_perror already. */ + goto error; + + /* What we get from the kernel is a string "foo\0bar\0baz" of leng...
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 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.
2014 Jan 07
8
RFC: copy-attributes command
Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a "file" to another, so for example in guestfish: copy-attributes foo bar permissions:true xattributes:false would only copy the permissions of foo to bar, not copying its extended attributes too. Just few notes: - my first daemon command, so
2014 Jan 07
0
Re: RFC: copy-attributes command
...'t care about RHEL 5 since it now has its own branch ("oldlinux"), so the code might be made simpler by an accompanying patch which reduces all of the HAVE_*XATTR* macros down to a single one (HAVE_LINUX_XATTRS). > + ssize_t len, vlen, ret; > + CLEANUP_FREE char *buf = NULL, *attrval = NULL; > + size_t i, attrval_len = 0; > + > + CHROOT_IN; > + len = listxattr (src, NULL, 0); > + CHROOT_OUT; > + if (len == -1) { > + reply_with_perror ("listxattr: %s", src); > + goto error; > + } > + > + buf = malloc (len); > + if (buf...
2014 Jan 13
1
Re: Livecd-creator is disabling selinux
.... This gives us almost all we need, doesn't require us to run loadpolicy, and should work independent of guest policy. Luckily for us ... it works! $ virt-builder fedora-20 $ guestfish -a fedora-20.img -i ><fs> getxattrs /etc/shadow [0] = { attrname: security.selinux attrval: system_u:object_r:shadow_t:s0\x00 } ><fs> cp /etc/shadow /etc/shadow.copy ><fs> setxattr security.selinux system_u:object_r:shadow_t:s0 29 /etc/shadow.copy ><fs> getxattrs /etc/shadow.copy [0] = { attrname: security.selinux attrval: system_u:object_r:sha...
2014 Jan 10
4
Re: RFC: copy-attributes command
...nt 07777 in order to copy sticky/setuid/setgid bits. > Perhaps those should be a separate flag, but we definitely want to > copy them! Right, fixed to be part of the permissions (or mode actually, see below). > > + ssize_t len, vlen, ret; > > + CLEANUP_FREE char *buf = NULL, *attrval = NULL; > > + size_t i, attrval_len = 0; > > + > > + CHROOT_IN; > > + len = listxattr (src, NULL, 0); > > + CHROOT_OUT; > > + if (len == -1) { > > + reply_with_perror ("listxattr: %s", src); > > + goto error; > > + } > &...
2012 Oct 15
3
[LLVMdev] Dragonegg build broken?
...on âllvm::FunctionType* ConvertArgListToFnType(tree, llvm::ArrayRef<tree_node*>, tree, bool, llvm::CallingConv::ID&, llvm::AttrListPtr&)â: /local/home/anitha/dragonegg/src/TypeConversion.cpp:690:3: error: no matching function for call to âllvm::Attributes::Attributes(llvm::Attributes::AttrVal)â /local/home/anitha/dragonegg/src/TypeConversion.cpp:690:3: note: candidates are: In file included from /home/anboyapa/install/include/llvm/Instructions.h:21:0, from /home/anboyapa/install/include/llvm/IRBuilder.h:18, from /local/home/anitha/dragonegg/include/drag...
2015 Jan 02
2
(no subject)
Hi, we needed these changes when we had to build a guest image compatible with a starting guest image but not backed by it in any way? We needed some tool to check our progress, comparing original and? rebuilt (from scratch) images, and virt-diff seemed the best option, but? we had to soften the comparison to reduce the noise in the output. I added some options to ignore certain informations when
2014 Jun 14
3
Script to read systemd journal of a guest to find its IP address
...uot;) # Loop over the journal to find a specific string count = 0 prog = re.compile("dhclient.*bound") while g.journal_next(): count += 1 output = g.journal_get() #print output flag = 0 for i in output: if i['attrname']=="MESSAGE" and i['attrval'].startswith("bound"): print i['attrval'].split()[2] flag = 1 break if flag == 1: break # Close the journal handle g.journal_close () # Unmount all the file system(s) g.umount_all () g.sync () sys.exit(0) --------------------...
2015 Jan 02
0
[PATCH] virt-diff: add additional ignore options
...ocks); } if (file->csum) @@ -816,10 +865,10 @@ output_file (guestfs_h *g, struct file *file) } if (enable_xattrs) { - for (i = 0; i < file->xattrs->len; ++i) { - output_string (file->xattrs->val[i].attrname); - output_binary (file->xattrs->val[i].attrval, - file->xattrs->val[i].attrval_len); + for (i = 0; i < file->xattrs_orig->len; ++i) { + output_string (file->xattrs_orig->val[i].attrname); + output_binary (file->xattrs_orig->val[i].attrval, + file->xattrs_orig-&gt...
2015 Mar 05
0
[PATCH v3] fish: add journal-view command
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err",...
2015 Mar 03
2
[PATCH v2] RFE: journal reader in guestfish
This implements new guestfish only command called journal-view. There seems to be a minor issue when user wants to run it through pager (more) and wants cancel it. User will end up with stuck guestfish until journal-view transfers all journal items. Output is now configurable, it's the same format as virt-log has, since both uses same code now. Maros Zatko (1): fish: add journal-view
2015 Mar 05
2
[PATCH v3] RFE: journal reader in guestfish
There seems to be a minor issue when user wants to run it through pager (more) and wants cancel it. User will end up with stuck guestfish until journal-view transfers all journal items. Output is now configurable, it's the same format as virt-log has, since both uses same code now. Maros Zatko (1): fish: add journal-view command cat/Makefile.am | 1 + cat/log.c | 113
2014 Sep 23
0
[PATCH 13/13] syntax-check: fix trailing_blank check
...lume) == -1) { reply_with_perror ("asprintf"); diff --git a/fish/test-file-attrs.sh b/fish/test-file-attrs.sh index 55d602c..bd0c5fa 100755 --- a/fish/test-file-attrs.sh +++ b/fish/test-file-attrs.sh @@ -85,7 +85,7 @@ uid: 10 gid: 11 ----- [0] = { - attrname: + attrname: attrval: 2\x00 } [1] = { @@ -97,7 +97,7 @@ gid: 11 attrval: secondtest } [3] = { - attrname: + attrname: attrval: 1\x00 } [4] = { @@ -105,7 +105,7 @@ gid: 11 attrval: another } [0] = { - attrname: + attrname: attrval: 2\x00 } [1] = { @@ -117,7 +117,7 @@ gid: 11 attrval: secon...
2015 Aug 31
0
[PATCH v5 1/2] cat: move get_journal_field to fish/journal.c
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err",...
2015 Aug 27
0
[PATCH v4 1/2] cat: move get_journal_field to fish/journal.c
...ry. - */ -static const char * -get_journal_field (const struct guestfs_xattr_list *xattrs, const char *name, - size_t *len_rtn) -{ - uint32_t i; - - for (i = 0; i < xattrs->len; ++i) { - if (STREQ (name, xattrs->val[i].attrname)) { - *len_rtn = xattrs->val[i].attrval_len; - return xattrs->val[i].attrval; - } - } - - return NULL; /* not found */ -} - -static const char *const log_level_table[] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err",...
2015 Jan 06
0
[PATCH] virt-diff: add additional ignore options
...ocks); } if (file->csum) @@ -816,10 +870,10 @@ output_file (guestfs_h *g, struct file *file) } if (enable_xattrs) { - for (i = 0; i < file->xattrs->len; ++i) { - output_string (file->xattrs->val[i].attrname); - output_binary (file->xattrs->val[i].attrval, - file->xattrs->val[i].attrval_len); + for (i = 0; i < file->xattrs_orig->len; ++i) { + output_string (file->xattrs_orig->val[i].attrname); + output_binary (file->xattrs_orig->val[i].attrval, + file->xattrs_orig-&gt...