summaryrefslogtreecommitdiffstats
path: root/daemon/command.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* daemon: Keep Coverity happy by ignoring some return values.Richard W.M. Jones2011-06-091-5/+13
|
* proto: Fix FileIn ops that abort during the chunk upload stage.Richard W.M. Jones2011-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a previous, incorrect attempt to fix RHBZ#576879 we tried to prevent the daemon from sending an error reply if the daemon had cancelled the transfer. This is wrong: the daemon should send an error reply in these cases. A simple test case is this: guestfish -N fs -m /dev/sda1 upload big-file / (This fails because the target "/" is a directory, not a file.) Prior to this commit, libguestfs would hang instead of printing an error. With this commit, libguestfs prints an error. What is happening is: (1) Library is uploading a file (2) In the middle of the long upload, daemon detects an error. Daemon cancels. (3) Library detects cancel, sends cancel chunk, then waits for the error reply from the daemon. (4) Daemon is supposed to send an error reply message. Because step (4) wasn't happening, uploads that failed like this would hang in the library (waiting for the error message, while the daemon was waiting for the next request). This also adds a regression test. This temporarily breaks the "both ends cancel" case (RHBZ#576879c5). Therefore the test for that is disabled, and this is fixed in the next patch in the series. This partially reverts commit dc706a639eec16084c0618baf7bfde00c6565f63.
* daemon: Don't use ../src path to include generator_protocol.hRichard W.M. Jones2010-11-031-1/+1
| | | | | This file is already hard-linked into the current directory, so the relative path is not required.
* Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).Richard Jones2010-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | During a FileIn command (eg. upload, tar-in) if both sides experience errors, then both sides could send cancel messages, the result being lost synchronization. The reason for the lost synch was because the daemon was ignoring this case and sending an error message back which the library side (which had cancelled) was not expecting. Fix this by checking in the daemon for the case where the library also cancels during daemon cancellation, and not sending an error messages. This also includes an enhanced regression test which checks for this case. This extends the original fix in commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0. More details can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
* Fix upload losing synchronization if root not mounted (RHBZ#576879).Richard Jones2010-04-171-1/+1
| | | | | | | | | | | | Modify the generator so that it can correctly handle early cancellation for Pathname|Device|.. parameters. This fixes the upload command, but consequently we need to fix the parameters for tar_in and t?z_in commands. This should also mean that 'win:' can now be used as the second argument of tar_in and t?z_in commands in guestfish, whereas previously this wouldn't have worked. Adds a regression test for the original problem.
* daemon: Don't need to prefix error messages with the command name.Richard Jones2010-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | The RPC stubs already prefix the command name to error messages. The daemon doesn't have to do this. As a (small) benefit this also makes the daemon slightly smaller. Code in the daemon such as: if (argv[0] == NULL) { reply_with_error ("passed an empty list"); return NULL; } now results in error messages like this: ><fs> command "" libguestfs: error: command: passed an empty list (whereas previously you would have seen ..command: command:..)
* Fix prototype of commandv to match prototype of commandrv.Richard Jones2009-11-091-1/+1
|
* 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".
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-171-6/+6
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* generator.ml: use new "Pathname" designationJim Meyering2009-08-131-2/+2
| | | | | | | | | | 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.
* update all NEED_ROOT usesJim Meyering2009-08-131-1/+1
| | | | | | run this command: git grep -l -w NEED_ROOT|xargs perl -pi -e \ 's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
* 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.
* Make /sysroot path configurable.Richard Jones2009-07-181-8/+19
| | | | | | | | | Currently /sysroot is hard-coded throughout the daemon code. This patch turns the path into a variable so that we can change it in future, for example to allow standalone mode to be implemented. This patch was tested by running all the C API tests successfully.
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* Add 'sh' and 'sh-lines' commands.Richard Jones2009-06-221-0/+16
|
* In the daemon, change all const char * parameters to char *.Richard Jones2009-06-101-2/+2
|
* Fix RHBZ#503169 comment 13 (regression) and add a regression test.Richard Jones2009-06-041-4/+7
|
* Use --rbind rather than --bind for bind mounting /dev (to get /dev/pts).Charles Duffy2009-06-041-3/+3
|
* Refactor line splitting code in the daemon, and fix it so it works.Richard Jones2009-05-121-24/+3
|
* Bind-mount /dev, /proc and /sys into chroot when running commands.Richard Jones2009-04-301-0/+20
|
* Better handling of trailing \n problem.Richard Jones2009-04-141-4/+4
|
* Add 'command' and 'command-lines'. Fix args freeing in Perl bindings.Richard Jones2009-04-141-0/+101