Commit Graph

268 Commits

Author SHA1 Message Date
Rafal Wojtczuk
1d24ef9d1a qrexec: when forgetting about a client/process, flush buffered data
We need to spawn a child to take care of buffered data flushing, if there
is any. Expensive, but should be needed rarely.
2011-03-17 18:15:04 +01:00
Rafal Wojtczuk
53b517f6a5 qrexec: move set_nonblock function to write_stdin
It will be needed there.
2011-03-17 17:53:33 +01:00
Rafal Wojtczuk
fb71bf968c qrexec_agent: when receiving close from daemon, check buffered data
We need to wait for buffer flush, so that buffered data is not lost,
and only then close pipe to the child.
2011-03-17 17:37:35 +01:00
Rafal Wojtczuk
af7fefa73f qrexec: handle buffered writes correctly
In case when we have a buffered write, always append to the
buffer, even if the pipe happens to be writable now. If not,
in case of certain tight race we might end up writing buffered data in
wrong order.
2011-03-17 16:53:29 +01:00
Rafal Wojtczuk
4087b1d052 Package qvm-copy-to-vm2*, too. 2011-03-16 16:47:32 +01:00
Rafal Wojtczuk
e410ad52ba Bloody perror messes with errno; need to save errno. 2011-03-16 16:24:54 +01:00
Rafal Wojtczuk
d40fb3a2e1 Fifo semantics is hard to get right.
Finally: we need to close the command pipe at EOF.
2011-03-16 16:11:05 +01:00
Rafal Wojtczuk
15bab70eae Handle pipe io in qrexec_agent properly
Don't reopen pipe after each read - no need, and it could lose events.
2011-03-16 15:18:37 +01:00
Rafal Wojtczuk
769eedd33a Make qrexec_client wait for its local child before exiting
If we do not wait and exit imemdiately, qrexec_daemon will decrease
the children count and continue spawning processes, while e.g.
qfile-daemon still waits for kdialog - so dom0 will be DoSed by
multiple processes.
2011-03-16 14:52:35 +01:00
Rafal Wojtczuk
27cfd6111a qrexec_daemon limits the number of its children
So that evil VM cannot just send flood of exec qfile-daemon requests,
and DoS dom0.
2011-03-16 14:21:45 +01:00
Rafal Wojtczuk
777eaa2168 In read_all()/write_all(), continue upon EINTR. 2011-03-16 12:58:40 +01:00
Rafal Wojtczuk
a195f436b7 In qfile-unpacker, set perms on the directory only on second pass.
It solves problem with transferring r.x directory. Originally, it
would fail when creating files in the directory (as it is not
writable). Now, we will create it rwx, create files in it, and fix
perms and utimes on the second pass.
[user@devel fcopy]$ ls -ald /boot
dr-xr-xr-x 4 root root 4096 Sep  1  2010 /boot
2011-03-16 12:48:29 +01:00
Rafal Wojtczuk
821f707053 Added qvm-copy-to-vm2.kde 2011-03-16 12:00:22 +01:00
Rafal Wojtczuk
2938ee5356 removed set -x from qvm-copy-to-vm2 2011-03-16 11:07:27 +01:00
Rafal Wojtczuk
ecf007b3a2 qfile-agent writes DONE to the status file at the end of work. 2011-03-16 11:06:27 +01:00
Rafal Wojtczuk
b01464670b New qvm-copy-to-vm, aka qvm-copy-to-vm2 2011-03-16 10:50:11 +01:00
Rafal Wojtczuk
5230c12934 qfile-agent: Handle filenames with trailing slash properly. 2011-03-16 10:48:27 +01:00
Rafal Wojtczuk
e6da61cb5e Scan filecopy sppool properly. 2011-03-16 10:14:39 +01:00
Rafal Wojtczuk
2ea7a0e77a Build filecopy tools with -g. 2011-03-16 10:11:55 +01:00
Rafal Wojtczuk
8ce0e0f39b Fixed permissions of qfile-daemon 2011-03-15 16:48:17 +01:00
Rafal Wojtczuk
84b1a186ff Added qfile-unpacker and qfile-daemon 2011-03-15 16:43:43 +01:00
Rafal Wojtczuk
f0a7620449 Package qfile-agent-dvm, too. 2011-03-15 16:19:42 +01:00
Rafal Wojtczuk
b8d983cfa9 Added qfile-agent 2011-03-15 16:07:00 +01:00
Rafal Wojtczuk
66bf0abb53 Use gui_fatal in qfile-agent-dvm.c 2011-03-15 13:12:21 +01:00
Rafal Wojtczuk
0ed004904c Handy gui_fatal() etc routines. 2011-03-15 13:00:12 +01:00
Rafal Wojtczuk
c0ca1a9f50 Make sure read_all sets errno to 0 at EOF. 2011-03-15 10:36:50 +01:00
Rafal Wojtczuk
6b6e6b7520 Added new qvm-open-in-dvm, aka qvm-open-in-dvm2
Small, childless bash script.
2011-03-14 11:25:18 +01:00
Rafal Wojtczuk
5d3c43e4fa created qfile-daemon-dvm
Mostly code from qfilexchgd; it will be removed soon.
2011-03-14 10:43:09 +01:00
Rafal Wojtczuk
00f4bf1197 qrexec_client accepts non-numeric domain description.
Just tries to open qrexec.argv[1].
2011-03-11 16:06:00 +01:00
Rafal Wojtczuk
470ddce435 qrexec_daemon creates VMname-based link to its socket 2011-03-11 14:14:04 +01:00
Rafal Wojtczuk
b9e0e93a90 In qrexec_client, check write_all(local_stdin_fd,..) value 2011-03-11 13:16:33 +01:00
Rafal Wojtczuk
1a5bfd8c2b Reset SIGPIPE in qrexec_daemon, too. 2011-03-11 13:08:19 +01:00
Rafal Wojtczuk
04da9b62a7 Added qfile-agent-dvm.c
Nations, rejoice.
2011-03-11 12:44:19 +01:00
Rafal Wojtczuk
bd89fa0631 Move copy_all_fd from dvm_file_editor.c to ioall.c
It is useful in e.g. qfile-agent-dvm.
2011-03-11 11:57:16 +01:00
Rafal Wojtczuk
64bce77ef7 Changed copy_all signature. 2011-03-11 11:54:39 +01:00
Rafal Wojtczuk
19943f093c Make dvm_file_editor use ioall.c 2011-03-11 11:50:52 +01:00
Rafal Wojtczuk
e19390ca1c Moved ioall.c file to "common" 2011-03-11 11:47:20 +01:00
Rafal Wojtczuk
9a4d53fc3b Added DVM_SPOOL definition to dvm2.h 2011-03-11 11:34:07 +01:00
Rafal Wojtczuk
c2214e854c Added dvm_file_editor.
It works with qrexec - reads/writes data from stdin/stdout.
2011-03-10 16:50:40 +01:00
Rafal Wojtczuk
f1a7df6e95 Implemented mechanism to trigger predefined execution in dom0.
Processes in AppVM can ask qrexec-agent to send a
MSG_AGENT_TO_SERVER_TRIGGER_EXEC message to qrexec-daemon.
The latter will execute predefined program. It is useful for
the purpose of file copy; the predefined program will create
a connected qfile-daemon<->qfile-agent pair.
2011-03-10 15:41:31 +01:00
Rafal Wojtczuk
8f90623661 Add ability to execute command without help of /bin/su
It is important, if the program closes stdout, but does not exit.
Then, qrexec_agent does not see EOF (because su still holds the
file descriptor).
2011-03-10 13:08:06 +01:00
Rafal Wojtczuk
a7cc09071f Make qubes_restore rexec-aware. 2011-03-08 13:03:55 +01:00
Rafal Wojtczuk
f263aa6b7c Moved vchan and u2mfn code to core. 2011-03-08 12:24:47 +01:00
Rafal Wojtczuk
0d12aeec88 added "make -C qrexec clean" 2011-03-07 16:13:15 +01:00
Rafal Wojtczuk
eb7821771e In qvm-start, check $DISPLAY existence, too. 2011-03-07 16:05:36 +01:00
Rafal Wojtczuk
62d0127647 Integrate qrexec with qvm-run. 2011-03-07 15:58:04 +01:00
Rafal Wojtczuk
27c8b05792 qrexec_daemon child should notify the parent. 2011-03-07 13:54:57 +01:00
Rafal Wojtczuk
50252ec64e qrexec_daemon parent should exit after connection to VM. 2011-03-07 13:50:30 +01:00
Rafal Wojtczuk
bb0507c89a Make qrexec_daemon socket accessible.
Set restructive umask after socket creation.
2011-03-04 17:41:54 +01:00
Rafal Wojtczuk
b899bfc9ba Daemonize qrexec_daemon. 2011-03-04 17:38:59 +01:00