From fcf51c6a6f3e0bb36b18ae524b9deb535b763328 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 12 Mar 2013 16:00:31 +0100 Subject: [PATCH] Remove qclipd - now part of qubes-manager --- dom0/clipboard_notifier/qclipd | 91 ---------------------------------- dom0/qvm-core/qubes.py | 8 --- dom0/qvm-core/qubesutils.py | 2 +- dom0/qvm-tools/qvm-run | 1 - rpm_spec/core-dom0.spec | 2 - 5 files changed, 1 insertion(+), 103 deletions(-) delete mode 100755 dom0/clipboard_notifier/qclipd diff --git a/dom0/clipboard_notifier/qclipd b/dom0/clipboard_notifier/qclipd deleted file mode 100755 index 4ba56580..00000000 --- a/dom0/clipboard_notifier/qclipd +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/python2 -# -# The Qubes OS Project, http://www.qubes-os.org -# -# Copyright (C) 2010 Joanna Rutkowska -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# - -import os -import daemon -from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent -import dbus -from dbus.mainloop.glib import DBusGMainLoop -import glib,gobject -from qubes.qubes import QubesDaemonPidfile - -qubes_clipboard_info_file = "/var/run/qubes/qubes_clipboard.bin.source" - -def watch_qubes_clipboard(): - def tray_notify(str, timeout = 3000): - notify_object.Notify("Qubes", 0, "dialog-information", "", str, [], [], timeout, dbus_interface="org.freedesktop.Notifications") - - glib_mainloop = DBusGMainLoop(set_as_default=True) - notify_object = dbus.SessionBus().get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications", follow_name_owner_changes=True) - wm = WatchManager() - mask = EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE') - - if not os.path.exists (qubes_clipboard_info_file): - file = open (qubes_clipboard_info_file, 'w') - file.close() - - class ClipboardWatcher(ProcessEvent): - def process_IN_CLOSE_WRITE (self, event): - src_info_file = open (qubes_clipboard_info_file, 'r') - src_vmname = src_info_file.readline().strip('\n') - if src_vmname == "": - tray_notify ("Qubes Clipboard has been copied to the VM and wiped.\n"\ - "Trigger a paste operation (e.g. Ctrl-v) to insert it into an application." ) - else: - print src_vmname - tray_notify ("Qubes Clipboard fetched from VM: '{0}'\n"\ - "Press Ctrl-Shift-v to copy this clipboard onto dest VM's clipboard.".format(src_vmname)) - src_info_file.close() - - notifier = Notifier(wm, ClipboardWatcher()) - wdd = wm.add_watch(qubes_clipboard_info_file, mask) - - def process_inotify(source, cb_condition): - if notifier.check_events(): - notifier.read_events() - notifier.process_events() - return True - - glib.io_add_watch(wm.get_fd(), glib.IO_IN, process_inotify) - - gobject.MainLoop().run() - -def main(): - lock = QubesDaemonPidfile ("qclipd") - if lock.pidfile_exists(): - if lock.pidfile_is_stale(): - lock.remove_pidfile() - print "Removed stale pidfile (has the previous daemon instance crashed?)." - else: - exit (0) - - context = daemon.DaemonContext( - working_directory = "/var/run/qubes", - pidfile = lock) - - with context: - watch_qubes_clipboard() - - lock.remove_pidfile() - -if __name__ == "__main__": - main() diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 6edaebfd..a620bcec 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -51,7 +51,6 @@ if not dry_run: qubes_guid_path = "/usr/bin/qubes_guid" qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon" qrexec_client_path = "/usr/lib/qubes/qrexec_client" -qubes_clipd_path = "/usr/bin/qclipd" qubes_base_dir = "/var/lib/qubes" @@ -1496,13 +1495,6 @@ class QubesVm(object): p = self.run('QUBESRPC qubes.WaitForSession none', user="root", passio_popen=True, gui=False, wait=True) p.communicate(input=self.default_user) - retcode = subprocess.call([qubes_clipd_path]) - if retcode != 0: - print >> sys.stderr, "ERROR: Cannot start qclipd!" - - if notify_function is not None: - notify_function("error", "ERROR: Cannot start the Qubes Clipboard Notifier!") - def start_guid(self, verbose = True, notify_function = None): if verbose: print >> sys.stderr, "--> Starting Qubes GUId..." diff --git a/dom0/qvm-core/qubesutils.py b/dom0/qvm-core/qubesutils.py index 2fb63aa9..d51b74e3 100644 --- a/dom0/qvm-core/qubesutils.py +++ b/dom0/qvm-core/qubesutils.py @@ -22,7 +22,7 @@ from qubes import QubesVm,QubesException,QubesVmCollection from qubes import QubesVmClasses -from qubes import xs, xl_ctx, qubes_guid_path, qubes_clipd_path, qrexec_client_path +from qubes import xs, xl_ctx, qubes_guid_path, qrexec_client_path from qubes import qubes_store_filename, qubes_base_dir from qubes import qubes_servicevms_dir, qubes_templates_dir, qubes_appvms_dir import sys diff --git a/dom0/qvm-tools/qvm-run b/dom0/qvm-tools/qvm-run index b8a6fe10..1e1af52b 100755 --- a/dom0/qvm-tools/qvm-run +++ b/dom0/qvm-tools/qvm-run @@ -34,7 +34,6 @@ import sys import os import os.path -qubes_clipd_path = "/usr/bin/qclipd" notify_object = None # how long (in sec) to wait for VMs to shutdown diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index 9bb8ac0d..0da0b522 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -112,7 +112,6 @@ cp systemd/qubes-qmemman.service $RPM_BUILD_ROOT%{_unitdir} mkdir -p $RPM_BUILD_ROOT/usr/bin/ cp qvm-tools/qvm-* $RPM_BUILD_ROOT/usr/bin cp qvm-tools/qubes-* $RPM_BUILD_ROOT/usr/bin -cp clipboard_notifier/qclipd $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/etc/xen/scripts cp dispvm/block.qubes $RPM_BUILD_ROOT/etc/xen/scripts @@ -401,7 +400,6 @@ fi %config(noreplace) %attr(0664,root,qubes) %{_sysconfdir}/qubes/qmemman.conf /usr/bin/qvm-* /usr/bin/qubes-* -/usr/bin/qclipd %dir %{python_sitearch}/qubes %{python_sitearch}/qubes/qubes.py %{python_sitearch}/qubes/qubes.pyc