Right now, we rely on the existence of /dev/fd/* to make backups (and therefore clone and migrate). This will fail on platforms that do not support that device. We have seen that phenomenon on vservers that do not have udev installed, for example.

A more graceful way of handling this would be to check if /dev/fd/3 exists and rollback to insecure behaviour in case it's missing, instead of just completely failing to upgrade or backup.

This, in turn, would make it possible to port the patch upstream to drush (see #671906: mysql credentials leak in drush sqlc).

Comments

moshe weitzman’s picture

drush would love to have such a patch. please.

ergonlogic’s picture

Status: Active » Needs work

This patch is incomplete, but at least it doesn't break anything when udev is installed. It moves the query building from generate_dump() and import_dump() it's own function: build_mysql_command(), passing along options and credentials. It checks for udev, and if found, it builds the same mysql commands as we had previously.

That's about it, at this point. It doesn't yet do anything useful if udev isn't installed, but at least we have somewhere to check for it's existence. I suspect that safe_shell_exec() needs to be refactored at this point to fallback to a temporary file (as suggested here), if /dev/fd/3 isn't available.

rcross’s picture

subscribe.

troyer’s picture

Version: » 7.x-2.x-dev

I don't see any patch incomplete or otherwise.

steven jones’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Needs work » Active
anarcat’s picture

There is now a fix for this in in #671906: mysql credentials leak in drush sqlc.

ergonlogic’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Issue summary: View changes

New features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x.

anarcat’s picture

note that the creds leak issue was fixed in drush, i recommend looking into this: https://github.com/drush-ops/drush/issues/365