Bug 580046

Summary: the file command returns zero exit code even in case of unexisting file being tested
Product: [Fedora] Fedora Reporter: Daniel Novotny <dnovotny>
Component: fileAssignee: Daniel Novotny <dnovotny>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dnovotny, mcermak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 548450 Environment:
Last Closed: 2010-04-14 11:17:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 548450, 608686    
Bug Blocks:    
Attachments:
Description Flags
a patch to solve this
none
more elegant version of the patch none

Description Daniel Novotny 2010-04-07 11:33:28 UTC
+++ This bug was initially created as a clone of Bug #548450 +++

Description of problem:

   %SUMMARY

Version-Release number of selected component (if applicable):

   file-4.17-15.el5_3.1

How reproducible:

   Always

Steps to Reproduce:

[root@localhost ~]# file this_file_does_not_exist
this_file_does_not_exist: ERROR: cannot open `this_file_does_not_exist' (No such file or directory)
[root@localhost ~]# echo $?
0
[root@localhost ~]#
  
Actual results:

  Returns zero exitcode.

Expected results:

  Should IMHO return some non-zero exitcode.

Additional info:

--- Additional comment from pm-rhel on 2009-12-21 10:20:27 EST ---

This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 1 Daniel Novotny 2010-04-14 10:52:46 UTC
Created attachment 406467 [details]
a patch to solve this

Comment 2 Daniel Novotny 2010-04-14 10:58:24 UTC
Created attachment 406468 [details]
more elegant version of the patch

Comment 3 Daniel Novotny 2010-04-14 11:17:43 UTC
fixed in rawhide: file-5.04-8.fc14