File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
skip = false
6
6
user = example
7
- pass = password
8
7
host = example.com
9
8
port = 21
10
9
path = /path/to/installation
11
10
passive = true
12
11
13
12
; If that seemed too long for you, you can specify servers like this:
14
- [ftp://example:password@example.com:21/path/to/installation]
13
+ [ftp://example:password@example.com:21/path/to/installation]
Original file line number Diff line number Diff line change @@ -617,7 +617,6 @@ class Config {
617
617
'host' => '',
618
618
'user' => '',
619
619
'branch' => null,
620
- 'pass' => '',
621
620
'port' => 21,
622
621
'path' => '/',
623
622
'passive' => true,
@@ -626,6 +625,8 @@ class Config {
626
625
'upload_untracked' => array()
627
626
), $options);
628
627
628
+ $options['pass'] = self::promptPassword();
629
+
629
630
if ($options['skip']) {
630
631
continue;
631
632
} else {
@@ -639,6 +640,24 @@ class Config {
639
640
return $return;
640
641
}
641
642
643
+ public static function promptPassword() {
644
+ $prompt = 'Enter ftp password: ';
645
+
646
+ $command = "/usr/bin/env bash -c 'echo OK'";
647
+ if (rtrim(shell_exec($command)) !== 'OK') {
648
+ trigger_error("Can't invoke bash");
649
+ return;
650
+ }
651
+
652
+ $command = "/usr/bin/env bash -c 'read -s -p \""
653
+ . addslashes($prompt)
654
+ . "\" mypassword && echo \$mypassword'";
655
+ $password = rtrim(shell_exec($command));
656
+ echo "\n";
657
+
658
+ return $password;
659
+ }
660
+
642
661
}
643
662
644
663
#### PHP SEC LIB 0.3.5
@@ -32098,4 +32117,4 @@ class Net_SSH2 {
32098
32117
}
32099
32118
}
32100
32119
32101
- main();
32120
+ main();
You can’t perform that action at this time.
0 commit comments