Richard W.M. Jones
2023-Jun-29 12:49 UTC
[Libguestfs] [PATCH libguestfs] generator: Add --chown option for virt-customize
Also this updates the common submodule to include the changes.
Fixes: https://github.com/rwmjones/guestfs-tools/issues/12
---
common | 2 +-
generator/customize.ml | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/common b/common
index d61cd820b4..bbb54714ce 160000
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit d61cd820b49e403848d15c5deaccbf8dd7045370
+Subproject commit bbb54714ce24c76e5761d96a0227a753896dc4c4
diff --git a/generator/customize.ml b/generator/customize.ml
index aa7ac8e8af..8d3dec3e24 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -95,6 +95,34 @@ I<Note>: C<PERMISSIONS> by default would be
decimal, unless you prefix
it with C<0> to get octal, ie. use C<0700> not C<700>.";
};
+ { op_name = "chown";
+ op_type = StringPair "UID.GID:PATH";
+ op_discrim = "`Chown";
+ op_shortdesc = "Change the owner user and group ID of a file or
directory";
+ op_pod_longdesc = "\
+Change the owner user and group ID of a file or directory in the guest.
+Note:
+
+=over 4
+
+=item *
+
+Only numeric UIDs and GIDs will work, and these may not be the same
+inside the guest as on the host.
+
+=item *
+
+This will not work with Windows guests.
+
+=back
+
+For example:
+
+ virt-customize --chown '0.0:/var/log/audit.log'
+
+See also: I<--upload>.";
+ };
+
{ op_name = "commands-from-file";
op_type = StringFn ("FILENAME",
"customize_read_from_file");
op_discrim = "`CommandsFromFile";
--
2.41.0
Richard W.M. Jones
2023-Jun-29 12:57 UTC
[Libguestfs] [PATCH libguestfs] generator: Add --chown option for virt-customize
On Thu, Jun 29, 2023 at 01:49:49PM +0100, Richard W.M. Jones wrote:> Also this updates the common submodule to include the changes. > > Fixes: https://github.com/rwmjones/guestfs-tools/issues/12 > --- > common | 2 +- > generator/customize.ml | 28 ++++++++++++++++++++++++++++ > 2 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/common b/common > index d61cd820b4..bbb54714ce 160000 > --- a/common > +++ b/common > @@ -1 +1 @@ > -Subproject commit d61cd820b49e403848d15c5deaccbf8dd7045370 > +Subproject commit bbb54714ce24c76e5761d96a0227a753896dc4c4So I meant to add here that after making the change to libguestfs, you have to run 'make' which will update the common/ subdirectory. You then need to commit those changes, pull that commit to guestfs-tools/common, and then you'll be able to use the second patch to guestfs-tools. Obviously I would do all this when pushing the reviewed version. Rich.> diff --git a/generator/customize.ml b/generator/customize.ml > index aa7ac8e8af..8d3dec3e24 100644 > --- a/generator/customize.ml > +++ b/generator/customize.ml > @@ -95,6 +95,34 @@ I<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix > it with C<0> to get octal, ie. use C<0700> not C<700>."; > }; > > + { op_name = "chown"; > + op_type = StringPair "UID.GID:PATH"; > + op_discrim = "`Chown"; > + op_shortdesc = "Change the owner user and group ID of a file or directory"; > + op_pod_longdesc = "\ > +Change the owner user and group ID of a file or directory in the guest. > +Note: > + > +=over 4 > + > +=item * > + > +Only numeric UIDs and GIDs will work, and these may not be the same > +inside the guest as on the host. > + > +=item * > + > +This will not work with Windows guests. > + > +=back > + > +For example: > + > + virt-customize --chown '0.0:/var/log/audit.log' > + > +See also: I<--upload>."; > + }; > + > { op_name = "commands-from-file"; > op_type = StringFn ("FILENAME", "customize_read_from_file"); > op_discrim = "`CommandsFromFile"; > -- > 2.41.0 > > _______________________________________________ > Libguestfs mailing list > Libguestfs at redhat.com > https://listman.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Laszlo Ersek
2023-Jun-29 16:11 UTC
[Libguestfs] [PATCH libguestfs] generator: Add --chown option for virt-customize
On 6/29/23 14:49, Richard W.M. Jones wrote:> Also this updates the common submodule to include the changes. > > Fixes: https://github.com/rwmjones/guestfs-tools/issues/12 > --- > common | 2 +- > generator/customize.ml | 28 ++++++++++++++++++++++++++++ > 2 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/common b/common > index d61cd820b4..bbb54714ce 160000 > --- a/common > +++ b/common > @@ -1 +1 @@ > -Subproject commit d61cd820b49e403848d15c5deaccbf8dd7045370 > +Subproject commit bbb54714ce24c76e5761d96a0227a753896dc4c4 > diff --git a/generator/customize.ml b/generator/customize.ml > index aa7ac8e8af..8d3dec3e24 100644 > --- a/generator/customize.ml > +++ b/generator/customize.ml > @@ -95,6 +95,34 @@ I<Note>: C<PERMISSIONS> by default would be decimal, unless you prefix > it with C<0> to get octal, ie. use C<0700> not C<700>."; > }; > > + { op_name = "chown"; > + op_type = StringPair "UID.GID:PATH"; > + op_discrim = "`Chown"; > + op_shortdesc = "Change the owner user and group ID of a file or directory"; > + op_pod_longdesc = "\ > +Change the owner user and group ID of a file or directory in the guest. > +Note: > + > +=over 4 > + > +=item * > + > +Only numeric UIDs and GIDs will work, and these may not be the same > +inside the guest as on the host. > + > +=item * > + > +This will not work with Windows guests. > + > +=back > + > +For example: > + > + virt-customize --chown '0.0:/var/log/audit.log' > + > +See also: I<--upload>."; > + }; > + > { op_name = "commands-from-file"; > op_type = StringFn ("FILENAME", "customize_read_from_file"); > op_discrim = "`CommandsFromFile";Acked-by: Laszlo Ersek <lersek at redhat.com>