summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Fix crash in aug-defnode (RHBZ#785668).Richard W.M. Jones2012-01-301-6/+15
| | | | (cherry picked from commit e3f15780c8197a66bfb620b802ba18d0ba0dd2ce)
* daemon: Fix use-after-free in case-insensitive-path (found by valgrind).Richard W.M. Jones2012-01-241-38/+81
| | | | | | | | | | This commit tidies up the code by splitting out the path element-searching code into a separate function. Valgrind found that 'closedir' frees the 'struct dirent *', which wasn't immediately obvious. So now we do the 'closedir' after all operations which touch 'd->d_name'. (cherry picked from commit a05ddcd2a719f97ba036e9d6ca4e6491ed8b1fd0)
* daemon: Fix leaking error message (found by valgrind).Richard W.M. Jones2012-01-241-0/+1
| | | | (cherry picked from commit 9700708a19a46a61ffe53c6e648206336781477e)
* daemon: Close inotify handle on exit.Richard W.M. Jones2012-01-241-0/+11
| | | | (cherry picked from commit 86f64c37b914645afb345f96af13ad843ec641b1)
* daemon: Close augeas handle on exit.Richard W.M. Jones2012-01-241-0/+11
| | | | (cherry picked from commit 94a7fb9fc5d04615f23f94c34eb90c35d20ba117)
* daemon: Fix leak of strings in md-detail (found by valgrind).Richard W.M. Jones2012-01-241-2/+2
| | | | (cherry picked from commit ff2e685828ce6160de34756696069b80e35472e8)
* daemon: md: Whitespace changes, and use size_t for i instead of pointer.Richard W.M. Jones2012-01-241-20/+23
| | | | | This is just a code clean-up with no functional change. (cherry picked from commit 4c2101362edf5f2df5d018c3674b423de2a3538a)
* daemon: Fix leak of strings in blkid (found by valgrind).Richard W.M. Jones2012-01-241-2/+2
| | | | (cherry picked from commit aa978b75ae1df0d3111953114fafe0854c3f222e)
* daemon: blkid: Whitespace changes, and use size_t for i instead of pointer.Richard W.M. Jones2012-01-241-18/+21
| | | | | This is just a code clean-up with no functional change. (cherry picked from commit 43a6974cb35759d4772f610f3c92b0d31f0503ac)
* daemon: Return value from write syscall is ssize_t, not int.Richard W.M. Jones2012-01-241-1/+1
| | | | (cherry picked from commit f86c3a45ae19f5bb558ab9ead255ecaf004b24b0)
* daemon: Don't leak 'cmdline' (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
| | | | (cherry picked from commit 9f8f1fd8560f2c3e7b625cf6d65a052cd061fd2e)
* daemon: Length of message is a 32 bit unsigned quantity.Richard W.M. Jones2012-01-241-2/+2
| | | | (cherry picked from commit f65f653ab1541400afe2f796ab1b20cd721e769d)
* daemon: Fix use of uninitialized stack data (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
| | | | | | This uninitialized data was also sent over the protocol, potentially being a serious information leak. (cherry picked from commit 9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da)
* daemon: Fix memory leak in 'initrd-cat' (found by valgrind).Richard W.M. Jones2012-01-241-0/+2
| | | | (cherry picked from commit 84242a8d0bf9c37e700cd8a3436607dbc7908f1e)
* debian: Debian 6 blkid has -p but not -i.Richard W.M. Jones2012-01-231-30/+62
| | | | | | Fix the existing test to work correctly in this case. Other cleanups.
* daemon: Move internal-autosync function to new file internal.c.Richard W.M. Jones2012-01-213-18/+47
| | | | This is just code motion.
* daemon: Run udev_settle after pwrite-device finishes.Richard W.M. Jones2012-01-192-4/+17
| | | | | | | When you call close on any block device, udev kicks off a rule which runs blkid to reexamine the device. We need to wait for this rule to finish running since it holds the device open and can cause other operations to fail, notably BLKRRPART.
* daemon: pwrite/pread: Don't double close on error path.Richard W.M. Jones2012-01-191-2/+0
| | | | | In Linux, close (fd) closes the file descriptor even if it returns an error.
* Tempus fugit.Richard W.M. Jones2012-01-1820-20/+20
| | | | Update all copyright dates to 2012.
* resize2fs-M: fix double-free along error path (thanks Matthew Booth).Richard W.M. Jones2012-01-161-4/+2
|
* e2fsck-f: change the internal to use e2fsckWanlong Gao2012-01-131-21/+7
| | | | | | | | Since we implement the new api e2fsck, just change the internal of e2fsck_f to use e2fsck now. v1->v2: use optargs_bitmask Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* NEW API: add a new api e2fsckWanlong Gao2012-01-131-0/+49
| | | | | | | | | | | | | | m: Wanlong Gao <gaowanlong@cn.fujitsu.com> Add a new api e2fsck with two options: correct: same as '-p' option of e2fsck forceall: same as '-y' option of e2fsck Thanks for Rich's idea. v1->v2: use optargs_bitmask v2->v3: change the optargs_bitmask check Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* ext2: tweak the error returned message of resize2fs-M(BZ755729)Wanlong Gao2012-01-131-2/+7
| | | | | | | Tweak the error message "e2fsck -f" and "e2fsck -fy". Indicate the user to use the correct and/or forceall options. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* daemon: debug segv correct use of dereferencing NULL.Richard W.M. Jones2012-01-091-1/+7
|
* mkfs: optimization and code cleanupWanlong Gao2011-12-231-15/+14
| | | | | | | | | | | v1->v2: fix a typo pointed by Matt Optimizations by reducing the STREQ operations and do some code cleanup. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: Whitespace changes.
* tests: Split regressions -> various subdirectories of tests/Richard W.M. Jones2011-12-221-2/+6
|
* daemon: Fix utimens so it doesn't hang on named pipes (RHBZ#761460).Richard W.M. Jones2011-12-081-18/+5
| | | | | | | | | | This also adds comprehensive tests for utimens on regular files, directories (RHBZ#761451), named pipes (RHBZ#761460), symbolic links, block and char devices. Note that there is a small change in the (previously undefined) semantics of this call: It now sets the time on a symbolic link itself, not on what the symbolic link points to.
* daemon: Allow utimens to work for directories (RHBZ#761451).Richard W.M. Jones2011-12-081-1/+1
| | | | | | You don't need to open the file O_WRONLY in order to call futimens on the file descriptor. Opening it O_WRONLY fails for directories. Therefore open O_RDONLY instead.
* blkid: split the RHEL5 which can't support some optionsWanlong Gao2011-12-051-7/+73
| | | | | | | RHEL5 shoult not support '-p', '-i' and '-o export' options. But we just split it according to the '-p' option. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Revert "blkid: Use -c /dev/null because RHEL 5 blkid doesn't have -p option."Richard W.M. Jones2011-12-041-5/+2
| | | | This reverts commit 6533491b178d18bfab8240cf093be4ef9b547548.
* Revert "blkid: Fix mistake in previous commit."Richard W.M. Jones2011-12-041-1/+1
| | | | This reverts commit c48226a5026816b115ab63b50d3601531aff59dc.
* blkid: Fix mistake in previous commit.Richard W.M. Jones2011-12-031-1/+1
| | | | This updates commit 6533491b178d18bfab8240cf093be4ef9b547548.
* blkid: Use -c /dev/null because RHEL 5 blkid doesn't have -p option.Richard W.M. Jones2011-12-031-2/+5
|
* daemon: Use pkg-config to locate Augeas CFLAGS / libraries.Richard W.M. Jones2011-12-031-2/+2
| | | | | | | | | | | | | | | | | | Augeas 0.10 depends on libxml2, so this is now required in the appliance (in fact, it was already present). However this exposed two bugs: (1) In libguestfs we use a home-brewed recipe for Augeas flags, resulting in this error: /usr/include/augeas.h:24:25: fatal error: libxml/tree.h: No such file or directory (2) Augeas's own augeas.pc didn't include the libxml2 flags, so it was broken. This requires a patch to Augeas 0.10, see: https://www.redhat.com/archives/augeas-devel/2011-December/msg00008.html Change to using pkg-config to detect Augeas. It is still an optional library.
* NEW API: add blkid command to print the attributes of the deviceWanlong Gao2011-12-031-0/+75
| | | | | | | | | | | | A NEW API blkid. It can print the device attributes. Use it after list-devices, we can list ower devices and the attributes of each device. Use it like: blkid <device> It's should be a usefull function. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* mkfs: enable to make xfs filesystems when the device already has a filesystemWanlong Gao2011-12-021-0/+3
| | | | | | | | Just add the -f option to mkfs.xfs to make sure we can make a xfs filesystem when the device already has a filesystem on it. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* libguestfs: Added gnulib includes from builddir, as suggested by the Gnulib ↵Hilko Bengen2011-12-011-1/+1
| | | | | | | | documentation Since some modules (`getopt', for example) may copy files into the build directory, `top_builddir/lib' is needed as well as `top_srcdir/lib'. -- GNU Gnulib manual, section 2.2 Initial import
* debian: Use mdadm -D --export instead of mdadm -DY.Richard W.M. Jones2011-11-241-2/+2
| | | | For compatibility with mdadm on Debian Squeeze.
* part-disk: Change default alignment of this to 64K (128 sectors).Richard W.M. Jones2011-11-241-5/+6
| | | | | | This is the minimum alignment. 1MB would be better. Note that the exact behaviour is not defined in the API.
* New API: md-stop for stopping MD devicesWanlong Gao2011-11-241-0/+16
| | | | | | | | This API is used to stop a md device. When we want to move a device to another md array, we should stop the md device which contained this device first. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Rename mdadm_ apis to md_Matthew Booth2011-11-241-12/+12
| | | | | | | | | This change renames the following 2 apis: * mdadm_create -> md_create * mdadm_detail -> md_detail This is more consistent with list_md_devices, and removes a reference to an implementation detail from the api.
* New API: mdadm-detail.Matthew Booth2011-11-171-0/+80
|
* New API: list-md-devices.Matthew Booth2011-11-113-7/+80
| | | | | | | Return a list of Linux MD devices detected in the guest. This API complements list_devices, list_partitions, list_lvs and list_dm_devices.
* New API: mdadm-create for creating MD devices.Richard W.M. Jones2011-11-112-0/+171
|
* New API: Bind the tune2fs command.Richard W.M. Jones2011-11-111-0/+149
| | | | | | | | | | | | | Previously we bound the 'tune2fs -l' command so that we could list out the tunables of an ext2/3/4 filesystem. Also commands like set_e2label and set_e2uuid used tune2fs. This commit binds many of the tunables that can be set using tune2fs. The coverage is not complete, but we can add more later because this uses optional parameters so the call is extensible without breaking ABI. The current change gives us enough for using libguestfs within OpenStack.
* daemon: Define safe ADD_ARG macro for constructing arg lists on the stack.Richard W.M. Jones2011-11-115-87/+102
|
* Update FSF address.Matthew Booth2011-11-0872-72/+72
|
* daemon: Use a private copy of /etc/lvm so we don't modify the real config.Richard W.M. Jones2011-11-043-16/+101
| | | | | | | | | In the libguestfs live case we need to be careful not to modify the real /etc/lvm/lvm.conf file (when setting the filter rule). When the daemon starts, make a complete copy of /etc/lvm in a temporary directory, and adjust LVM_SYSTEM_DIR to point to the copy. All changes are made in the temporary copy.
* daemon: Don't use files with fixed names in /tmp (thanks Steve Kemp).Richard W.M. Jones2011-11-042-20/+46
| | | | | | Although this doesn't matter for the ordinary (appliance) case, it matters for the libguestfs live case. In that case it could cause the guest to be exploited by a tmp/symlink attack.
* Fix debug help error message.Matthew Booth2011-10-311-1/+1
| | | | | | | | | | | When given an invalid debug command, libguestfs responds with the error message: libguestfs: error: debug: use 'debug help' to list the supported commands However this command does not work, as debug requires two arguments. This change updates the message to prompt the user to use 'debug help 0'.