diff -u system-config-printer-1.3.6+20110831/debian/control system-config-printer-1.3.6+20110831/debian/control --- system-config-printer-1.3.6+20110831/debian/control +++ system-config-printer-1.3.6+20110831/debian/control @@ -9,7 +9,7 @@ Package: system-config-printer-common Architecture: all -Depends: ${shlibs:Depends}, ${python:Depends}, python-cups (>= 1.9.55), python-smbc, python-dbus, python-cupshelpers +Depends: ${shlibs:Depends}, ${python:Depends}, python-cups (>= 1.9.59), python-smbc, python-dbus, python-cupshelpers Recommends: system-config-printer-udev, avahi-utils Conflicts: system-config-printer, system-config-printer-kde (< 0.09ubuntu1) Replaces: system-config-printer diff -u system-config-printer-1.3.6+20110831/debian/changelog system-config-printer-1.3.6+20110831/debian/changelog --- system-config-printer-1.3.6+20110831/debian/changelog +++ system-config-printer-1.3.6+20110831/debian/changelog @@ -1,3 +1,31 @@ +system-config-printer (1.3.6+20110831-0ubuntu9.1) oneiric-proposed; urgency=low + + * debian/control: Depend on python-cups 1.5.59 (LP: #653132). + * debian/patches/67_no-misleading-prompt-and-root-default-in-auth-dialogs.patch: + Do not show the misleading prompt 'Password for "root" on localhost', as + under Ubuntu you do not log in as root. Also do not pre-fill "root" as + default user name (LP: #653132). + * debian/patches/65_do-not-connect-to-cups-with-empty-username.patch: Do not + connect to CUPS with an empty user name (LP: #653132). + * debian/patches/63_repeat-authorization-when-try-as-root-fails-asyncipp.patch: + On asynchronous IPP connections make sure that the password dialog is + repeated if a wrong password is entered (LP: #653132). + * debian/patches/60_fix-password-cache.patch: Fixes in caching the entered + password, to assure that only one password prompt happens during the whole + system-config-printer session (LP: #653132). + * debian/patches/57_fix-broken-setting-of-ipp-auth-canceled-constant.patch: + Upstream uses a constant of python-cups 1.5.60 and has a fallback to an + explicit definition when an older python-cups is used. This fallback + mechanism is broken and this patch works around it. + * debian/patches/55_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-asyncipp.patch: + Fix to distinguish canceling of authentication from entering an empty + password (asynchronous IPP connections, #653132). + * debian/patches/53_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-authconn.patch: + Fix from upstream to distinguish canceling of authentication from entering + an empty password (synchronous IPP connections, #653132). + + -- Till Kamppeter Sun, 9 Oct 2011 01:32:24 +0200 + system-config-printer (1.3.6+20110831-0ubuntu9) oneiric; urgency=low * debian/patches/50_preferreddrivers-xml-fix-drivertype-recognition.patch: only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/57_fix-broken-setting-of-ipp-auth-canceled-constant.patch +++ system-config-printer-1.3.6+20110831/debian/patches/57_fix-broken-setting-of-ipp-auth-canceled-constant.patch @@ -0,0 +1,33 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-10-08 23:44:07.633207034 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-08 23:45:28.665483842 +0200 +@@ -379,11 +379,7 @@ + forbidden = False + if type (exc) == cups.IPPError: + (e, m) = exc.args +- try: +- ipp_auth_canceled = cups.IPP_AUTHENTICATION_CANCELED +- except AttributeError: +- # requires pycups 1.9.60 +- ipp_auth_canceled = 4096 ++ ipp_auth_canceled = 4096 + if (e == cups.IPP_NOT_AUTHORIZED or + e == cups.IPP_FORBIDDEN or + e == ipp_auth_canceled): +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//authconn.py system-config-printer-1.3.6+20110831.new//authconn.py +--- system-config-printer-1.3.6+20110831//authconn.py 2011-10-08 23:44:07.625207013 +0200 ++++ system-config-printer-1.3.6+20110831.new//authconn.py 2011-10-08 23:44:49.121348784 +0200 +@@ -242,12 +242,7 @@ + except cups.IPPError, (e, m): + if self._use_pk and m == 'pkcancel': + raise cups.IPPError (0, _("Operation canceled")) +- try: +- ipp_auth_canceled = cups.IPP_AUTHENTICATION_CANCELED +- except AttributeError: +- # requires pycups 1.9.60 +- ipp_auth_canceled = 4096 +- ++ ipp_auth_canceled = 4096 + if not self._cancel and (e == cups.IPP_NOT_AUTHORIZED or + e == cups.IPP_FORBIDDEN or + e == ipp_auth_canceled): only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/53_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-authconn.patch +++ system-config-printer-1.3.6+20110831/debian/patches/53_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-authconn.patch @@ -0,0 +1,36 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//authconn.py system-config-printer-1.3.6+20110831.new//authconn.py +--- system-config-printer-1.3.6+20110831//authconn.py 2011-10-08 23:38:08.683977736 +0200 ++++ system-config-printer-1.3.6+20110831.new//authconn.py 2011-10-08 23:38:18.104010024 +0200 +@@ -1,6 +1,6 @@ + #!/usr/bin/python + +-## Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. ++## Copyright (C) 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + ## Author: Tim Waugh + + ## This program is free software; you can redistribute it and/or modify +@@ -242,8 +242,15 @@ + except cups.IPPError, (e, m): + if self._use_pk and m == 'pkcancel': + raise cups.IPPError (0, _("Operation canceled")) ++ try: ++ ipp_auth_canceled = cups.IPP_AUTHENTICATION_CANCELED ++ except AttributeError: ++ # requires pycups 1.9.60 ++ ipp_auth_canceled = 4096 ++ + if not self._cancel and (e == cups.IPP_NOT_AUTHORIZED or +- e == cups.IPP_FORBIDDEN): ++ e == cups.IPP_FORBIDDEN or ++ e == ipp_auth_canceled): + self._failed (e == cups.IPP_FORBIDDEN) + elif not self._cancel and e == cups.IPP_SERVICE_UNAVAILABLE: + if self._lock: +@@ -265,6 +272,7 @@ + if self._cancel and not self._cannot_auth: + raise cups.IPPError (0, _("Operation canceled")) + ++ debugprint ("%s: %s" % (e, m)) + raise + except cups.HTTPError, (s,): + if not self._cancel: only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/55_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-asyncipp.patch +++ system-config-printer-1.3.6+20110831/debian/patches/55_handle-new-cups-1.5-ipp-error-response-ipp-authentication-canceled-asyncipp.patch @@ -0,0 +1,19 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-08-31 14:35:02.000000000 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-08 23:41:51.660741987 +0200 +@@ -379,8 +379,14 @@ + forbidden = False + if type (exc) == cups.IPPError: + (e, m) = exc.args ++ try: ++ ipp_auth_canceled = cups.IPP_AUTHENTICATION_CANCELED ++ except AttributeError: ++ # requires pycups 1.9.60 ++ ipp_auth_canceled = 4096 + if (e == cups.IPP_NOT_AUTHORIZED or +- e == cups.IPP_FORBIDDEN): ++ e == cups.IPP_FORBIDDEN or ++ e == ipp_auth_canceled): + forbidden = (e == cups.IPP_FORBIDDEN) + elif e == cups.IPP_SERVICE_UNAVAILABLE: + return self._reconnect_error (conn, exc) only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/65_do-not-connect-to-cups-with-empty-username.patch +++ system-config-printer-1.3.6+20110831/debian/patches/65_do-not-connect-to-cups-with-empty-username.patch @@ -0,0 +1,27 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-10-09 01:12:25.741456877 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-09 01:12:56.425553946 +0200 +@@ -500,6 +500,8 @@ + + def _on_auth_dialog_response (self, dialog, response): + (user, password) = dialog.get_auth_info () ++ if user == '': ++ user = self._user; + authconn.global_authinfocache.cache_auth_info ((user, + password), + host=self._conn.thread.host, +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//authconn.py system-config-printer-1.3.6+20110831.new//authconn.py +--- system-config-printer-1.3.6+20110831//authconn.py 2011-10-09 01:12:25.733456852 +0200 ++++ system-config-printer-1.3.6+20110831.new//authconn.py 2011-10-09 01:12:45.677519954 +0200 +@@ -484,8 +484,9 @@ + self._on_authentication_response (d, response) + + def _on_authentication_response (self, dialog, response): +- (self._use_user, +- self._use_password) = dialog.get_auth_info () ++ (user, self._use_password) = dialog.get_auth_info () ++ if user != '': ++ self._use_user = user + global_authinfocache.cache_auth_info ((self._use_user, + self._use_password), + host=self._server, only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/63_repeat-authorization-when-try-as-root-fails-asyncipp.patch +++ system-config-printer-1.3.6+20110831/debian/patches/63_repeat-authorization-when-try-as-root-fails-asyncipp.patch @@ -0,0 +1,11 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-10-09 01:11:16.845238898 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-09 01:11:31.277284544 +0200 +@@ -402,7 +402,6 @@ + # first. + debugprint ("Authentication: Try as root") + self._user = "root" +- self._try_as_root = False + conn.reconnect (self._user, + reply_handler=self._reconnect_reply, + error_handler=self._reconnect_error) only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/67_no-misleading-prompt-and-root-default-in-auth-dialogs.patch +++ system-config-printer-1.3.6+20110831/debian/patches/67_no-misleading-prompt-and-root-default-in-auth-dialogs.patch @@ -0,0 +1,34 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-10-09 01:14:20.945821368 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-09 01:14:42.245888768 +0200 +@@ -478,11 +478,11 @@ + d = authconn.AuthDialog (title=title, + parent=conn.parent) + +- d.set_prompt (prompt) ++ d.set_prompt ('') + if self._user == None: + self._user = cups.getUser() +- d.set_auth_info ([self._user, '']) +- d.field_grab_focus ('password') ++ d.set_auth_info (['', '']) ++ d.field_grab_focus ('username') + d.set_keep_above (True) + d.show_all () + d.connect ("response", self._on_auth_dialog_response) +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//authconn.py system-config-printer-1.3.6+20110831.new//authconn.py +--- system-config-printer-1.3.6+20110831//authconn.py 2011-10-09 01:14:20.945821368 +0200 ++++ system-config-printer-1.3.6+20110831.new//authconn.py 2011-10-09 01:14:35.977868925 +0200 +@@ -469,9 +469,9 @@ + else: + d = AuthDialog (parent=self._parent) + +- d.set_prompt (self._prompt) +- d.set_auth_info ([self._use_user, '']) +- d.field_grab_focus ('password') ++ d.set_prompt ('') ++ d.set_auth_info (['', '']) ++ d.field_grab_focus ('username') + d.set_keep_above (True) + d.show_all () + d.show_now () only in patch2: unchanged: --- system-config-printer-1.3.6+20110831.orig/debian/patches/60_fix-password-cache.patch +++ system-config-printer-1.3.6+20110831/debian/patches/60_fix-password-cache.patch @@ -0,0 +1,123 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//asyncipp.py system-config-printer-1.3.6+20110831.new//asyncipp.py +--- system-config-printer-1.3.6+20110831//asyncipp.py 2011-10-09 01:07:21.764495177 +0200 ++++ system-config-printer-1.3.6+20110831.new//asyncipp.py 2011-10-09 01:07:36.800542741 +0200 +@@ -334,17 +334,6 @@ + self._client_reply_handler = reply_handler + self._client_error_handler = error_handler + +- if user: +- host = conn.thread.host +- port = conn.thread.port +- creds = authconn.global_authinfocache.lookup_auth_info (host=host, +- port=port) +- if creds: +- if creds[0] == user: +- self._use_password = creds[1] +- self._reconnected = True +- del creds +- + debugprint ("+%s" % self) + + def __del__ (self): +@@ -425,11 +414,36 @@ + return self._error (exc) + + # Now reconnect and retry. ++ host = conn.thread.host ++ port = conn.thread.port ++ authconn.global_authinfocache.remove_auth_info (host=host, ++ port=port) ++ self._use_password = '' + conn.reconnect (self._user, + reply_handler=self._reconnect_reply, + error_handler=self._reconnect_error) + + def auth_handler (self, prompt, conn, method=None, resource=None): ++ if self._auth_called == False: ++ if self._user == None: ++ self._user = cups.getUser() ++ if self._user: ++ host = conn.thread.host ++ port = conn.thread.port ++ creds = authconn.global_authinfocache.lookup_auth_info (host=host, ++ port=port) ++ if creds: ++ if creds[0] == self._user: ++ self._use_password = creds[1] ++ self._reconnected = True ++ del creds ++ else: ++ host = conn.thread.host ++ port = conn.thread.port ++ authconn.global_authinfocache.remove_auth_info (host=host, ++ port=port) ++ self._use_password = '' ++ + self._auth_called = True + if self._reconnected: + debugprint ("Supplying password after reconnection") +@@ -487,6 +501,10 @@ + + def _on_auth_dialog_response (self, dialog, response): + (user, password) = dialog.get_auth_info () ++ authconn.global_authinfocache.cache_auth_info ((user, ++ password), ++ host=self._conn.thread.host, ++ port=self._conn.thread.port) + self._dialog = dialog + dialog.hide () + +@@ -494,6 +512,8 @@ + response == gtk.RESPONSE_DELETE_EVENT): + self._cancel = True + self._conn.set_auth_info ('') ++ authconn.global_authinfocache.remove_auth_info (host=self._conn.thread.host, ++ port=self._conn.thread.port) + debugprint ("Auth canceled") + return + +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.3.6+20110831//authconn.py system-config-printer-1.3.6+20110831.new//authconn.py +--- system-config-printer-1.3.6+20110831//authconn.py 2011-10-09 01:07:21.764495177 +0200 ++++ system-config-printer-1.3.6+20110831.new//authconn.py 2011-10-09 01:07:22.480497435 +0200 +@@ -132,6 +132,15 @@ + except KeyError: + return None + ++ def remove_auth_info (self, host=None, port=None): ++ if port == None: ++ port = 631 ++ ++ try: ++ del self.creds[(host,port)] ++ except KeyError: ++ return None ++ + global_authinfocache = _AuthInfoCache () + + class Connection: +@@ -156,12 +165,6 @@ + self._lock = lock + self._gui_event = threading.Event () + +- creds = global_authinfocache.lookup_auth_info (host=host, port=port) +- if creds != None: +- if (creds[0] != 'root' or try_as_root): +- (self._use_user, self._use_password) = creds +- del creds +- + self._connect () + + def _begin_operation (self, operation): +@@ -326,6 +329,12 @@ + def _perform_authentication (self): + self._passes += 1 + ++ creds = global_authinfocache.lookup_auth_info (host=self._server, port=self._port) ++ if creds != None: ++ if (creds[0] != 'root' or self._try_as_root): ++ (self._use_user, self._use_password) = creds ++ del creds ++ + debugprint ("Authentication pass: %d" % self._passes) + if self._passes == 1: + # Haven't yet tried the operation. Set the password