From 4e93ecb2023dbaf2e6daaba300c351ce3dcc079a Mon Sep 17 00:00:00 2001 From: ston1th Date: Sun, 19 Jan 2020 09:44:54 +0100 Subject: [PATCH] move open3 to ipc run --- README.md | 2 ++ smtp_auth_sync.pl | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3776bfb..015f9b6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/smtp_auth_sync.pl b/smtp_auth_sync.pl index 3aae84f..d601029 100755 --- a/smtp_auth_sync.pl +++ b/smtp_auth_sync.pl @@ -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 = ); - close(READ); + my $hash; + my $h = start(\@enc, \<