Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 147781 Details for
Bug 227523
Unpacking compressed archive fails when STDOUT is closed
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch is fixing this issue for tar 1.15.1
tar-1.15.1-stdout.patch (text/plain), 4.00 KB, created by
Lukas Vrabel
on 2007-02-09 15:41:29 UTC
(
hide
)
Description:
patch is fixing this issue for tar 1.15.1
Filename:
MIME Type:
Creator:
Lukas Vrabel
Created:
2007-02-09 15:41:29 UTC
Size:
4.00 KB
patch
obsolete
>--- tar-1.15.1/src/tar.c.stdout 2007-02-09 16:03:05.000000000 +0100 >+++ tar-1.15.1/src/tar.c 2007-02-09 16:04:00.000000000 +0100 >@@ -42,6 +42,7 @@ > #include <prepargs.h> > #include <quotearg.h> > #include <xstrtol.h> >+#include <stdopen.h> > > /* Local declarations. */ > >@@ -1711,6 +1712,10 @@ > filename_terminator = '\n'; > set_quoting_style (0, escape_quoting_style); > >+ /* Make sure we have first three descriptors available */ >+ stdopen (); >+ >+ > /* Pre-allocate a few structures. */ > > allocated_archive_names = 10; >--- tar-1.15.1/lib/Makefile.am.stdout 2007-02-09 16:09:43.000000000 +0100 >+++ tar-1.15.1/lib/Makefile.am 2007-02-09 16:09:30.000000000 +0100 >@@ -267,6 +267,10 @@ > mv $@-t $@ > MOSTLYCLEANFILES += stdbool.h stdbool.h-t > >+# stdopen.h >+noinst_HEADERS += stdopen.h >+libtar_a_SOURCES += stdopen.h stdopen.c >+ > # stpcpy > libtar_a_SOURCES += stpcpy.h > >--- tar-1.15.1/lib/stdopen.c.stdout 2007-02-09 16:17:24.000000000 +0100 >+++ tar-1.15.1/lib/stdopen.c 2007-02-09 16:16:47.000000000 +0100 >@@ -0,0 +1,77 @@ >+/* stdopen.c - ensure that the three standard file descriptors are in use >+ >+ Copyright (C) 2005 Free Software Foundation, Inc. >+ >+ This program is free software; you can redistribute it and/or modify >+ it under the terms of the GNU General Public License as published by >+ the Free Software Foundation; either version 2, or (at your option) >+ any later version. >+ >+ This program is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ GNU General Public License for more details. >+ >+ You should have received a copy of the GNU General Public License >+ along with this program; if not, write to the Free Software Foundation, >+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ >+ >+/* Written by Paul Eggert and Jim Meyering. */ >+ >+#ifdef HAVE_CONFIG_H >+# include <config.h> >+#endif >+ >+#include "stdopen.h" >+ >+#include <sys/types.h> >+#include <sys/stat.h> >+#include <fcntl.h> >+#include <unistd.h> >+#include <errno.h> >+ >+/* Try to ensure that all of the standard file numbers (0, 1, 2) >+ are in use. Without this, each application would have to guard >+ every call to open, dup, fopen, etc. with tests to ensure they >+ don't use one of the special file numbers when opening a file. >+ Return false if at least one of the file descriptors is initially >+ closed and an attempt to reopen it fails. Otherwise, return true. */ >+bool >+stdopen (void) >+{ >+ int fd; >+ bool ok = true; >+ >+ for (fd = 0; fd <= 2; fd++) >+ { >+ if (fcntl (fd, F_GETFD) < 0) >+ { >+ if (errno != EBADF) >+ ok = false; >+ else >+ { >+ static const int contrary_mode[] >+ = { O_WRONLY, O_RDONLY, O_RDONLY }; >+ int mode = contrary_mode[fd]; >+ int new_fd; >+ /* Open /dev/null with the contrary mode so that the typical >+ read (stdin) or write (stdout, stderr) operation will fail. >+ With descriptor 0, we can do even better on systems that >+ have /dev/full, by opening that write-only instead of >+ /dev/null. The only drawback is that a write-provoked >+ failure comes with a misleading errno value, ENOSPC. */ >+ if (mode == O_RDONLY >+ || (new_fd = open ("/dev/full", mode) != fd)) >+ new_fd = open ("/dev/null", mode); >+ if (new_fd != fd) >+ { >+ if (0 <= new_fd) >+ close (new_fd); >+ ok = false; >+ } >+ } >+ } >+ } >+ >+ return ok; >+} >--- tar-1.15.1/lib/stdopen.h.stdout 2007-02-09 16:17:19.000000000 +0100 >+++ tar-1.15.1/lib/stdopen.h 2007-02-09 16:16:47.000000000 +0100 >@@ -0,0 +1,16 @@ >+#ifndef STDOPEN_H >+# define STDOPEN_H 1 >+ >+# include <stdbool.h> >+ >+# ifdef __cplusplus >+extern "C" { >+# endif >+ >+bool stdopen (void); >+ >+# ifdef __cplusplus >+} >+# endif >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 227523
: 147781