Browse Source

Add admin.vm.TerminalDispVM qubes-rpc

Frédéric Pierret (fepitre) 5 years ago
parent
commit
4324dc1564
4 changed files with 20 additions and 1 deletions
  1. 1 1
      Makefile
  2. 1 0
      debian/qubes-core-agent.install
  3. 17 0
      qubes-rpc/admin.vm.TerminalDispVM
  4. 1 0
      rpm_spec/core-agent.spec.in

+ 1 - 1
Makefile

@@ -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.PostInstall $(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 -d $(DESTDIR)/etc/qubes/rpc-config
 	install -m 0644 qubes-rpc/rpc-config.README $(DESTDIR)/etc/qubes/rpc-config/README
 	for config in qubes-rpc/*.config; do \

+ 1 - 0
debian/qubes-core-agent.install

@@ -8,6 +8,7 @@ etc/default/grub.d/30-qubes.cfg
 etc/fstab
 etc/needrestart/conf.d/50_qubes.conf
 etc/profile.d/qt_x11_no_mitshm.sh
+etc/qubes-rpc/admin.vm.TerminalDispVM
 etc/qubes-rpc/qubes.Backup
 etc/qubes-rpc/qubes.DetachPciDevice
 etc/qubes-rpc/qubes.Filecopy

+ 17 - 0
qubes-rpc/admin.vm.TerminalDispVM

@@ -0,0 +1,17 @@
+#!/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

+ 1 - 0
rpm_spec/core-agent.spec.in

@@ -558,6 +558,7 @@ rm -f %{name}-%{version}
 /etc/fstab
 /etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
 %dir /etc/qubes-rpc
+%config(noreplace) /etc/qubes-rpc/admin.vm.TerminalDispVM
 %config(noreplace) /etc/qubes-rpc/qubes.Filecopy
 %config(noreplace) /etc/qubes-rpc/qubes.OpenInVM
 %config(noreplace) /etc/qubes-rpc/qubes.OpenURL