Author: adsb
Date: 2009-08-17 18:51:02 +0000 (Mon, 17 Aug 2009)
New Revision: 1962

Modified:
   trunk/debian/changelog
   trunk/scripts/bts.pl
Log:
bts: Use >& rather than writing to filehandles under /dev/fd.
(Closes: #517917)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-08-17 18:46:53 UTC (rev 1961)
+++ trunk/debian/changelog      2009-08-17 18:51:02 UTC (rev 1962)
@@ -10,6 +10,8 @@
   [ Adam D. Barratt ]
   * bts:
     + Make "tags NNNNNN =" operate correctly again.  (Closes: #539688)
+    + Use >& rather than writing to filehandles under /dev/fd.
+      (Closes: #517917)
   * cowpoke:
     + Update to new upstream version
       - Run with reduced privileges and only elevate them when needed to

Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl        2009-08-17 18:46:53 UTC (rev 1961)
+++ trunk/scripts/bts.pl        2009-08-17 18:51:02 UTC (rev 1962)
@@ -2315,7 +2315,7 @@
                                       SUFFIX => ".mail",
                                       DIR => File::Spec->tmpdir,
                                       UNLINK => 1);
-       open (MAILOUT, ">/dev/fd/" . fileno($fh))
+       open (MAILOUT, ">&", $fh)
            or die "bts: writing to temporary file: $!\n";
 
        print MAILOUT $message;
@@ -2999,7 +2999,7 @@
                                       DIR => File::Spec->tmpdir,
                                       UNLINK => 1);
            # Use filehandle for security
-           open (OUT_MBOX, ">/dev/fd/" . fileno($fh))
+           open (OUT_MBOX, ">&", $fh)
                or die "bts: writing to temporary file: $!\n";
        } else {
            $filename = $mboxfile;
@@ -3405,7 +3405,7 @@
                                              UNLINK => 1);
 
                # Use filehandle for security
-               open (OUT_LIVE, ">/dev/fd/" . fileno($fh))
+               open (OUT_LIVE, ">&", $fh)
                    or die "bts: writing to temporary file: $!\n";
                # Correct relative urls to point to the bts.
                $live =~ s%\shref="(?:/cgi-bin/)?(\w+\.cgi)% 
href="$btscgiurl$1%g;



-- 
To unsubscribe, send mail to [email protected].

Reply via email to