make reset-admin-pwd work with sqlserver as db backend stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 28 Sep 2010 14:52:45 +0200
branchstable
changeset 6351 eb79fb69c2b2
parent 6350 74575fb32a4d
child 6352 2259d834d757
make reset-admin-pwd work with sqlserver as db backend the pyodbc sqlserver db backend depends on being passed the cw_upassword value as a buffer object to bind it to a binary column (which is usually done when CW is dealing with passwords).
server/serverctl.py
--- a/server/serverctl.py	Tue Sep 28 12:22:17 2010 +0200
+++ b/server/serverctl.py	Tue Sep 28 14:52:45 2010 +0200
@@ -501,7 +501,7 @@
                                        passwdmsg='new password for %s' % adminlogin)
         try:
             cursor.execute("UPDATE cw_CWUser SET cw_upassword=%(p)s WHERE cw_login=%(l)s",
-                           {'p': crypt_password(passwd), 'l': adminlogin})
+                           {'p': buffer(crypt_password(passwd)), 'l': adminlogin})
             sconfig = Configuration(options=USER_OPTIONS)
             sconfig['login'] = adminlogin
             sconfig['password'] = passwd