This commit is contained in:
Daniel Novotny 2010-04-14 11:11:39 +00:00
parent 9ea7a67f7b
commit af58b03679
2 changed files with 28 additions and 1 deletions

20
file-5.04-retval.patch Normal file
View File

@ -0,0 +1,20 @@
diff -up file-5.04/src/fsmagic.c.retval file-5.04/src/fsmagic.c
--- file-5.04/src/fsmagic.c.retval 2010-04-14 12:37:12.000000000 +0200
+++ file-5.04/src/fsmagic.c 2010-04-14 12:55:50.000000000 +0200
@@ -127,14 +127,8 @@ file_fsmagic(struct magic_set *ms, const
ret = stat(fn, sb); /* don't merge into if; see "ret =" above */
if (ret) {
- if (ms->flags & MAGIC_ERROR) {
- file_error(ms, errno, "cannot stat `%s'", fn);
- return -1;
- }
- if (file_printf(ms, "cannot open `%s' (%s)",
- fn, strerror(errno)) == -1)
- return -1;
- return 1;
+ file_error(ms, errno, "cannot open `%s'", fn);
+ return -1;
}
if (!mime) {

View File

@ -5,7 +5,7 @@
Summary: A utility for determining file types
Name: file
Version: 5.04
Release: 7%{?dist}
Release: 8%{?dist}
License: BSD
Group: Applications/File
Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
@ -19,6 +19,7 @@ Patch5: file-5.04-filesystem.patch
Patch6: file-5.04-separ.patch
Patch7: file-5.04-squashfs.patch
Patch8: file-5.04-core-trim.patch
Patch9: file-5.04-retval.patch
Requires: file-libs = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -88,6 +89,8 @@ file(1) command.
%patch7 -p1
#fixes #566305
%patch8 -p1
#fixes #580046
%patch9 -p1
iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
touch -r doc/libmagic.man doc/libmagic.man_
@ -164,6 +167,10 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
* Wed Apr 14 2010 Daniel Novotny <dnovotny@redhat.com> 5.04-8
- fix #580046 - the file command returns zero exit code
even in case of unexisting file being tested
* Wed Apr 07 2010 Daniel Novotny <dnovotny@redhat.com> 5.04-7
- fix #566305 - "file" may trim too much of command line from core file