Merge lp:~raoul-snyman/openlp/bug-886989 into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Approved by: Tim Bentley
Approved revision: 1798
Merged at revision: 1798
Proposed branch: lp:~raoul-snyman/openlp/bug-886989
Merge into: lp:openlp
Diff against target: 26 lines (+5/-4)
1 file modified
openlp/core/lib/db.py (+5/-4)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bug-886989
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+81607@code.launchpad.net

Commit message

Fixed bug #886989: automatically encode password (and other fields) when passing it to SQLAlchemy.

Description of the change

Fixed bug #886989: automatically encode password (and other fields) when passing it to SQLAlchemy.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/db.py'
2--- openlp/core/lib/db.py 2011-09-11 20:39:33 +0000
3+++ openlp/core/lib/db.py 2011-11-08 16:59:59 +0000
4@@ -29,6 +29,7 @@
5 """
6 import logging
7 import os
8+from urllib import quote_plus as urlquote
9
10 from PyQt4 import QtCore
11 from sqlalchemy import Table, MetaData, Column, types, create_engine
12@@ -193,10 +194,10 @@
13 AppLocation.get_section_data_path(plugin_name), plugin_name)
14 else:
15 self.db_url = u'%s://%s:%s@%s/%s' % (db_type,
16- unicode(settings.value(u'db username').toString()),
17- unicode(settings.value(u'db password').toString()),
18- unicode(settings.value(u'db hostname').toString()),
19- unicode(settings.value(u'db database').toString()))
20+ urlquote(unicode(settings.value(u'db username').toString())),
21+ urlquote(unicode(settings.value(u'db password').toString())),
22+ urlquote(unicode(settings.value(u'db hostname').toString())),
23+ urlquote(unicode(settings.value(u'db database').toString())))
24 settings.endGroup()
25 if upgrade_mod:
26 db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod)