1
0
Fork 0

move open3 to ipc run

This commit is contained in:
ston1th 2020-01-19 09:44:54 +01:00
commit 4e93ecb202
2 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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;
}