Download & Extend

import doesn't escape characters in db_url

Project:Provision
Version:6.x-0.2
Component:Code
Category:bug report
Priority:critical
Assigned:anarcat
Status:closed (fixed)
Issue tags:aegir-0.2-hotfix

Issue Summary

So I have just seen a backup fail because of escaped characters in the db_url:

Generating mysql dump for default. [0.063 sec]                          [backup]
mysqldump -hexample.koumbit.net -uaegir                                   [notice]
-p%40...  -rsites/default/database.sql aegir
[0.063 sec]
Executing: mysqldump -hmysql.koumbit.net -uaegir -p%40... -rsites/default/database.sql aegir
  mysqldump: Got error: 1045: Access denied for user 'aegir'@'example.koumbit.net' (using password: YES) when trying to connect
Adding sites directory to /var/aegir/backups/default-2009-06-17_3.tar   [backup]
[0.074 sec]

(Some parameters were changed to protect our security.)

I'll try to track this down, but it's rather annoying since it's in 0.2 and we'll need to hotfix...

Comments

#1

Assigned to:Anonymous» anarcat
Status:active» needs work

Okay, so the problem seems to be related with the import mechanism, because the install functions have the urldecode() calls hooked in properly and they are nowhere to be found in import.

#2

Status:needs work» needs review

Here's a patch I'm going to test in prod. It fixes the dburl parts on import.

AttachmentSize
494358_import_decode_hotfix.patch 3.61 KB

#3

Status:needs review» fixed

The patch works and I can now backup the site after importing again. I committed the patch as is. However, I'm worried that the backup said it succeeded when it wasn't actually able to connect to the database backend, is that a feature we want?! I have opened #494376: backup succeeds even if database connexion fails to make sure I look into this.

#4

Title:backup doesn't interpret properly escape characters in db_url» import doesn't escape characters in db_url
Status:fixed» needs work

So the committed fix works great, except verify writes back the db_url without urlencoding it (ugh!). So this breaks the site altogether.

#5

Status:needs work» needs review

So this patch works better: I urlencode the various parts before injecting them back, directly in the template.

AttachmentSize
494358_import_decode_hotfix-2.patch 4.55 KB

#6

Status:needs review» fixed

I committed the fix already.

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here