[REVIEW ONLY] Ensure atomic creation of a cached appliance
by Matthew Booth
Cached appliances are discovered by their predictable path. Previously we were
creating a cached appliance directly in this predictable path. This had at least
2 undesirable effects:
* Interrupting appliance creation would leave a corrupt appliance
* 2 processes could simultaneously attempt to create the same appliance, causing
corruption.
This patch causes the cached appliance to be created in a temporary directory,
and then renamed to the predictable path. As rename is an atomic operation, this
makes the whole creation atomic.
This patch also changes the predictable path to have a prefix of 'guestfs.'.
This will make it simpler for system administrators to clean up old cached
appliances.
Note that this version of the patch doesn't cleanup the temporary directory of a
guestfs process which didn't win an appliance creation race.
---
regressions/test-launch-race.pl | 53 +++++++++++++++++++++++++++++++++++++++
src/appliance.c | 49 ++++++++++++++++++++++++++---------
2 files changed, 89 insertions(+), 13 deletions(-)
create mode 100755 regressions/test-launch-race.pl
14 years, 2 months
[PATCH 1/2] Add -u and -g options to febootstrap-supermin-helper
by Matthew Booth
Bash automatically resets euid to uid when it executes. This can mean that the
effective user id of a program at the point it calls febootstrap-supermin-helper
can be lost if any part of execution chain involved bash. This in turn can
result in:
* the generation of an incorrect checksum, which contains the uid.
* the generation of supermin files with differing owners
The -u and -g options allow the caller to pass in an explicit user and group to
run as. These will be used when generating a checksum. Additionally,
febootstrap-supermin-helper will set(u|g)id as appropriate if they are given for
non-checksum output. This ensures all generated files will have the correct
ownership, regardless of how they are created.
---
helper/checksum.c | 2 +-
helper/helper.h | 2 +
helper/main.c | 145 ++++++++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 130 insertions(+), 19 deletions(-)
14 years, 2 months
[PATCH] Call febootstrap-supermin-helper using the new -u and -g options
by Matthew Booth
Use febootstrap-supermin-helper's new -u and -g command line options to setuid,
rather than doing it in libguestfs.
This resolves an issue with the generation of the cached appliance checksum. The
checksum was being generated by a call to febootstrap-supermin-helper through
popen(). Unfortunately, a bash misfeature meant that euid would be reset to uid,
and the checksum was generated for uid, not euid. When virt-v2v is writing to a
RHEV target, uid == 0 and euid == 36, which resulted in a cached appliance being
created for root with permissions for uid 36.
---
src/appliance.c | 51 +++++++++++++++++++++------------------------------
1 files changed, 21 insertions(+), 30 deletions(-)
14 years, 2 months
[PATCH 1/2] New internal function guestfs___print_timestamped_argv
by Matthew Booth
This function generalises the existing print_cmdline used to output the qemu
command line to output any given command line, and exports it to other modules.
It also adds a timestamp to the old print_cmdline output for consistency with
guestfs___print_timestamped_message.
---
src/guestfs-internal.h | 1 +
src/launch.c | 48 ++++++++++++++++++++++++------------------------
2 files changed, 25 insertions(+), 24 deletions(-)
14 years, 2 months
[FEBOOTSTRAP] Add gnulib as a submodule
by Matthew Booth
---
.gitmodules | 3 +++
autogen.sh | 4 +---
gnulib | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
create mode 100644 .gitmodules
create mode 160000 gnulib
14 years, 2 months