From 06537cced83cd4022999c2eb96561401abfeec511892cfad8527c2f6a7c1bebb Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 26 Aug 2009 13:53:15 +0000 Subject: [PATCH] Accepting request 18727 from devel:languages:python Copy from devel:languages:python/python-bugzilla based on submit request 18727 from user mvyskocil OBS-URL: https://build.opensuse.org/request/show/18727 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-bugzilla?expand=0&rev=2 --- 0003-obfuscated-password-support.patch | 50 ++++++++++++++++++++++++++ python-bugzilla.changes | 5 +++ python-bugzilla.spec | 4 ++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0003-obfuscated-password-support.patch diff --git a/0003-obfuscated-password-support.patch b/0003-obfuscated-password-support.patch new file mode 100644 index 0000000..8d67efb --- /dev/null +++ b/0003-obfuscated-password-support.patch @@ -0,0 +1,50 @@ +From e286a5be2446a00f91bb498f0feeffae4ec3aa05 Mon Sep 17 00:00:00 2001 +From: Michal Vyskocil +Date: Wed, 26 Aug 2009 11:08:36 +0200 +Subject: [PATCH] obfuscated password support in oscrc + +The osc client introduced an obfuscated passwords (not secure, but many +times requested by a community), so this patch to readconfig method adds +an ability to read passx options. +It also fixes a small (but mandatory bug) in a condition which decides +about read or not. +--- + bugzilla/nvlbugzilla.py | 11 +++++++++-- + 1 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/bugzilla/nvlbugzilla.py b/bugzilla/nvlbugzilla.py +index 35202a4..0d88db1 100644 +--- a/bugzilla/nvlbugzilla.py ++++ b/bugzilla/nvlbugzilla.py +@@ -138,11 +138,18 @@ If you want cache the cookies and speedup the repeated connections, remove it or + for cookie in self._iter_domain_cookies(): + cookie.expires = 0 + ++ @classmethod ++ def _read_osc_password(cls, c): ++ # supports obfuscated passwords introduced in osc-0.121 ++ if c.has_option(cls.obs_url, 'passx'): ++ return c.get(cls.obs_url, 'passx').decode('base64').decode('bz2') ++ return c.get(cls.obs_url, 'pass') ++ + def readconfig(self, configpath=None): + super(NovellBugzilla, self).readconfig(configpath) + + oscrc=os.path.expanduser('~/.oscrc') +- if not self.user and not self.password \ ++ if not self.user or not self.password \ + and os.path.exists(oscrc): + from ConfigParser import SafeConfigParser, NoOptionError + c = SafeConfigParser() +@@ -156,7 +163,7 @@ If you want cache the cookies and speedup the repeated connections, remove it or + + try: + self.user = c.get(obs_url, 'user') +- self.password = c.get(obs_url, 'pass') ++ self.password = self._read_osc_password(c) + bugzilla.base.log.info("Read credentials from ~/.oscrc") + except NoOptionError, ne: + return +-- +1.6.3.3 + diff --git a/python-bugzilla.changes b/python-bugzilla.changes index 3dddb93..566eed5 100644 --- a/python-bugzilla.changes +++ b/python-bugzilla.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 26 09:18:54 UTC 2009 - mvyskocil@suse.cz + +- Added a patch with support of obfuscated passwords introduced in osc-0.121 + ------------------------------------------------------------------- Wed Jul 22 08:52:01 CEST 2009 - mvyskocil@suse.cz diff --git a/python-bugzilla.spec b/python-bugzilla.spec index 41562e1..8c5b374 100644 --- a/python-bugzilla.spec +++ b/python-bugzilla.spec @@ -20,7 +20,7 @@ Name: python-bugzilla Version: 0.5 -Release: 1 +Release: 2 Summary: Python library for bugzilla Group: Development/Libraries/Python License: GPL v2 or later @@ -30,6 +30,7 @@ Url: https://fedorahosted.org/python-bugzilla/ Source: https://fedorahosted.org/releases/p/y/python-bugzilla/%{name}-%{version}.tar.bz2 Patch0: 0001-Use-LWPCookieJar-by-default.patch Patch1: 0002-NovellBugzilla-implementation.patch +Patch2: 0003-obfuscated-password-support.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel %{py_requires} @@ -54,6 +55,7 @@ Will Woods , Oct 16 2008 %setup -q %patch0 -p1 -b .use-lwpcookiejar-by-default %patch1 -p1 -b .novellbugzilla-implementation +%patch2 -p1 -b .obfuscated-password %build export CFLAGS="%{optflags}"