From af58b0367925cde1658518908a8d9983a3f96de4 Mon Sep 17 00:00:00 2001 From: Daniel Novotny Date: Apr 14 2010 11:11:39 +0000 Subject: fix #580046 --- diff --git a/file-5.04-retval.patch b/file-5.04-retval.patch new file mode 100644 index 0000000..c44d335 --- /dev/null +++ b/file-5.04-retval.patch @@ -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) { diff --git a/file.spec b/file.spec index 98a919b..f0b2306 100644 --- a/file.spec +++ b/file.spec @@ -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 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 5.04-7 - fix #566305 - "file" may trim too much of command line from core file