Issue27

Title passwords in /etc/mirrorbrain.conf can't contain whitespace
Priority bug Status resolved
Superseder Nosy List poeml, theuni
Assigned To poeml Keywords

Created on 2009-12-01.16:08:24 by poeml, last changed by poeml.

Messages
msg72 (view) Author: poeml Date: 2009-12-01.18:11:42
In fact, the error is in the psycopg2 module, which is used by SQLObject. It gets a nice dictionary passed 
for making the connection, but still manages to mess up. Maybe it passes strings to PostgreSQL where things 
should be quoted...

(Pdb) print self.dsn_dict
{'user': 'mb', 'host': 'localhost', 'password': 'foo bar', 'port': 5432, 'database': 'mb_opensuse'}
(Pdb) self.module.connect(**self.dsn_dict)
*** OperationalError: missing "=" after "bar" in connection info string



Okay, got it. When my module quote certain characters, psycopg2 will do the job.

I have tested with passwords containing the following characters:

space, tab, unicode characters, '`;#$!=  

also '=' after a space, so it's similar to the connection string syntax)


They all work now... however double quotes (") don't. No matter how I quote them, they are not accepted.


Another note, it is probably not possible to use whitespace as first character, though, due to parsing 
limitations in the ini-style configuration format.

Fixed in trunk!
http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=7885
msg71 (view) Author: poeml Date: 2009-12-01.16:08:23
Passwords containing spaces in /etc/mirrorbrain.conf are known not to work.

(Putting this issue into the tracker, after it had been mentioned only in 
docs/bugs.rst so far.)

When I noticed the bug a while ago, I *seem* to remember that I traced the error 
to be inside SQLObject's adapter to the database. See 
http://www.sqlobject.org/sqlobject/postgres/pgconnection.py.html 
(connectionFromURI() method or something like that. But I'm not sure.
History
Date User Action Args
2009-12-01 18:11:42poemlsetstatus: deferred -> resolved
messages: + msg72
2009-12-01 16:08:24poemlcreate