From 82f5284ffca200e341111db21c552fd3480de60b Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Tue, 2 Jul 2024 22:48:40 +0300 Subject: [PATCH] Fix to use pipe handling data directly in memory https://github.com/webmin/webmin/pull/2211#discussion_r1663042881 --- web-lib-funcs.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 2efc1d11a..406b28652 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -10681,9 +10681,8 @@ elsif (defined($main::open_tempfiles{$_[0]})) { my $file_acls; if ($getfacl && $setfacl) { # Set original ACLs - $file_acls = &transname(); - system("$getfacl --absolute-names ". - quotemeta($_[0]).">$file_acls"); + my $qaclfile = quotemeta($_[0]); + $file_acls = `$getfacl --absolute-names $qaclfile`; } # Get status info for a file my @st = stat($_[0]); @@ -10709,7 +10708,9 @@ elsif (defined($main::open_tempfiles{$_[0]})) { } if ($file_acls) { # Set original ACLs - system("$setfacl --restore=$file_acls"); + open(my $pipe, '|-', "$setfacl --restore=-"); + print($pipe $file_acls); + close($pipe); } &reset_file_attributes($_[0], \@old_attributes); delete($main::open_tempfiles{$_[0]});