aboutsummaryrefslogtreecommitdiffstats
path: root/core/command
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-04-15 18:04:54 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-04-15 18:04:54 +0200
commit854dd8fa7c793fdca6d9077c3519f4d55ad20eb9 (patch)
treecff05b2fd7b3784222408c375a2f9ec35bfae635 /core/command
parentd2c7a8ee59d57be1441f771ff00350d5f677999f (diff)
downloadnextcloud-server-854dd8fa7c793fdca6d9077c3519f4d55ad20eb9.tar.gz
nextcloud-server-854dd8fa7c793fdca6d9077c3519f4d55ad20eb9.zip
Do not block when nothing is passed via stdin.
Diffstat (limited to 'core/command')
-rw-r--r--core/command/db/converttype.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index 8f3047b8a0b..02dc45383e8 100644
--- a/core/command/db/converttype.php
+++ b/core/command/db/converttype.php
@@ -123,8 +123,11 @@ class ConvertType extends Command {
return;
}
- // Read from stdin
+ // Read from stdin. stream_set_blocking is used to prevent blocking
+ // when nothing is passed via stdin.
+ stream_set_blocking(STDIN, 0);
$password = file_get_contents('php://stdin');
+ stream_set_blocking(STDIN, 1);
if (trim($password) !== '') {
$input->setOption('password', $password);
return;