move open3 to ipc run
This commit is contained in:
parent
197ecbb5b1
commit
4e93ecb202
2 changed files with 8 additions and 6 deletions
|
|
@ -11,6 +11,8 @@ Copy `smtp_auth_sync.pl` to `/usr/local/sbin/smtp_auth_sync.pl` and set execute
|
||||||
|
|
||||||
`chmod 755 /usr/local/sbin/smtp_auth_sync.pl`
|
`chmod 755 /usr/local/sbin/smtp_auth_sync.pl`
|
||||||
|
|
||||||
|
Dependency: `pkg_add p5-IPC-Run`
|
||||||
|
|
||||||
Use the `install_openbsd.sh` or `install_linux.sh` scripts to create the `rc` or `systemd` configs.
|
Use the `install_openbsd.sh` or `install_linux.sh` scripts to create the `rc` or `systemd` configs.
|
||||||
|
|
||||||
## Config Options
|
## Config Options
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use warnings;
|
||||||
use Config;
|
use Config;
|
||||||
use IO::Socket;
|
use IO::Socket;
|
||||||
use IO::Select;
|
use IO::Select;
|
||||||
use IPC::Open3;
|
use IPC::Run qw (start finish );
|
||||||
|
|
||||||
# Configs
|
# Configs
|
||||||
# File to store the user:password hash mappings
|
# File to store the user:password hash mappings
|
||||||
|
|
@ -76,11 +76,11 @@ while (my $conn = $sock->accept()) {
|
||||||
if ($user eq "" or $pass eq "") {
|
if ($user eq "" or $pass eq "") {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
open3(\*WRITE, \*READ, 0, $enc);
|
my $hash;
|
||||||
print WRITE "$pass";
|
my $h = start(\@enc, \<<IN, \$hash);
|
||||||
close(WRITE);
|
$pass
|
||||||
chomp(my $hash = <READ>);
|
IN
|
||||||
close(READ);
|
chomp($hash);
|
||||||
if ($hash eq "") {
|
if ($hash eq "") {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue