search for: optgroup_linuxxattrs_available

Displaying 8 results from an estimated 8 matches for "optgroup_linuxxattrs_available".

2014 Jan 10
2
Re: RFC: copy-attributes command
On Fri, Jan 10, 2014 at 05:36:39PM +0100, Pino Toscano wrote: > +int > +copy_xattrs (const char *src, const char *dest) > +{ > + abort (); > +} Is this called in the case where someone does copy-attributes foo bar xattributes:true on a version of libguestfs with no support for xattrs? It's probably better to silently ignore this case instead of crashing. Rich. --
2014 Jan 10
0
[PATCH] daemon: xattr: move the listxattrs code in an own function
...l changes, just code motion. --- daemon/xattr.c | 64 ++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/daemon/xattr.c b/daemon/xattr.c index b84cf3d..e01e9e2 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -54,6 +54,7 @@ optgroup_linuxxattrs_available (void) static guestfs_int_xattr_list *getxattrs (const char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t (*getxattr) (const char *path, const char *name, void *value, size_t size)); static int _setxattr (const char *xattr, const char *val, int vallen, const cha...
2014 Jan 10
0
Re: RFC: copy-attributes command
...n the case where someone does > > copy-attributes foo bar xattributes:true > > on a version of libguestfs with no support for xattrs? It's probably > better to silently ignore this case instead of crashing. This version shouldn't be ever called, since it is called when optgroup_linuxxattrs_available returns true, which is not the case in the !HAVE_LINUX_XATTRS block (where the abort version of copy_xattrs is implemented). -- Pino Toscano
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...+247,7 @@ do_tgz_out (const char *dir) int do_txz_out (const char *dir) { + IF_NOT_AVAILABLE_ERROR (xz, -1); + return do_tXz_out (dir, "J"); } diff --git a/daemon/xattr.c b/daemon/xattr.c index 2445748..1b98555 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -520,55 +520,55 @@ optgroup_linuxxattrs_available (void) guestfs_int_xattr_list * do_getxattrs (const char *path) { - NOT_AVAILABLE (NULL); + NOT_AVAILABLE (linuxxattrs, NULL); } guestfs_int_xattr_list * do_lgetxattrs (const char *path) { - NOT_AVAILABLE (NULL); + NOT_AVAILABLE (linuxxattrs, NULL); } int do_setxattr (const char *...
2014 Jan 10
4
Re: RFC: copy-attributes command
On Tuesday 07 January 2014 21:04:36 Richard W.M. Jones wrote: > On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: > > 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: > >
2014 Jan 13
0
[PATCH] New API: copy-attributes.
...stat.st_uid != deststat.st_uid || srcstat.st_gid != deststat.st_gid)) { + CHROOT_IN; + r = chown (dest, srcstat.st_uid, srcstat.st_gid); + CHROOT_OUT; + + if (r == -1) { + reply_with_perror ("chown: %s", dest); + return -1; + } + } + + if (xattributes && optgroup_linuxxattrs_available ()) { + if (!copy_xattrs (src, dest)) + /* copy_xattrs replies with an error already. */ + return -1; + } + + return 0; +} diff --git a/daemon/xattr.c b/daemon/xattr.c index ebacc02..abed5ff 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -541,8 +541,77 @@ do_lgetxattr (const cha...
2014 Jan 07
0
Re: RFC: copy-attributes command
...etuid/setgid bits. Perhaps those should be a separate flag, but we definitely want to copy them! > + CHROOT_OUT; > + > + if (r == -1) { > + reply_with_perror ("chmod: %s", dest); > + return -1; > + } > + } > + > + if (xattributes && optgroup_linuxxattrs_available ()) { > + if (!copy_xattrs (src, dest)) > + return -1; > + } > + > + return 0; > +} > diff --git a/daemon/xattr.c b/daemon/xattr.c > index af8bfd4..97a94d5 100644 > --- a/daemon/xattr.c > +++ b/daemon/xattr.c > @@ -545,8 +545,98 @@ do_lgetxattr (const char...
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