summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix verbose packet dumping functions.Richard Jones2009-09-172-3/+11
| | | | | | | | | | Add the configure parameter --enable-packet-dump so that this code can be enabled without editing the source. This code is normally commented out, because it is too verbose unless you happen to be debugging the underlying protocol. Because it is normally commented out, I found it had bit-rotted slightly. This commit also fixes the obvious problems.
* 'len' should be an unsigned 32 bit int.Richard Jones2009-09-171-1/+1
| | | | | This only happened to work by accident before because 'unsigned len' happens to be 32 bit on all platforms we support.
* Add echo_daemon commandMatthew Booth2009-09-142-0/+74
| | | | | echo_daemon is a simple echo which can be used to test connectivity between the client and daemon.
* Ignore some more m4 files.Richard Jones2009-09-091-0/+1
|
* daemon: diagnose socket write failureJim Meyering2009-08-204-9/+19
| | | | | | | | | * daemon/proto.c (send_chunk): Don't ignore socket-write error. * daemon/proto.c (send_file_end): Return "int", not void, so we can propagate send_chunk failure to caller. * daemon/daemon.h (send_file_end): Update prototype. * daemon/tar.c (do_tar_out, do_tgz_out): Update uses of send_file_end. * daemon/upload.c (do_download): Likewise.
* mke2fs: Use e4fsprogs programs if available.Richard W.M. Jones2009-08-191-3/+46
| | | | | | | On RHEL 5, mke2fs is ancient, and there is a non-standard "mke4fs" binary which acts like the more recent mke2fs on Fedora. Since there are several annoyances and actual bugs in the ancient RHEL 5 mke2fs, use mke4fs instead if it's available.
* New 'modprobe' command.Matthew Booth2009-08-182-0/+41
| | | | Allow kernel modules to be loaded into the appliance.
* Implement 'debug ls' and 'debug ll' commands.Richard Jones2009-08-182-3/+64
| | | | These commands can be used to list files in the appliance.
* Ignore manywarnings.m4 / warnings.m4.Richard W.M. Jones2009-08-171-0/+2
|
* Remove redundant macro.Richard W.M. Jones2009-08-171-2/+0
|
* indent with spaces, not TABsJim Meyering2009-08-173-19/+19
|
* daemon: enable -Werror and many gcc warnings when --enable-gcc-warningsJim Meyering2009-08-173-2/+66
| | | | | | | | | | * daemon/m4/gnulib-cache.m4: Add two modules: manywarnings, warnings. * daemon/configure.ac: Implement --enable-gcc-warnings, and selectively disable a few warning options that are either not useful or that provoke too many warnings for now. Define and AC_SUBST WARN_CFLAGS and WERROR_CFLAGS. * daemon/Makefile.am (guestfsd_CFLAGS): Use $(WARN_CFLAGS) and $(WERROR_CFLAGS), rather than just -Wall.
* xattr.c: avoid warning about comparison between signed and unsignedJim Meyering2009-08-171-4/+6
| | | | * daemon/xattr.c (getxattrs): Use an unsigned index.
* guestfsd: don't ignore failed write-to-socketJim Meyering2009-08-171-1/+1
| | | | | * daemon/proto.c (reply): Fix typo that would cause us to ignore failed write-to-socket.
* daemon.h: avoid warning about possible noreturn functionJim Meyering2009-08-171-1/+1
| | | | * daemon/daemon.h (main_loop): Use "noreturn" attribute.
* sfdisk.c, fallocate.c: use a string literal as formatJim Meyering2009-08-172-3/+3
| | | | | * daemon/fallocate.c (do_fallocate): Format was not a string literal. * daemon/sfdisk.c (sfdisk): Likewise.
* wc, blockdev: avoid warnings about discarding "const" qualifiersJim Meyering2009-08-172-2/+2
| | | | | * daemon/wc.c (wc): Make "flag" param const. * daemon/blockdev.c (call_blockdev): Likewise, for "switc".
* daemon/zero: don't ignore write and close errorsJim Meyering2009-08-171-4/+14
| | | | * daemon/zero.c (do_zero): Detect write and close errors.
* guestfsd.c: don't perform arithmetic on void pointersJim Meyering2009-08-171-2/+4
| | | | * daemon/guestfsd.c (xread, xwrite): Use char* pointers instead.
* command.c: avoid shadowing a global functionJim Meyering2009-08-171-4/+4
| | | | * daemon/command.c (do_sh_lines, do_sh): Do not shadow global "command".
* avoid warning about old-style no-param function definitionJim Meyering2009-08-172-3/+3
| | | | | * daemon/df.c (do_df, do_df_h): Add "void". * sync.c (do_sync): Likewise.
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-178-35/+31
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* New commands: mkfs-b, mke2journal*, mke2fs-J*Richard W.M. Jones2009-08-154-17/+218
| | | | | | | | | | mkfs-b: Pass the -b (blocksize) parameter to mkfs. mke2journal and friends: Lets you create external ext2 journals on devices. mke2fs-J and friends: Lets you create ext2/3/4 filesystems with external journals.
* build: avoid "make sytnax-check" failureJim Meyering2009-08-141-1/+1
| | | | * daemon/configure.ac: Change a leading TAB to 8 spaces.
* 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
|
* 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-131-4/+0
|
* do_equal does not need to explicitly check for NEED_ROOT/ABS_PATH.Richard Jones2009-08-131-4/+0
|
* 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: finish adding Dev_or_Path supportJim Meyering2009-08-132-4/+0
| | | | | | | | | | * 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: constify do_mkdtempJim Meyering2009-08-131-17/+8
| | | | | * daemon/dir.c (do_mkdtemp): Rewrite for a "const" parameter. * src/generator.ml (mkdtemp): Declare parameter to be of type Pathname.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-1342-325/+175
| | | | | | | | | | 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.
* 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-1313-53/+0
| | | | | | | | | | | | | | | | | | | | | 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.
* 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.
* Add 'setcon', 'getcon' commands to set and get the SELinux context.Richard Jones2009-08-133-0/+93
|
* Return error if allocations fail.Richard Jones2009-08-121-0/+12
|