Description: Ensure PATH is set when running taint mode
 As of this commit in Perl 5.38:
   https://github.com/Perl/perl5/commit/5ede4453c4877110eb5214ff400c173210b101b1
 when running in taint mode an empty $ENV{PATH} is equivalent to '.' (cwd),
 Perl reports:
   Insecure directory in $ENV{PATH} while running with -T switch
 This patch ensure that the PATH is set when running in Taint mode to prevent
 the default being used.
Bug: https://rt.cpan.org/Ticket/Display.html?id=149323
Author: Andrew Ruthven <andrew@etc.gen.nz>
Last-Update: 2023-08-06
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: libgnupg-interface-perl/lib/GnuPG/Interface.pm
===================================================================
--- libgnupg-interface-perl.orig/lib/GnuPG/Interface.pm
+++ libgnupg-interface-perl/lib/GnuPG/Interface.pm
@@ -351,7 +351,11 @@ sub fork_attach_exec( $% ) {
             @commands,     @command_args
         );
 
-        local $ENV{PATH} if tainted $ENV{PATH};
+        # On Unix, PATH is by default '.' and Perl >= v5.38 rejects '.'
+        # being in the path when in taint mode. Set a path, if running
+        # in taint mode whomever is calling us should be providing the
+        # path to the gpg program to use.
+        local $ENV{PATH} = '/usr/bin' if tainted $ENV{PATH};
         exec @command or die "exec() error: $ERRNO";
     }
 
