From 0be1035c710d95aeca68a10fe9a7b4b740ae7aff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 29 Jun 2023 13:33:04 +0100 Subject: [PATCH] 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 Acked-by: Laszlo Ersek (cherry picked from commit d8e48bff212f9b0558480ffedf8158157360d0d5) --- common | 2 +- generator/customize.ml | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/common b/common index d61cd820b..bbb54714c 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit d61cd820b49e403848d15c5deaccbf8dd7045370 +Subproject commit bbb54714ce24c76e5761d96a0227a753896dc4c4 diff --git a/generator/customize.ml b/generator/customize.ml index aa7ac8e8a..8d3dec3e2 100644 --- a/generator/customize.ml +++ b/generator/customize.ml @@ -95,6 +95,34 @@ I: C 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";