function SSH::chmodJailed

Implements Drupal\Core\FileTransfer\ChmodInterface::chmodJailed().

Overrides ChmodInterface::chmodJailed

File

drupal/core/lib/Drupal/Core/FileTransfer/SSH.php, line 133
Definition of Drupal\Core\FileTransfer\SSH.

Class

SSH
The SSH connection class for the update module.

Namespace

Drupal\Core\FileTransfer

Code

function chmodJailed($path, $mode, $recursive) {
  $cmd = sprintf("chmod %s%o %s", $recursive ? '-R ' : '', $mode, escapeshellarg($path));
  if (@(!ssh2_exec($this->connection, $cmd))) {
    throw new FileTransferException('Cannot change permissions of @path.', NULL, array(
      '@path' => $path,
    ));
  }
}