Rename and fix from Marek's comments

This commit is contained in:
Frédéric Pierret (fepitre) 2019-05-07 14:09:46 +02:00
parent 4324dc1564
commit 2b2752f936
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2
6 changed files with 22 additions and 26 deletions

View File

@ -282,7 +282,7 @@ install-common: install-doc
install -m 0755 qubes-rpc/qubes.StartApp $(DESTDIR)/etc/qubes-rpc install -m 0755 qubes-rpc/qubes.StartApp $(DESTDIR)/etc/qubes-rpc
install -m 0755 qubes-rpc/qubes.PostInstall $(DESTDIR)/etc/qubes-rpc install -m 0755 qubes-rpc/qubes.PostInstall $(DESTDIR)/etc/qubes-rpc
install -m 0755 qubes-rpc/qubes.GetDate $(DESTDIR)/etc/qubes-rpc install -m 0755 qubes-rpc/qubes.GetDate $(DESTDIR)/etc/qubes-rpc
install -m 0755 qubes-rpc/admin.vm.TerminalDispVM $(DESTDIR)/etc/qubes-rpc install -m 0755 qubes-rpc/qubes.ShowInTerminal $(DESTDIR)/etc/qubes-rpc
install -d $(DESTDIR)/etc/qubes/rpc-config install -d $(DESTDIR)/etc/qubes/rpc-config
install -m 0644 qubes-rpc/rpc-config.README $(DESTDIR)/etc/qubes/rpc-config/README install -m 0644 qubes-rpc/rpc-config.README $(DESTDIR)/etc/qubes/rpc-config/README
for config in qubes-rpc/*.config; do \ for config in qubes-rpc/*.config; do \
@ -317,7 +317,7 @@ install-common: install-doc
install -m 0755 misc/tinyproxy-wrapper $(DESTDIR)/usr/lib/qubes/tinyproxy-wrapper install -m 0755 misc/tinyproxy-wrapper $(DESTDIR)/usr/lib/qubes/tinyproxy-wrapper
install -m 0755 misc/qvm-terminal $(DESTDIR)$(BINDIR)/qvm-terminal install -m 0755 misc/qvm-console $(DESTDIR)$(BINDIR)/qvm-console
install -d $(DESTDIR)/var/run/qubes install -d $(DESTDIR)/var/run/qubes
install -d $(DESTDIR)/rw install -d $(DESTDIR)/rw

View File

@ -8,7 +8,7 @@ etc/default/grub.d/30-qubes.cfg
etc/fstab etc/fstab
etc/needrestart/conf.d/50_qubes.conf etc/needrestart/conf.d/50_qubes.conf
etc/profile.d/qt_x11_no_mitshm.sh etc/profile.d/qt_x11_no_mitshm.sh
etc/qubes-rpc/admin.vm.TerminalDispVM etc/qubes-rpc/qubes.ShowInTerminal
etc/qubes-rpc/qubes.Backup etc/qubes-rpc/qubes.Backup
etc/qubes-rpc/qubes.DetachPciDevice etc/qubes-rpc/qubes.DetachPciDevice
etc/qubes-rpc/qubes.Filecopy etc/qubes-rpc/qubes.Filecopy
@ -101,7 +101,7 @@ usr/bin/qvm-move-to-vm
usr/bin/qvm-open-in-dvm usr/bin/qvm-open-in-dvm
usr/bin/qvm-open-in-vm usr/bin/qvm-open-in-vm
usr/bin/qvm-run-vm usr/bin/qvm-run-vm
usr/bin/qvm-terminal usr/bin/qvm-console
usr/bin/qvm-sync-clock usr/bin/qvm-sync-clock
usr/bin/xenstore-watch-qubes usr/bin/xenstore-watch-qubes
usr/lib/python2.7/dist-packages/qubesagent-*.egg-info/* usr/lib/python2.7/dist-packages/qubesagent-*.egg-info/*

View File

@ -3,7 +3,7 @@
print_usage() { print_usage() {
cat >&2 <<USAGE cat >&2 <<USAGE
Usage: $0 vmname Usage: $0 vmname
Connects to another VM console using the admin.vm.Terminal RPC service. Connects to another VM console using the admin.vm.Console RPC service.
USAGE USAGE
} }
@ -17,9 +17,9 @@ QREXEC_REQUESTED_TARGET="$1"
qrexec_console() { qrexec_console() {
QREXEC_REQUESTED_TARGET="$1" QREXEC_REQUESTED_TARGET="$1"
qrexec-client-vm "$QREXEC_REQUESTED_TARGET" admin.vm.Terminal qrexec-client-vm "$QREXEC_REQUESTED_TARGET" admin.vm.Console
# exit code 200 is flock exit code in admin.vm.Terminal # exit code 200 is flock exit code in admin.vm.Console
exit_code=$? exit_code=$?
if [ $exit_code -gt 0 ]; then if [ $exit_code -gt 0 ]; then
if [ $exit_code -ne 200 ]; then if [ $exit_code -ne 200 ]; then

View File

@ -1,17 +0,0 @@
#!/bin/bash --
set -eu
sock_name="$(mktemp -u XXXXXX)"
if [[ "$sock_name" =~ [^a-zA-Z0-9] ]]; then
echo "Invalid internal sock name provided."
exit 1
fi
sock="/var/run/qubes/$sock_name.terminal.sock"
xterm -geometry 80x24 -e /bin/sh -c "
until [ -S $sock ]; do sleep 1; done || true
exec socat file:/dev/tty,rawer,escape=0x0f UNIX-CONNECT:$sock" &
trap 'rm -rf -- "$sock"' EXIT
socat "UNIX-LISTEN:\"$sock\"" -
wait

View File

@ -0,0 +1,13 @@
#!/bin/bash --
set -eu
tmpdir="$(mktemp -d)"
sock="${tmpdir//\"/\"\\\"\"/}/terminal.sock"
xterm -geometry 80x24 -e /bin/sh -c "
until [ -S $sock ]; do sleep 0.1; done || true
exec socat file:/dev/tty,rawer,escape=0x0f UNIX-CONNECT:$sock" &
trap 'rm -rf -- "$tmpdir"' EXIT
socat "UNIX-LISTEN:\"$sock\"" -
wait

View File

@ -558,7 +558,7 @@ rm -f %{name}-%{version}
/etc/fstab /etc/fstab
/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes* /etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
%dir /etc/qubes-rpc %dir /etc/qubes-rpc
%config(noreplace) /etc/qubes-rpc/admin.vm.TerminalDispVM %config(noreplace) /etc/qubes-rpc/qubes.ShowInTerminal
%config(noreplace) /etc/qubes-rpc/qubes.Filecopy %config(noreplace) /etc/qubes-rpc/qubes.Filecopy
%config(noreplace) /etc/qubes-rpc/qubes.OpenInVM %config(noreplace) /etc/qubes-rpc/qubes.OpenInVM
%config(noreplace) /etc/qubes-rpc/qubes.OpenURL %config(noreplace) /etc/qubes-rpc/qubes.OpenURL
@ -628,7 +628,7 @@ rm -f %{name}-%{version}
/usr/bin/qubes-run-terminal /usr/bin/qubes-run-terminal
/usr/bin/qubes-open /usr/bin/qubes-open
/usr/bin/qubes-session-autostart /usr/bin/qubes-session-autostart
/usr/bin/qvm-terminal /usr/bin/qvm-console
%dir /usr/lib/qubes %dir /usr/lib/qubes
/usr/lib/qubes/prepare-suspend /usr/lib/qubes/prepare-suspend
/usr/lib/qubes/qfile-agent /usr/lib/qubes/qfile-agent