[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#857543: marked as done (unblock: cinnamon-screensaver/3.2.13-2)



Your message dated Sun, 12 Mar 2017 19:32:26 +0000
with message-id <E1cn9EA-0004ag-KS@respighi.debian.org>
and subject line unblock cinnamon-screensaver
has caused the Debian Bug report #857543,
regarding unblock: cinnamon-screensaver/3.2.13-2
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
857543: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857543
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package cinnamon-screensaver, in order to fix important bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853064

Version 3.2 of the cinnamon-screensaver is a complete re-write of the
screensaver. Previous versions used a file called "cinnamon-screensaver-dialog"
to show the actual password dialog, while the current version has the password
dialog integrated.

What this means is that for users that are upgrading from a version before 3.2
while running cinnamon-screensaver, they are no longer able to unlock the screen
until they restart the screensaver.

Current users of stretch have most likely already been hit by this (unless they
don't upgrade very often) and have dealt with it, but users of stable will be
hit by this when they upgrade to stretch.

The 3.2.13-2 version includes a transition script, located in the same path as
the old binary, that detects that it's been called and automatically restarts
the screensaver.

I'm attaching the debdiff to the current version in unstable/testing, as well as
the script itself (for easier reviewing).  I haven't made the upload yet, please
let me know if it's ok for me to do this upload, thanks.

unblock cinnamon-screensaver/3.2.13-2

-- 
Thanks,
Marga
diff -Nru cinnamon-screensaver-3.2.13/debian/changelog cinnamon-screensaver-3.2.13/debian/changelog
--- cinnamon-screensaver-3.2.13/debian/changelog	2017-01-03 20:56:14.000000000 +0100
+++ cinnamon-screensaver-3.2.13/debian/changelog	2017-03-12 12:24:52.000000000 +0100
@@ -1,3 +1,11 @@
+cinnamon-screensaver (3.2.13-2) unstable; urgency=medium
+
+  * Add debian/cinnamon-screensaver-dialog, a helper script to ease the
+    transition from a pre 3.2 screensaver to the 3.2 screensaver. Thanks to
+    Michael Schaller for providing the script. (Closes: 853064)
+
+ -- Margarita Manterola <marga@debian.org>  Sun, 12 Mar 2017 12:24:52 +0100
+
 cinnamon-screensaver (3.2.13-1) unstable; urgency=medium
 
   * New upstream release (3.2.13).
diff -Nru cinnamon-screensaver-3.2.13/debian/cinnamon-screensaver-dialog cinnamon-screensaver-3.2.13/debian/cinnamon-screensaver-dialog
--- cinnamon-screensaver-3.2.13/debian/cinnamon-screensaver-dialog	1970-01-01 01:00:00.000000000 +0100
+++ cinnamon-screensaver-3.2.13/debian/cinnamon-screensaver-dialog	2017-03-12 12:24:52.000000000 +0100
@@ -0,0 +1,131 @@
+#!/usr/bin/env python3
+# License: LGPL-2+
+# Copyright: 2017, Google, Inc
+"""Transitional script to restart older cinnamon-screensavers.
+
+Older cinnamon-screensavers (<= 3.0) use the cinnamon-screensaver-dialog binary
+that is no longer present with newer cinnamon-screensavers (>= 3.2). As the
+binary is missing the unlock prompt can't be shown and hence the older and
+still running cinnamon-screensaver can't be unlocked anymore after a package
+update to a newer cinnamon-screensaver.
+
+This script is placed instead of cinnamon-screensaver-dialog and if it is
+executed it checks that it got executed from cinnamon-screensaver. If that is
+true the currently running older cinnamon-screensaver will be restarted so that
+the newer cinnamon-screensaver runs. Immediately afterwards the screensaver is
+locked via 'cinnamon-screensaver-command --lock'.
+"""
+
+import datetime
+import logging
+import os
+import signal
+import subprocess
+import sys
+
+def Main():
+    """Main function. Returns exit code."""
+    xerrors = os.path.expanduser("~/.xsession-errors")
+    logformat = ("cinnamon-screensaver-dialog[%(process)d]: %(asctime)s "
+                "%(levelname)-8s %(message)s")
+    logging.basicConfig(level=logging.DEBUG, filename=xerrors, format=logformat)
+    logging.info("Start of cinnamon-screensaver-dialog transition script.")
+
+    # Check if the parent process is cinnamon-screensaver.
+    ppid = os.getppid()
+    with open("/proc/{0}/cmdline".format(ppid)) as f:
+        pcmd = f.read()
+    if not "cinnamon-screensaver" in pcmd:
+        logging.error(
+            "Parent process isn't cinnamon-screensaver. Parent PID: %d. "
+            "Parent process command line: %s", ppid, pcmd)
+        return 1
+
+    # Terminate the cinnamon-screensaver process (old version) and wait for it
+    # to be gone. We terminate it instead of gracefully shutting it down via
+    # 'cinnamon-screensaver-command --exit' as that would also terminate this
+    # script. In any case the cinnamon-session will log a warning that the
+    # screensaver has left the bus.
+    logging.info(
+        "Killing old cinnamon-screensaver process with PID %d ...", ppid)
+    os.kill(ppid, signal.SIGTERM)
+
+    # Wait for the cinnamon-screensaver process to be gone. The timeout is
+    # 1 second. The while loop doesn't use any sleep to have the time the
+    # desktop is visible after the termination as short as possible.
+    start = datetime.datetime.now()
+    killed = False
+    while (datetime.datetime.now() - start).total_seconds() < 1.0:
+        try:
+            os.kill(ppid, 0)
+        except OSError:
+            killed = True
+            break
+    if not killed:
+        logging.error(
+            "cinnamon-screensaver process with pid %d did not terminate "
+            "within 1 second.", ppid)
+        return 4
+    logging.info("Old cinnamon-screensaver process terminated.")
+
+    # Launch new cinnamon-screensaver process.
+    logging.info("Launching new cinnamon-screensaver process ...")
+    proc = subprocess.Popen(
+        ["/usr/bin/cinnamon-screensaver"],
+        stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
+        stderr=open(os.path.expanduser("~/.xsession-errors"), "a"))
+    logging.info(
+        "Launched new cinnamon-screensaver process. PID: %d", proc.pid)
+
+    # Trying to query screensaver state via D-Bus. This will fail the first
+    # few times as cinnamon-screensaver needs a bit to be available via D-Bus.
+    # The timeout is 10 seconds.
+    start = datetime.datetime.now()
+    available = False
+    while ((datetime.datetime.now() - start).total_seconds() < 10.0
+           and proc.poll() is None):
+        try:
+            # cinnamon-screensaver-command returns with exit code 0 under all
+            # tested circumstances.
+            output = subprocess.check_output(
+                ["/usr/bin/cinnamon-screensaver-command", "--query"],
+                stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT)
+
+            if ("The screensaver is active" in str(output) or
+                    "The screensaver is inactive" in str(output)):
+                available = True
+                break
+        except subprocess.CalledProcessError as ex:
+            logging.error(
+                "'cinnamon-screensaver-command --query' failed with exit code "
+                "%d. Output:\n%s", ex.returncode, ex.output)
+    if proc.returncode:
+        logging.error(
+            "New cinnamon-screensaver process with pid %d exited unexpectedly "
+            "with exit code %d. Check ~/.xsession-errors for details.",
+            proc.pid, proc.returncode)
+        return 5
+    if not available:
+        logging.error(
+            "New cinnamon-screensaver process with pid %d did not become "
+            "available via D-Bus within 10 second.", proc.pid)
+        return 6
+    logging.info("New cinnamon-screensaver process available via D-Bus.")
+
+    # Locking the new cinnamon-screensaver so that the user can login.
+    logging.info("Locking new cinnamon-screensaver ...")
+    try:
+        subprocess.check_call(
+            ["/usr/bin/cinnamon-screensaver-command", "--lock"],
+            stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT)
+    except subprocess.CalledProcessError as ex:
+        logging.error(
+            "'cinnamon-screensaver-command --lock' failed with exit code %d."
+            "Output:\n", ex.returncode, ex.output)
+
+    logging.info("Transition to new cinnamon-screensaver complete.")
+    return 0
+
+
+if __name__ == "__main__":
+    sys.exit(Main())
diff -Nru cinnamon-screensaver-3.2.13/debian/control cinnamon-screensaver-3.2.13/debian/control
--- cinnamon-screensaver-3.2.13/debian/control	2017-01-03 20:56:14.000000000 +0100
+++ cinnamon-screensaver-3.2.13/debian/control	2017-03-12 12:24:52.000000000 +0100
@@ -24,7 +24,7 @@
  libxext-dev,
  python,
  python-rsvg,
- python3:any,
+ python3:any | python3-all:any | python3-dev:any | python3-all-dev:any,
 Standards-Version: 3.9.8
 Homepage: http://cinnamon.linuxmint.com/
 Vcs-Browser: https://anonscm.debian.org/git/pkg-cinnamon/cinnamon-screensaver.git
diff -Nru cinnamon-screensaver-3.2.13/debian/copyright cinnamon-screensaver-3.2.13/debian/copyright
--- cinnamon-screensaver-3.2.13/debian/copyright	2017-01-03 20:56:14.000000000 +0100
+++ cinnamon-screensaver-3.2.13/debian/copyright	2017-03-12 12:24:52.000000000 +0100
@@ -16,6 +16,10 @@
 Copyright: 2014-2016, Maximiliano Curia <maxy@debian.org>
 License: LGPL-2+
 
+Files: debian/cinnamon-screensaver-dialog
+Copyright: 2017, Google, Inc
+License: LGPL-2+
+
 Files: libcscreensaver/setuid.c
        libcscreensaver/setuid.h
        libcscreensaver/subprocs.c
diff -Nru cinnamon-screensaver-3.2.13/debian/rules cinnamon-screensaver-3.2.13/debian/rules
--- cinnamon-screensaver-3.2.13/debian/rules	2017-01-03 20:56:14.000000000 +0100
+++ cinnamon-screensaver-3.2.13/debian/rules	2017-03-12 12:24:52.000000000 +0100
@@ -15,5 +15,6 @@
 	    --libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/cinnamon-screensaver
 
 override_dh_install:
+	dh_install ../cinnamon-screensaver-dialog usr/lib/$(DEB_HOST_MULTIARCH)/cinnamon-screensaver
 	dh_install --list-missing
 	rm -rf debian/cinnamon-screensaver/usr/share/doc/cinnamon-screensaver-*
#!/usr/bin/env python3
# License: LGPL-2+
# Copyright: 2017, Google, Inc
"""Transitional script to restart older cinnamon-screensavers.

Older cinnamon-screensavers (<= 3.0) use the cinnamon-screensaver-dialog binary
that is no longer present with newer cinnamon-screensavers (>= 3.2). As the
binary is missing the unlock prompt can't be shown and hence the older and
still running cinnamon-screensaver can't be unlocked anymore after a package
update to a newer cinnamon-screensaver.

This script is placed instead of cinnamon-screensaver-dialog and if it is
executed it checks that it got executed from cinnamon-screensaver. If that is
true the currently running older cinnamon-screensaver will be restarted so that
the newer cinnamon-screensaver runs. Immediately afterwards the screensaver is
locked via 'cinnamon-screensaver-command --lock'.
"""

import datetime
import logging
import os
import signal
import subprocess
import sys

def Main():
    """Main function. Returns exit code."""
    xerrors = os.path.expanduser("~/.xsession-errors")
    logformat = ("cinnamon-screensaver-dialog[%(process)d]: %(asctime)s "
                "%(levelname)-8s %(message)s")
    logging.basicConfig(level=logging.DEBUG, filename=xerrors, format=logformat)
    logging.info("Start of cinnamon-screensaver-dialog transition script.")

    # Check if the parent process is cinnamon-screensaver.
    ppid = os.getppid()
    with open("/proc/{0}/cmdline".format(ppid)) as f:
        pcmd = f.read()
    if not "cinnamon-screensaver" in pcmd:
        logging.error(
            "Parent process isn't cinnamon-screensaver. Parent PID: %d. "
            "Parent process command line: %s", ppid, pcmd)
        return 1

    # Terminate the cinnamon-screensaver process (old version) and wait for it
    # to be gone. We terminate it instead of gracefully shutting it down via
    # 'cinnamon-screensaver-command --exit' as that would also terminate this
    # script. In any case the cinnamon-session will log a warning that the
    # screensaver has left the bus.
    logging.info(
        "Killing old cinnamon-screensaver process with PID %d ...", ppid)
    os.kill(ppid, signal.SIGTERM)

    # Wait for the cinnamon-screensaver process to be gone. The timeout is
    # 1 second. The while loop doesn't use any sleep to have the time the
    # desktop is visible after the termination as short as possible.
    start = datetime.datetime.now()
    killed = False
    while (datetime.datetime.now() - start).total_seconds() < 1.0:
        try:
            os.kill(ppid, 0)
        except OSError:
            killed = True
            break
    if not killed:
        logging.error(
            "cinnamon-screensaver process with pid %d did not terminate "
            "within 1 second.", ppid)
        return 4
    logging.info("Old cinnamon-screensaver process terminated.")

    # Launch new cinnamon-screensaver process.
    logging.info("Launching new cinnamon-screensaver process ...")
    proc = subprocess.Popen(
        ["/usr/bin/cinnamon-screensaver"],
        stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
        stderr=open(os.path.expanduser("~/.xsession-errors"), "a"))
    logging.info(
        "Launched new cinnamon-screensaver process. PID: %d", proc.pid)

    # Trying to query screensaver state via D-Bus. This will fail the first
    # few times as cinnamon-screensaver needs a bit to be available via D-Bus.
    # The timeout is 10 seconds.
    start = datetime.datetime.now()
    available = False
    while ((datetime.datetime.now() - start).total_seconds() < 10.0
           and proc.poll() is None):
        try:
            # cinnamon-screensaver-command returns with exit code 0 under all
            # tested circumstances.
            output = subprocess.check_output(
                ["/usr/bin/cinnamon-screensaver-command", "--query"],
                stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT)

            if ("The screensaver is active" in str(output) or
                    "The screensaver is inactive" in str(output)):
                available = True
                break
        except subprocess.CalledProcessError as ex:
            logging.error(
                "'cinnamon-screensaver-command --query' failed with exit code "
                "%d. Output:\n%s", ex.returncode, ex.output)
    if proc.returncode:
        logging.error(
            "New cinnamon-screensaver process with pid %d exited unexpectedly "
            "with exit code %d. Check ~/.xsession-errors for details.",
            proc.pid, proc.returncode)
        return 5
    if not available:
        logging.error(
            "New cinnamon-screensaver process with pid %d did not become "
            "available via D-Bus within 10 second.", proc.pid)
        return 6
    logging.info("New cinnamon-screensaver process available via D-Bus.")

    # Locking the new cinnamon-screensaver so that the user can login.
    logging.info("Locking new cinnamon-screensaver ...")
    try:
        subprocess.check_call(
            ["/usr/bin/cinnamon-screensaver-command", "--lock"],
            stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as ex:
        logging.error(
            "'cinnamon-screensaver-command --lock' failed with exit code %d."
            "Output:\n", ex.returncode, ex.output)

    logging.info("Transition to new cinnamon-screensaver complete.")
    return 0


if __name__ == "__main__":
    sys.exit(Main())

--- End Message ---
--- Begin Message ---
Unblocked.

--- End Message ---

Reply to: