Displaying 5 results from an estimated 5 matches for "do_copy_attribut".
Did you mean:
do_copy_attributes
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 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 13
0
[PATCH] New API: copy-attributes.
...@
#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
+#include "optgroups.h"
GUESTFSD_EXT_CMD(str_file, file);
GUESTFSD_EXT_CMD(str_zcat, zcat);
@@ -584,3 +585,74 @@ do_filesize (const char *path)
return buf.st_size;
}
+
+int
+do_copy_attributes (const char *src, const char *dest, int all, int mode, int xattributes, int ownership)
+{
+ int r;
+ struct stat srcstat, deststat;
+
+ static const unsigned int file_mask = 07777;
+
+ /* If it was specified to copy everything, manually enable all the flags
+ * not manually specified to avo...
2014 Jan 07
0
Re: RFC: copy-attributes command
...aemon.h"
> #include "actions.h"
> +#include "optgroups.h"
>
> GUESTFSD_EXT_CMD(str_file, file);
> GUESTFSD_EXT_CMD(str_zcat, zcat);
> @@ -584,3 +585,46 @@ do_filesize (const char *path)
>
> return buf.st_size;
> }
> +
> +int
> +do_copy_attributes (const char *src, const char *dest, int permissions, int xattributes)
> +{
> + int r;
> + struct stat srcstat, deststat;
> +
> + CHROOT_IN;
> + r = stat (src, &srcstat);
> + CHROOT_OUT;
> +
> + if (r == -1) {
> + reply_with_perror ("stat: %s",...
2014 Jan 10
4
Re: RFC: copy-attributes command
...h"
> >
> > GUESTFSD_EXT_CMD(str_file, file);
> > GUESTFSD_EXT_CMD(str_zcat, zcat);
> >
> > @@ -584,3 +585,46 @@ do_filesize (const char *path)
> >
> > return buf.st_size;
> >
> > }
> >
> > +
> > +int
> > +do_copy_attributes (const char *src, const char *dest, int
> > permissions, int xattributes) +{
> > + int r;
> > + struct stat srcstat, deststat;
> > +
> > + CHROOT_IN;
> > + r = stat (src, &srcstat);
> > + CHROOT_OUT;
> > +
> > + if (r == -1) {
> &...