# HG changeset patch # User Alexandre Fayolle # Date 1285942023 -7200 # Node ID 3f67f7ea56324746274a85424bd3a6afd02825c1 # Parent 5a86a0c147bdc4018319b1acd94aeab5e0f4d56a [R] use dbhelper.binary_value to process passwords and other Bytes fields (instead of dbapi_module.Binary or hardcoding buffer()). This requires (esp. in serverctl) version 1.3.1 of logilab.database. Dependencies updated. diff -r 5a86a0c147bd -r 3f67f7ea5632 __pkginfo__.py --- a/__pkginfo__.py Fri Oct 01 15:45:38 2010 +0200 +++ b/__pkginfo__.py Fri Oct 01 16:07:03 2010 +0200 @@ -52,7 +52,7 @@ 'Twisted': '', # XXX graphviz # server dependencies - 'logilab-database': '>= 1.3.0', + 'logilab-database': '>= 1.3.1', 'pysqlite': '>= 2.5.5', # XXX install pysqlite2 } diff -r 5a86a0c147bd -r 3f67f7ea5632 debian/control --- a/debian/control Fri Oct 01 15:45:38 2010 +0200 +++ b/debian/control Fri Oct 01 16:07:03 2010 +0200 @@ -33,7 +33,7 @@ Conflicts: cubicweb-multisources Replaces: cubicweb-multisources Provides: cubicweb-multisources -Depends: ${python:Depends}, cubicweb-common (= ${source:Version}), cubicweb-ctl (= ${source:Version}), python-logilab-database (>= 1.3.0), cubicweb-postgresql-support | cubicweb-mysql-support | python-pysqlite2 +Depends: ${python:Depends}, cubicweb-common (= ${source:Version}), cubicweb-ctl (= ${source:Version}), python-logilab-database (>= 1.3.1), cubicweb-postgresql-support | cubicweb-mysql-support | python-pysqlite2 Recommends: pyro, cubicweb-documentation (= ${source:Version}) Description: server part of the CubicWeb framework CubicWeb is a semantic web application framework. diff -r 5a86a0c147bd -r 3f67f7ea5632 server/serverctl.py --- a/server/serverctl.py Fri Oct 01 15:45:38 2010 +0200 +++ b/server/serverctl.py Fri Oct 01 16:07:03 2010 +0200 @@ -486,6 +486,9 @@ print '-> Error: could not get cubicweb administrator login.' sys.exit(1) cnx = source_cnx(sourcescfg['system']) + driver = sourcescfg['system']['db-driver'] + from logilab.database import get_db_helper + dbhelper = get_db_helper(driver) cursor = cnx.cursor() # check admin exists cursor.execute("SELECT * FROM cw_CWUser WHERE cw_login=%(l)s", @@ -501,7 +504,7 @@ passwdmsg='new password for %s' % adminlogin) try: cursor.execute("UPDATE cw_CWUser SET cw_upassword=%(p)s WHERE cw_login=%(l)s", - {'p': buffer(crypt_password(passwd)), 'l': adminlogin}) + {'p': dbhelper.binary_value(crypt_password(passwd)), 'l': adminlogin}) sconfig = Configuration(options=USER_OPTIONS) sconfig['login'] = adminlogin sconfig['password'] = passwd diff -r 5a86a0c147bd -r 3f67f7ea5632 server/sqlutils.py --- a/server/sqlutils.py Fri Oct 01 15:45:38 2010 +0200 +++ b/server/sqlutils.py Fri Oct 01 16:07:03 2010 +0200 @@ -165,7 +165,7 @@ self.OperationalError = dbapi_module.OperationalError self.InterfaceError = dbapi_module.InterfaceError self.DbapiError = dbapi_module.Error - self._binary = dbapi_module.Binary + self._binary = self.dbhelper.binary_value self._process_value = dbapi_module.process_value self._dbencoding = dbencoding