function _provision_drush_check_user

7.x-3.x _provision_drush_check_user()

This will abort any process running drush provision commands if the user running the command is root.

Related topics

1 call to _provision_drush_check_user()
provision_drush_init in ./
Implements hook_drush_init().


./, line 67
Provision Drush commands.


function _provision_drush_check_user() {
  $command = drush_get_command();
  $name = posix_getpwuid(posix_geteuid());
  if (preg_match("/^provision-\b/", $command['command']) && $name['name'] == 'root') {
    return drush_set_error('PROVISION_IS_ROOT', dt('You are running the provision script as the root user. Exiting'));