Procházet zdrojové kódy

Drop the RequireBriefOpen exemption the provisioner pipe no longer needs

Review on #366 asked whether a close before the POSIX::_exit would
satisfy RequireBriefOpen.  It would not need to.  Since the credentials
became one print, the close is near enough to the open that the policy
does not report it, so the no critic was exempting nothing.  A close on
that branch would also have nothing to close, because it runs when the
open failed.  The annotation keeps ProhibitPipeOpen, which it does need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
troglodyne-bot před 1 týdnem
rodič
revize
1b196491bf
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/Trog/DataSource/ProvisionedVirt.pm

+ 1 - 1
lib/Trog/DataSource/ProvisionedVirt.pm

@@ -609,7 +609,7 @@ sub spawn ( $domain, $credentials, $dir, $command, $user ) {
     # piped open with a list never involves a shell, so the guest name is an
     # argument and cannot be read as a command.  The single argument form of
     # this would be the bug.
-    my $ok = open( my $stdin, '|-', @$command );    ## no critic (ProhibitPipeOpen, InputOutput::RequireBriefOpen) -- list form, so no shell; closed once the credentials are sent
+    my $ok = open( my $stdin, '|-', @$command );    ## no critic (ProhibitPipeOpen) -- list form, so no shell
     if ( !$ok ) {
         print {$fh} "could not run $command->[0]: $!\n";
         POSIX::_exit(1);