summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* generator: Generate the UUIDs for tests randomly.Richard W.M. Jones2009-08-151-18/+34
| | | | | Adds a uuidgen function which gets the random UUID from the uuid program. Uses this for tests.
* Merge branch '226-elide'Jim Meyering2009-08-141-12/+82
|\
| * generator.ml: don't emit unused functionsJim Meyering2009-08-141-1/+9
| | | | | | | | | | * src/generator.ml: Use "rstructs_used" to emit definitions only for put_TYPE_list functions that are used.
| * generator.ml: factor out a functionJim Meyering2009-08-141-12/+16
| | | | | | | | * src/generator.ml (emit_put_list_function): New function.
| * Work out which RStruct/RStructList structs are really used, and how.Richard W.M. Jones2009-08-141-0/+58
| |
* | build: avoid "make sytnax-check" failureJim Meyering2009-08-141-1/+1
|/ | | | * daemon/configure.ac: Change a leading TAB to 8 spaces.
* guestfish: Add --selinux option.Richard Jones2009-08-132-5/+14
|
* Version 1.0.67.1.0.67Richard Jones2009-08-133-721/+759
|
* tests: increase likelihood that heap abuse triggers failureJim Meyering2009-08-131-0/+3
| | | | | * regressions/Makefile.am (TESTS_ENVIRONMENT): Always set MALLOC_PERTURB_ to a random value in 1..255.
* appliance: Remove /usr/sbin/tcpd - it's unreadable on RHEL 5.4.Richard Jones2009-08-131-0/+1
|
* appliance: Replace LANG=C with LC_ALL=CRichard Jones2009-08-131-1/+1
|
* umount: Enable device name translation for device parameter.Richard Jones2009-08-131-3/+8
|
* mount: Check mountpoints are absolute paths.Richard Jones2009-08-131-0/+2
|
* selinux: Don't fail if libselinux is not found.Richard Jones2009-08-131-7/+3
|
* Misc parameters which are String but should be Pathname.Richard Jones2009-08-131-9/+9
|
* In rmmountpoint, have to explicitly check for ABS_PATH (*not* NEED_ROOT).Richard Jones2009-08-131-0/+3
|
* inotify-add-watch does not need to explicitly check for ABS_PATH.Richard Jones2009-08-131-1/+0
|
* cp/cp-a/mv parameters marked as Pathname.Richard Jones2009-08-132-7/+3
|
* do_equal does not need to explicitly check for NEED_ROOT/ABS_PATH.Richard Jones2009-08-131-4/+0
|
* generator.ml: convert leading TABs to spacesJim Meyering2009-08-131-4/+4
|
* sfdisk: guard against buffer overflowJim Meyering2009-08-131-2/+15
| | | | | * daemon/sfdisk.c (sfdisk): Don't let outrageous "extra_flag" or "device" strings overflow a fixed-size buffer.
* do_umount: don't use RESOLVE_DEVICE anymoreJim Meyering2009-08-131-13/+9
| | | | | * daemon/mount.c (do_umount): Don't use RESOLVE_DEVICE here, now that the caller always invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE.
* generator.ml: factor out "pr_args n" functionJim Meyering2009-08-131-4/+7
|
* generator.ml: finish adding Dev_or_Path supportJim Meyering2009-08-133-35/+35
| | | | | | | | | | * src/generator.ml: Update all rules to handle Dev_or_Path. (the above changes to generator.ml are mostly mechanical) Emit a use of REQUIRE_ROOT_OR_RESOLVE_DEVICE. * daemon/upload.c (do_download): Remove use of REQUIRE_ROOT_OR_RESOLVE_DEVICE, now that it's automatically done in calling code. * daemon/file.c (do_file): Likewise.
* generator.ml: add type: Dev_or_PathJim Meyering2009-08-131-2/+3
| | | | * src/generator.ml (file, download): Use it.
* generator.ml: constify do_mkdtempJim Meyering2009-08-132-21/+10
| | | | | * daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter. * src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
* generator.ml: move String/Device decls "down" to definitionJim Meyering2009-08-131-5/+5
|
* generator.ml: use new "Pathname" designationJim Meyering2009-08-1343-339/+206
| | | | | | | | | | Nearly every file-related function in daemons/*.c is affected: Remove this pair of statements from each affected do_* function: - NEED_ROOT (return -1); - ABS_PATH (dir, return -1); and change the type of the corresponding parameter to "const char *". * src/generator.ml: Emit NEED_ROOT just once, even when there are two or more Pathname args.
* generator.ml: new type, "Pathname"Jim Meyering2009-08-131-93/+111
| | | | | | | | | | * src/generator.ml: Emit NEED_ROOT and ABS_PATH into generated stubs.c, rather than requiring they be added manually at the start of each and every do_* function that operates on a "path" parameter. Update grammar: Pathname is just a String, with the above exception. Do not update augeas "path" parameters, since they are not file names, but rather ":"-separated search paths. Except aug_init, for which "path" *is* a file name.
* generator.ml: emit "const char *" for Device and String paramsJim Meyering2009-08-131-7/+5
| | | | | | * src/generator.ml: Emit "const char *", not "char *" for Device and String params, now that the non-const code is hoisted into the calling code in stubs.c.
* fix daemon.h's use of NEED_ROOT-in-#defineJim Meyering2009-08-131-1/+1
|
* update all NEED_ROOT usesJim Meyering2009-08-1332-57/+57
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* * src/generator.ml: Change all `String "device"' to `Device "device"'.Jim Meyering2009-08-1314-96/+43
| | | | | | | | | | | | | | | | | | | | | Then update each affected function, removing each uses of RESOLVE_DEVICE, now that it's generated in caller from stub.c. * daemon/blockdev.c (call_blockdev): Remove use of RESOLVE_DEVICE. * daemon/devsparts.c (do_mkfs): Likewise. * daemon/ext2.c (do_e2fsck_f, do_get_e2label, do_get_e2uuid): Likewise. (do_resize2fs, do_set_e2label, do_set_e2uuid, do_tune2fs_l): Likewise. * daemon/fsck.c (do_fsck): Likewise. * daemon/grub.c (do_grub_install): Likewise. * daemon/lvm.c (do_lvremove, do_pvcreate, do_pvremove): Likewise. (do_pvresize): Likewise. * daemon/mount.c (do_mount_vfs): Likewise. * daemon/ntfs.c (do_ntfs_3g_probe): Likewise. * daemon/scrub.c (do_scrub_device): Likewise. * daemon/sfdisk.c (sfdisk, sfdisk_flag): Likewise. * daemon/swap.c (do_mkswap, do_mkswap_L, do_mkswap_U): Likewise. (do_swapoff_device, do_swapon_device): Likewise. * daemon/zero.c (do_zero): Likewise. * daemon/zerofree.c (do_zerofree): Likewise.
* update generator to emit each RESOLVE_DEVICE callJim Meyering2009-08-131-7/+7
| | | | | * src/generator.ml: Emit RESOLVE_DEVICE (device, goto done); just before each Device-enabled do_$FUNCTION.
* s/NEED_ROOT_OR_IS_DEVICE/REQUIRE_ROOT_OR_RESOLVE_DEVICE/Jim Meyering2009-08-133-3/+3
|
* guestfsd.c: correct s/IS_DEVICE/RESOLVE_DEVICE/ in another commentJim Meyering2009-08-131-1/+1
|
* manually adjust ABS_PATH uses for new semanticsJim Meyering2009-08-131-1/+1
| | | | * daemon/file.c (do_cat): fix an ABS_PATH use
* update all uses of ABS_PATHJim Meyering2009-08-1329-55/+55
| | | | | | run this command: git grep -l -w ABS_PATH|xargs perl -pi -e \ 's/(?:ABS_PATH)( \(.*?,) (.*?)\)/ABS_PATH$1 return $2)/'
* propagate semantic changes to NEED_ROOT, NEED_ROOT_OR_IS_DEVICEJim Meyering2009-08-131-8/+8
| | | | | | changing IS_DEVICE semantics leads to changing semantics of NEED_ROOT_OR_IS_DEVICE and NEED_ROOT, too. * daemon/daemon.h: Update definitions.
* convert the last few, manuallyJim Meyering2009-08-132-2/+2
|
* change almost all uses: s/IS_DEVICE/RESOLVE_DEVICE/Jim Meyering2009-08-1315-32/+32
| | | | | | Use this command: git grep -l -w IS_DEVICE|xargs perl -pi -e \ 's/\b(?:IS_DEVICE)\b( \(.*?,) (.*?)\)/RESOLVE_DEVICE$1 return $2)/'
* * daemon/daemon.h (RESOLVE_DEVICE): Rename from IS_DEVICE.Jim Meyering2009-08-131-3/+3
| | | | | Change parameter from "errcode" (which would be returned) to "fail_stmt" so that a caller can specify e.g., "goto done" upon failure.
* generator.ml: define new String-like type: "Device"Jim Meyering2009-08-131-23/+44
|
* Don't assume grub is on a separate boot filesystemMatthew Booth2009-08-131-2/+54
| | | | | | | | | | | Paths in grub.conf are relative to the filesystem containing it. grub parsing currently assumes that it is on /boot, and will fail if it isn't, for example because a guest only has a single partition. This patch makes grub parsing work harder to work out what grub paths are relative to. Firstly, it looks for a previous detected 'linux-grub' filesystem. If this isn't found, it tries to work out which filesystem contains /boot/grub/menu.lst and uses that.
* add_drive: Don't use cache=off if not supported by underlying filesystem.Richard W.M. Jones2009-08-132-6/+25
| | | | | | | | | | | | | | | | | | If you use the guestfs_add_drive function, then currently it generates a qemu command line element like: -drive ...,cache=off,... This causes qemu to try to open the device with O_DIRECT. Unfortunately some filesystems don't support this flag, notably tmpfs, which means you can't use libguestfs in conjunction with tmpfs. On some systems /tmp is a tmpfs filesystem. This patch fixes this so that if the filesystem doesn't support O_DIRECT, then we omit the cache=off parameter. This seems reasonable from a reliability point of view, because if you're using tmpfs then you probably didn't expect reliability in the case where your system suddenly powers off.
* Add 'setcon', 'getcon' commands to set and get the SELinux context.Richard Jones2009-08-138-1/+122
|
* Return error if allocations fail.Richard Jones2009-08-121-0/+12
|
* Add documentation for SELinux configuration.Richard Jones2009-08-121-4/+42
| | | | Also use L</...> to link between sections.
* Spelling fix: labelled -> labeled.Richard Jones2009-08-121-4/+4
|
* If using SELinux, mount /selinux in the appliance.Richard Jones2009-08-123-2/+15
| | | | | | If selinux=1 on the Linux kernel command line, then we mount /selinux in the appliance. We will also bind-mount this directory into guests when we run commands.