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

[PATCH] mirrorbrain.conf: Trailing spaces in passwords are taken #112

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

[PATCH] mirrorbrain.conf: Trailing spaces in passwords are taken #112

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/issue112

Title    [PATCH] mirrorbrain.conf: Trailing spaces in passwords are taken
             literally
 Priority  bug                  Status         resolved
Superseder                    Nosy List        jcpunk, poeml
 Assigned  poeml               Keywords
      To

                             Files
 File name             Uploaded               Type     Edit Remove

issue_112.patch jcpunk, 2013-04-19.19:04:31 text/x-patch

msg400 (view) Author: poeml Date: 2012-06-27.21:03:08

(Related to issue 27)

Trailing spaces in /etc/mirrorbrain.conf dbpass values are taken literally, which
can be very hard to debug and find. We allow spaces in passwords (as per issue
27), but we should probably disallow them trailing, to avoid confusion.

msg423 (view) Author: jcpunk Date: 2013-04-19.19:04:31

I've attached a patch that fixes this issue.

msg488 (view) Author: poeml Date: 2014-01-29.22:47:32

Hm, I think the .rstrip() should run before the .replace(' ', r'\ ')
Right?

Otherwise, one could end up with a password ending with a trailing backslash instead of
a trailing space.

So I think, better is:
@@ -122,6 +122,7 @@
except:
sys.exit("Your config doesn't have a 'dbname' setting.")

  •        config['dbpass'] = config['dbpass'].rstrip()
           config['dbpass'] = config['dbpass'].replace(' ', r'\ ')
           config['dbpass'] = config['dbpass'].replace('\t', '\\t')
           config['dbpass'] = config['dbpass'].replace("'", r"\'")
    
msg489 (view) Author: poeml Date: 2014-01-29.22:51:10

Committed to SVN trunk, r8345. Thanks, Pat!

History
         Date          User  Action                     Args
2014-01-29 22:51:10 poeml  set    status: chatting -> resolved
                                    messages: + msg489
2014-01-29 22:47:32 poeml  set    messages: + msg488
                                    title: mirrorbrain.conf: Trailing spaces in
2014-01-22 20:06:51 poeml  set    passwords are taken literally -> [PATCH]
                                    mirrorbrain.conf: Trailing spaces in
                                    passwords are taken literally
                                    files: + issue_112.patch
2013-04-19 19:04:31 jcpunk set    nosy: + jcpunk
                                    messages: + msg423
2012-06-27 21:03:08 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