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`
|
||||
|
||||
Dependency: `pkg_add p5-IPC-Run`
|
||||
|
||||
Use the `install_openbsd.sh` or `install_linux.sh` scripts to create the `rc` or `systemd` configs.
|
||||
|
||||
## Config Options
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use warnings;
|
|||
use Config;
|
||||
use IO::Socket;
|
||||
use IO::Select;
|
||||
use IPC::Open3;
|
||||
use IPC::Run qw (start finish );
|
||||
|
||||
# Configs
|
||||
# File to store the user:password hash mappings
|
||||
|
|
@ -76,11 +76,11 @@ while (my $conn = $sock->accept()) {
|
|||
if ($user eq "" or $pass eq "") {
|
||||
next;
|
||||
}
|
||||
open3(\*WRITE, \*READ, 0, $enc);
|
||||
print WRITE "$pass";
|
||||
close(WRITE);
|
||||
chomp(my $hash = <READ>);
|
||||
close(READ);
|
||||
my $hash;
|
||||
my $h = start(\@enc, \<<IN, \$hash);
|
||||
$pass
|
||||
IN
|
||||
chomp($hash);
|
||||
if ($hash eq "") {
|
||||
next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue