Commit Graph

214 Commits

Author SHA1 Message Date
Marta Marczykowska-Górecka
dffe0b2f1a
Make qvm-copy/move[-to-vm] one script
Instead of two scripts calling one another, now it's
only one script, with added variable names inside for clarity.
Also hopefully finally fixes the help messages for good.

fixes QubesOS/qubes-issues#4058
2019-09-09 22:03:48 +02:00
Frédéric Pierret (fepitre)
e27296da3c
Allow creating TCP sockets between qubes
QubesOS/qubes-issues#2148
2019-08-08 15:48:37 +02:00
Marek Marczykowski-Górecki
ec32be73ed
Specify expected shell in su calls
When calling su with a specific script, specify /bin/sh shell to be sure
to use posix compliant shell. User shell may not be a one (like fish).

Fixes QubesOS/qubes-issues#5135
2019-07-05 20:38:04 +02:00
Marek Marczykowski-Górecki
08a853b960
Merge branch 'remove-qrexec'
* remove-qrexec:
  travis: update for R4.1
  Remove qrexec-agent related files
2019-06-06 23:20:11 +02:00
Frédéric Pierret (fepitre)
0c3421cfa8
qubes.ShowInTerminal: simply exit if mktemp generate " character 2019-05-11 11:54:24 +02:00
Frédéric Pierret (fepitre)
2b2752f936
Rename and fix from Marek's comments 2019-05-07 15:01:34 +02:00
Frédéric Pierret (fepitre)
4324dc1564
Add admin.vm.TerminalDispVM qubes-rpc 2019-05-05 17:59:44 +02:00
Marek Marczykowski-Górecki
20285bc6c2
Remove qrexec-agent related files
Move it to the core-qrexec repository.

QubesOS/qubes-issues#4955
2019-04-08 18:22:38 +02:00
Marek Marczykowski-Górecki
b47a61adcf
Make shellcheck happy 2018-12-15 23:45:34 +01:00
Marek Marczykowski-Górecki
3b0f80e19f
Make shebang explicit /usr/bin/python2 where it's still there
Both Archlinux and Fedora 29 have guidelines to point explicitly at
/usr/bin/python2 where it expect python2.

Also, do not use env.

Fixes QubesOS/qubes-issues#4027
2018-10-24 00:24:50 +02:00
Marek Marczykowski-Górecki
d1f55ffeb8
appmenus: send only persistent appmenus entries, use $XDG_DATA_*
It may be useful to create AppVM-specific menu entries in AppVM itself.
It may be an application installed there (in /usr/local, or using snap
QubesOS/qubes-issues#2766), but it may be also some user custom
shortcut.
To support this, dom0 will accept menu entries also from
TemplateBasedVMs. But to avoid duplicates, qubes.GetAppmenus service
should send only menu entries actually stored in that VM, not inherited
from its template. To distingush them, first check what type of
persistence this VM has (from qubesdb-read /qubes-vm-persistence). If
it's rw-only, send only entries stored on /rw.

To make it more robust, use $XDG_DATA_DIRS and $XDG_DATA_HOME to
discover directories, instead of looking only for
/usr/{,local/}share/applications. This makes snap and flatpak handled
for free.

Fixes QubesOS/qubes-issues#4152
2018-10-09 06:06:58 +02:00
Rusty Bird
ff77c78ecc
Unify qvm-{copy,move}-to-vm.{gnome,kde} and fix some bugs
- Symlink the other three tools to qvm-copy-to-vm.gnome, use the same
  code where possible, and select differing behavior based on invoked
  name (like the CLI tools). This brings qvm-move-to-vm.kde up to date
  for R4.0 (bugfix on 89183e9).

- Get rid of a window focus race between zenity/kdialog and the
  qubes.Filecopy dom0 permission dialog: Only launch the GUI after the
  first line has been read from qfile-agent.

- Avoid visual glitches (e.g. for a non-existing file) by special-casing
  a no-op progress function for $SIZE == 0.

- Pass -- separator between 'rm -rf' and the files to be removed, in
  case someone or something ever invokes the tool on relative file names
  starting with a dash.

- Pass -b (implies --apparent-size) and -s to du, to simplify percentage
  calculation and to avoid unnecessary output.
2018-07-25 12:44:53 +00:00
Rusty Bird
8da7c7af60
qfile-agent.c: exit on EPIPE after gui progress write
The qvm-{copy,move}-to-vm.{gnome,kde} cancel buttons didn't actually
cancel, because qfile-agent ignored EPIPE and - via qfile_pack_init() -
SIGPIPE. So it never noticed when the local PROGRESS_TYPE=gui reader had
shut down.
2018-07-25 12:44:52 +00:00
Marta Marczykowska-Górecka
99f239ea9e
Avoid leaking VM name in qvm-copy usage text
Do not display name of the qube in the usage text.
2018-07-16 18:33:54 +02:00
Marta Marczykowska-Górecka
96d8914c83
Add proper help text to qvm-copy tools and fix incorrect behavior
for qvm-move

Added more descriptive usage text to the
qvm-copy/qvm-move/qvm-copy-to-vm/qvm-move-to-vm family of tools.
Also fixed bug that removed the file being moved for qvm-move-to-vm,
but not for qvm-move.

fixes QubesOS/qubes-issues#3529
fixes QubesOS/qubes-issues#4020
2018-07-16 18:33:39 +02:00
Marek Marczykowski-Górecki
b5a9d9bf8e
Add build-time assert for filename buffer size
Suggested by @cfcs
2018-05-28 22:45:39 +02:00
Marek Marczykowski-Górecki
e8a2d9c32a
Add file managers integration for qvm-open-in-dvm --view-only
Rename existing entry from 'Open In DisposableVM' to 'Edit in
DisposableVM', then add new 'View In DisposableVM'.

Fixes QubesOS/qubes-issues#1118
2018-05-26 03:09:41 +02:00
Marek Marczykowski-Górecki
42b1355957
qvm-open-in-vm: mark file as read-only if opened with --view-only
This will cause most applications to disallow changing the file and also
add some visual indication about the view being read only. This will
avoid making the changes that would be discarded later.

QubesOS/qubes-issues#1118
2018-05-26 03:09:40 +02:00
Marek Marczykowski-Górecki
ef557ca460
qvm-open-in-vm: implement --view-only option
Implement option to disallow (ignore in fact) modifications of file
opened in another VM (including DispVM).
This commit implements actual services part and handling in wrapping scripts.

Fixes QubesOS/qubes-issues#1118
2018-05-26 03:09:40 +02:00
Marek Marczykowski-Górecki
5deac1802f
qubes-rpc: fix code style - indent with spaces 2018-05-26 00:54:09 +02:00
X4lldux
9fa75314f1
Move/Copy many files in one step via nautilus extension 2018-04-30 02:40:23 +02:00
Marek Marczykowski-Górecki
a850e3aaee
Merge remote-tracking branch 'qubesos/pr/109'
* qubesos/pr/109:
  Fix GCC8 warnings
2018-04-21 01:20:52 +02:00
Marek Marczykowski-Górecki
c278d56bea
Update gitignore and make clean target
Debian build require clean sources (make clean must return the sources
to the state from before build).
2018-04-20 16:27:26 +02:00
Frédéric Pierret
c43c4df7b9
Fix GCC8 warnings 2018-04-20 08:52:45 +02:00
Marek Marczykowski-Górecki
96aa933024
Wait for user session as X session owner
... instead of requested user. This makes sure that session startup
script will be able to send a signal here to notify about session
startup.

This is especially needed when the first service started in the VM is
called as root (like qubes.InstallUpdatesGUI).

Fixes QubesOS/qubes-issues#3526
2018-02-14 02:19:15 +01:00
Marek Marczykowski-Górecki
c142e20baa
Do not sync VM time with clockvm if it's set to network time sync
When VM is set to synchronize the time with the network, to not sync its
time with clockvm.
Besides not having sense, in default configuration it will lead to
loopback qrexec connection (sys-net -> sys-net), which will hang.

QubesOS/qubes-issues#3333
2018-02-13 04:23:08 +01:00
Marek Marczykowski-Górecki
ee122eefef
Detach all drivers from PCI devices before suspend
The most common thing to fix S3 sleep is to unload PCI devices drivers
before suspend. Instead of having every user figuring out what drivers
needs to be blacklisted, detach all drivers from actual PCI devices.
Exclude qemu emulated devices.

Fixes QubesOS/qubes-issues#3486
2018-01-22 21:53:03 +01:00
Marek Marczykowski-Górecki
79b38cf106
Place list of loaded modules in /var/run directly
Do not use /var/run/qubes for this, as it may be non-root writeable and
someone may want to isolate root/user.
Also, remove the file after resume.
2018-01-22 19:13:53 +01:00
Rusty Bird
6c2b9fd638
qvm-run-vm: wait for X11 in DispVM case
qvm-run-vm cannot make a separate qubes.WaitForSession call for a
DispVM. Instead, pass the new WaitForSession argument to qubes.VMShell,
which will do the equivalent.
2018-01-14 19:21:01 +00:00
Rusty Bird
72fef1ee4c
qvm-run-vm: appease ShellCheck without comment 2018-01-14 19:20:59 +00:00
Rusty Bird
ce1f0af216
Set 'wait-for-session=1' for 'qubes.VMShell+WaitForSession'
This is intended to be used for DispVMs for which only a single RPC call
can be made before they are destroyed.

Fixes QubesOS/qubes-issues#3012
2018-01-14 19:20:58 +00:00
Marek Marczykowski-Górecki
7d82029aec
Fix kdialog --progressbar usage
Returned dbus reference is multi-word string, it was not quoted on
purpose. ShellCheck was wrong about it.

QubesOS/qubes-issues#3449
2018-01-08 03:07:14 +01:00
Marek Marczykowski-Górecki
ec83df64e3
qubes.GetImageRGBA: fix handling '-' path without explicit type
There was a bug that interpreted '-' as file type. But convert don't
know how to handle '-' file type, so refused to proceed.

Fixes QubesOS/qubes-issues#3085
2017-12-22 16:48:37 +01:00
Rusty Bird
8d8902f32a
qvm-{copy,move}: fix spurious deprecation message
qvm-{copy,move} run qvm-{copy,move}-to-vm with $default as the VM
argument. Don't print the deprecation message in that case.
2017-12-13 23:48:39 +00:00
Marek Marczykowski-Górecki
84374bbdec
Merge remote-tracking branch 'qubesos/pr/76'
* qubesos/pr/76:
  Fix language issues and usability issue
2017-12-13 19:48:24 +01:00
Marek Marczykowski-Górecki
1651866aa2
Merge remote-tracking branch 'qubesos/pr/72'
* qubesos/pr/72:
  Fix UCA mistake and qvm-actions script
  Fix ShellCheck comments
  Add debian package support
  Disable Thunar thumbnails
  Add support for Thunar Qubes VM tools
2017-12-13 19:47:16 +01:00
TomZ
3abc3b1b75
Fix language issues and usability issue 2017-12-13 10:15:20 +01:00
Marek Marczykowski-Górecki
362e19349f
Add hint to use qvm-copy/qvm-move instead of qvm-*-to-vm
Fixes QubesOS/qubes-issues#3251
2017-12-13 02:51:41 +01:00
Frédéric Pierret
c34a0a9e07
Fix UCA mistake and qvm-actions script 2017-12-12 22:12:48 +01:00
Frédéric Pierret
6226531bd5
Fix ShellCheck comments 2017-11-22 15:45:51 +01:00
Frédéric Pierret
0fd109b8f1
Add support for Thunar Qubes VM tools 2017-11-18 13:19:40 +01:00
Marek Marczykowski-Górecki
5edd3b3f75
Merge branch 'fixes-20171019'
* fixes-20171019:
  debian: cleanup after splitting qubes-core-agent
  Fix removing temporary file after editing in (Disp)VM
  network: fix rules for network setup on new udev
  debian: disable timer-based apt-get
2017-10-19 16:51:12 +02:00
Marek Marczykowski-Górecki
e2789ca2d7
Fix removing temporary file after editing in (Disp)VM
Fix removing the file - do not free its filename just before unlink call
(scheduled with atexit function).
At the same time, place the temporary file in a unique directory,
making it possible to edit multiple files with the same name at once.
Remove that directory at exit too.

Fixes QubesOS/qubes-issues#3112
2017-10-19 16:18:01 +02:00
Marek Marczykowski-Górecki
d8a2b8c375
Add support for new root volume partition layout to qubes.ResizeDisk
If root filesystem is the last partition (new layout), resize it
in-place. Use 'parted' tool because it can resize just one partition,
without need to specify the whole new partition table. Since the
partition is mounted, parted is unhappy to modify it. Force it by
answering to its interactive prompts, and add (apparently not
documented) ---pretend-input-tty to use those answers even
though stdin is not a tty. Split the operation into multiple parted
calls, for more reliable interactive prompts handling.

Qubes 3.x disk layout (no partition table) is also supported, but the
one that was used in Qubes 4.0 rc1 (root filesystem as the first
partition) is not.

Fixes QubesOS/qubes-issues#3173
QubesOS/qubes-issues#3143
2017-10-18 19:53:48 +02:00
Marek Marczykowski-Górecki
a59ac1b4f9
qubes.ResizeDisk: handle dmroot being a symlink
In non-template-based-VMs it can be just a symlink (depending on
initramfs version).
2017-10-02 19:42:00 +02:00
Marek Marczykowski-Górecki
486f17ec2d
Add convenient wrappers for qvm-copy-to-vm and qvm-move-to-vm
Default `ask` policy ignore target domain specified by the caller, so it
doesn't make sense to specify one. Provide convenient wrappers not
needing one. Do not change behaviour of existing tools for compatibility
reasons.

Fixes QubesOS/qubes-issues#3141
2017-10-02 05:14:49 +02:00
Marek Marczykowski-Górecki
aad6fa6d19
Hint shellcheck where to look for sourced files, if in repository
This will ease running shellcheck from the repository.
2017-09-30 05:05:34 +02:00
Marek Marczykowski-Górecki
9c839d789f
qubes-rpc: fix issues found by shellcheck
Most of them are missing quotes, `` -> $(), and -o/-a usage in
conditions. Also add few directives disabling checks where were too
verbose.
2017-09-30 04:45:31 +02:00
Marek Marczykowski-Górecki
ac97a3ca87
Look for applications also in subdirectories of .../applications
This is especially needed for KDE applications, which live in
/usr/share/applications/kde4.

Fixes QubesOS/qubes-issues#3092
2017-09-16 12:25:39 +02:00
Frederic Pierret (Epitre)
11f86ca4e4
Handle fallthrough with attribute(noreturn) for consistancy and compatiblity with older GCC 2017-09-07 16:38:35 +02:00