Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passwords in /etc/mirrorbrain.conf can't contain whitespace #22

Closed
poeml opened this issue Jun 5, 2015 · 0 comments
Closed

passwords in /etc/mirrorbrain.conf can't contain whitespace #22

poeml opened this issue Jun 5, 2015 · 0 comments

Comments

@poeml
Copy link
Owner

poeml commented Jun 5, 2015

                                                                                                           [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue27

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

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.

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

History
         Date         User  Action             Args
2009-12-01 18:11:42 poeml set    status: deferred -> resolved
                                   messages: + msg72
2009-12-01 16:08:24 poeml create

(end of migrated issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant