summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* If using SELinux, mount /selinux in the appliance.Richard Jones2009-08-121-2/+8
| | | | | | 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.
* daemon/ls: make do_ll require root, like all the restJim Meyering2009-08-111-7/+10
| | | | | * ls.c (do_ll): Do invoke "NEED_ROOT" here, and add a FIXME to provide a "debug ll" command with the semantics we're removing.
* build: enable automake's silent rules optionJim Meyering2009-08-101-0/+3
| | | | | | | * configure.ac: Use AM_SILENT_RULES([yes]). Those who want verbose build output may configure with --disable-silent-rules or use "make V=1". * daemon/configure.ac: Likewise.
* build: daemon/do_debug: parameters aren't always unusedJim Meyering2009-08-101-1/+7
| | | | | | | | | * daemon/debug.c (MAYBE_UNUSED): Define. (do_debug): Mark parameters as unused only when they really are unused. Spotted by Richard Jones. SCALAR(0xdd8370) prefer sizeof *VAR sizeof TYPE (no semantic change)
* build: avoid warnings in daemon/inotify.cJim Meyering2009-08-101-3/+4
| | | | | | | | Avoid "comparison between signed and unsigned integer expressions" warnings. If it's at all hard or risky to avoid this type of warning, then it's not worthwhile. Here, it's easy and safe. * daemon/inotify.c (inotify_posn): Declare local to be of unsigned type. (do_inotify_read, do_inotify_files): Likewise.
* build: avoid warnings in daemon/guestfsd.cJim Meyering2009-08-101-2/+2
| | | | | * daemon/guestfsd.c (print_arginfo, print_shell_quote): Mark each "info" parameter as unused.
* build: avoid warnings in daemon/debug.cJim Meyering2009-08-101-1/+1
| | | | * daemon/debug.c (do_debug): Mark parameters as unused.
* define ATTRIBUTE_UNUSEDJim Meyering2009-08-101-0/+10
| | | | * daemon/daemon.h (__attribute__, ATTRIBUTE_UNUSED): Define.
* daemon/file.c: remove duplicate absolute-path checkJim Meyering2009-08-101-1/+0
| | | | | | * daemon/file.c (do_file): Remove redundant use of ABS_PATH. It's redundant because the preceding line invokes NEED_ROOT_OR_IS_DEVICE, which also invokes ABS_PATH.
* Always pass mkswap -f parameter.Richard Jones2009-08-061-2/+2
| | | | | Otherwise mkswap will give a silly error if you ask it to swap on a whole device.
* RHEL 5: inotify_init1 call did not exist on RHEL 5.Richard Jones2009-08-062-1/+23
|
* Fix errno check in readdir in devsparts.cMatthew Booth2009-08-061-3/+5
|
* daemon: use gnulibJim Meyering2009-08-064-1/+73
| | | | | | | | | | | | | | | | | * daemon/Makefile.am (SUBDIRS): Define. (AM_CPPFLAGS): Define, to include from gnulib's lib/ (LDADD): Define, to link with gnulib's libgnu.a. * daemon/configure.ac: Use AC_CONFIG_AUX_DIR([build-aux]), gl_EARLY and gl_INIT. (AC_CONFIG_FILES): Add lib/Makefile and tests/Makefile * daemon/m4/gnulib-cache.m4: New file, generated by running ../.gnulib/gnulib-tool --import --with-tests hash * daemon/.gitignore: Ignore all of the imported files. build: tell bootstrap about daemon/ * bootstrap: Run gnulib-tool --update in daemon/. Remove bootstrap's --gnulib-srcdir option, because it probably didn't work, and even if it did, we've discovered that using a separate git repo like that can lead to subtle mix-ups.
* Recognise cd-rom devices in devsparts.cMatthew Booth2009-08-061-72/+96
| | | | | | Also: * Un-duplicate device detection code by creating a common mapping function. * Add some more comments.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-0316-201/+201
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* build: reenable "syntax-check" rule: sc_const_long_optionJim Meyering2009-08-031-1/+1
| | | | | | | * cfg.mk (disable_temporarily): Remove sc_const_long_option. * daemon/guestfsd.c (main): Declare long_options to be "const". * fish/fish.c (main): Likewise. * test-tool/test-tool.c (main): Likewise.
* Add interface to Linux 'inotify' API.Richard W.M. Jones2009-07-312-0/+321
|
* New commands: swapon-*, swapoff-*, mkswap-file.Richard W.M. Jones2009-07-311-2/+128
| | | | | | | | | | | | swapon-device swapoff-device swapon-file swapoff-file swapon-label swapoff-label swapon-uuid swapoff-uuid mkswap-file
* New command: 'fallocate' to (pre-)allocate sized files.Richard W.M. Jones2009-07-312-0/+60
|
* New commands: 'ln', 'ln-f', 'ln-s', 'ln-sf' and 'readlink'.Richard W.M. Jones2009-07-312-0/+138
| | | | | These commands can be used to make hard and symbolic links. The readlink command is used to read existing symbolic links.