From d21fc10c71aee5eab6c9dd8d6bd0e82b3200e60b Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 11 Jun 2023 19:03:06 -0700 Subject: [PATCH] Handle hang when changing password --- virtualmin-mailman-lib.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virtualmin-mailman-lib.pl b/virtualmin-mailman-lib.pl index c3bf7dc..669d0b6 100755 --- a/virtualmin-mailman-lib.pl +++ b/virtualmin-mailman-lib.pl @@ -901,7 +901,9 @@ sub set_django_superuser_pass print $fh $pass,"\n"; close($fh); my $perl = &get_perl_path(); -my $out = &backquote_logged("$perl $module_root_directory/pty.pl --sleep 1 $wcmd changepassword ".quotemeta($user)." <$temp 2>&1"); +sleep(10); +my $out = &backquote_with_timeout("$perl $module_root_directory/pty.pl --sleep 1 $wcmd changepassword ".quotemeta($user)." <$temp 2>&1", 5); +$out =~ s/^PTY\s+PID:\s+\d+\s*//; return $? ? $out : undef; }