Blame Alien-SDL-1.446-Place-temporary-files-into-a-writable-location.patch

337fe07
From 42442db78751ce8d7cb8113b925205b076a0695b Mon Sep 17 00:00:00 2001
337fe07
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
337fe07
Date: Thu, 10 Jun 2021 12:43:49 +0200
337fe07
Subject: [PATCH] Place temporary files into a writable location
337fe07
MIME-Version: 1.0
337fe07
Content-Type: text/plain; charset=UTF-8
337fe07
Content-Transfer-Encoding: 8bit
337fe07
337fe07
check_header() failed if called from a read-only location:
337fe07
337fe07
$ cd /
337fe07
$ perl -e 'use Alien::SDL; Alien::SDL::check_header(q{SDL.h})'
337fe07
[SDL.h] Testing header(s): Error in tempfile() using template aaXXXX.c: Could not create temp file aam5Xl.c: Permission denied at /usr/share/perl5/vendor_perl/Alien/SDL.pm line 243.
337fe07
337fe07
Using a temporary directory attempts to place the files into
337fe07
a temporary location designated by a system. That location (e.g. /tmp)
337fe07
is usually writable.
337fe07
337fe07
Signed-off-by: Petr Písař <ppisar@redhat.com>
337fe07
---
337fe07
 lib/Alien/SDL.pm | 2 +-
337fe07
 1 file changed, 1 insertion(+), 1 deletion(-)
337fe07
337fe07
diff --git a/lib/Alien/SDL.pm b/lib/Alien/SDL.pm
337fe07
index 582ef27..b06976e 100644
337fe07
--- a/lib/Alien/SDL.pm
337fe07
+++ b/lib/Alien/SDL.pm
337fe07
@@ -240,7 +240,7 @@ sub check_header {
337fe07
   }
337fe07
 
337fe07
   my $cb = ExtUtils::CBuilder->new( quiet => 1, config => $config );
337fe07
-  my ($fs, $src) = File::Temp::tempfile('aaXXXX', SUFFIX => '.c', UNLINK => 1);
337fe07
+  my ($fs, $src) = File::Temp::tempfile('aaXXXX', SUFFIX => '.c', TMPDIR => 1, UNLINK => 1);
337fe07
   my $inc = '';
337fe07
   my $i = 0;
337fe07
   foreach (@header) {
337fe07
-- 
337fe07
2.31.1
337fe07