diff --git a/file-5.26-revert-close.patch b/file-5.26-revert-close.patch new file mode 100644 index 0000000..db32cd3 --- /dev/null +++ b/file-5.26-revert-close.patch @@ -0,0 +1,25 @@ +From c8581da4c79cfc3fe52bb6c398497ff3a9986abd Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 8 Feb 2016 02:20:36 +0000 +Subject: [PATCH] doesn't matter if it is stdin; if we opened it, we close it. + +--- + magic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/magic.c src/magic.c +index 30faa8a..c3ceb50 100644 +--- src/magic.c ++++ src/magic.c +@@ -346,7 +346,7 @@ private void + close_and_restore(const struct magic_set *ms, const char *name, int fd, + const struct stat *sb) + { +- if (fd == STDIN_FILENO || name == NULL) ++ if (name == NULL) + return; + (void) close(fd); + +-- +2.6.6 + diff --git a/file.changes b/file.changes index 3dbabd5..1c1ab2d 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 20 07:14:15 UTC 2016 - werner@suse.de + +- Add and revert upstream patch file-5.26-revert-close.patch + (commit 0177f6dd30e1f8c5639c058dcdf1d9edd9f8528c) to help + rpmbuild not to loose stdin + ------------------------------------------------------------------- Tue Apr 19 11:52:49 UTC 2016 - werner@suse.de diff --git a/file.spec b/file.spec index bae2376..b29b28b 100644 --- a/file.spec +++ b/file.spec @@ -67,6 +67,7 @@ Patch38: file-5.26-version.patch Patch39: file-5.26-downgrade_DER.patch Patch40: file-5.26-console.diff Patch41: file-5.26-zmagic.patch +Patch42: file-5.26-revert-close.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -135,6 +136,7 @@ to develop applications that require the magic "file" interface. %patch39 -p0 -b .DER %patch40 -p1 -b .cons %patch41 -p1 -b .zmag +%patch42 -p0 -b .stdin -R %patch -b .0 test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in rm -fv src/magic.h @@ -169,8 +171,8 @@ install -s dcore %{buildroot}%{_bindir} # Check out that the binary does not bail out: LD_LIBRARY_PATH=%{buildroot}%{_libdir} export LD_LIBRARY_PATH -find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \ - xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic +#find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \ +# xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic unset LD_LIBRARY_PATH %{__rm} -f %{buildroot}%{_libdir}/*.la