summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorEvgeny Golyshev <eugulixes@gmail.com>2018-07-29 18:02:42 +0300
committerEvgeny Golyshev <eugulixes@gmail.com>2018-10-14 15:06:14 +0300
commitec2f02f4a06412218738cd94e6e91bae7f28ac48 (patch)
tree61ffb0a527c69532a65baa1f1dbda5ea728d49bd /core/Command
parent0fca815b4dd601381a909656a1e3e7a7e89714d2 (diff)
downloadnextcloud-server-ec2f02f4a06412218738cd94e6e91bae7f28ac48.tar.gz
nextcloud-server-ec2f02f4a06412218738cd94e6e91bae7f28ac48.zip
Check if TTY is invalid in encryption:encrypt-all and encryption:decrypt-all
Signed-off-by: Evgeny Golyshev <eugulixes@gmail.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Encryption/DecryptAll.php8
-rw-r--r--core/Command/Encryption/EncryptAll.php8
2 files changed, 16 insertions, 0 deletions
diff --git a/core/Command/Encryption/DecryptAll.php b/core/Command/Encryption/DecryptAll.php
index 9931a279ff4..253223f9529 100644
--- a/core/Command/Encryption/DecryptAll.php
+++ b/core/Command/Encryption/DecryptAll.php
@@ -123,6 +123,14 @@ class DecryptAll extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
+ if ( !$input->isInteractive() ) {
+ $output->writeln('Invalid TTY.');
+ $output->writeln('If you are trying to execute the command in a Docker ');
+ $output->writeln("container, do not forget to execute 'docker exec' with");
+ $output->writeln("the '-i' and '-t' options.");
+ $output->writeln('');
+ return;
+ }
try {
if ($this->encryptionManager->isEnabled() === true) {
diff --git a/core/Command/Encryption/EncryptAll.php b/core/Command/Encryption/EncryptAll.php
index a2b56683324..b16fa0af2c7 100644
--- a/core/Command/Encryption/EncryptAll.php
+++ b/core/Command/Encryption/EncryptAll.php
@@ -105,6 +105,14 @@ class EncryptAll extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
+ if ( !$input->isInteractive() ) {
+ $output->writeln('Invalid TTY.');
+ $output->writeln('If you are trying to execute the command in a Docker ');
+ $output->writeln("container, do not forget to execute 'docker exec' with");
+ $output->writeln("the '-i' and '-t' options.");
+ $output->writeln('');
+ return;
+ }
if ($this->encryptionManager->isEnabled() === false) {
throw new \Exception('Server side encryption is not enabled');