bugfindutils - Bugs: bug #14922, find should show a warning on...

 
 

bug #14922: find should show a warning on unreadable mtab

Submitter:  Andreas Metzler <ametzler>
Submitted:  Sun 06 Nov 2005 11:03:35 AM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.2.26 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 Nov 2005 07:50:04 AM UTC, comment #1: 

If find needs to produce output but cannot produce correct output, it must fail with a fatal exit status, unless the difference in the output cannot ever be harmful. 

Hence if we need data from /etc/mtab but cannot get it, we must exit with a nonzero status so that the caller knows not to trust our output. 

Conversely, if the whole operation of find does not need the data from /etc/mtab, and the data is not available, the exit status is zero because the non-availability of the informaiton was irrelevant. 

I have updated the CVS code appropriately.   Also the NEWS file.

James Youngman <jay>
Group administrator
Sun 06 Nov 2005 11:03:35 AM UTC, original submission:  

ametzler@argenau:/tmp/findutils-rel-4-2-fixes$ find foo -printf '%F\n'
unbekannt
ametzler@argenau:/tmp/findutils-rel-4-2-fixes$ ls -l /etc/mtab
-rw-r-----  1 root root 378 2005-11-06 11:19 /etc/mtab

This is caused by ./find/fstype.c not checking whether gnulib's read_file_system_list returns NULL.

It might be a good idea to show a warning in this case, using something like this:

if (NULL == entries) {
  printf("cannot read table of mounted filesystems:%s\n",strerror(errno));
 }

(It actually should use error() instead obviously.)
http://lists.gnu.org/archive/html/bug-findutils/2005-11/msg00000.html
               thanks, cu andreas

Andreas Metzler <ametzler>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-19 jay Open/ClosedOpen Closed
    Release4.2.25 4.2.26
2005-11-11 jay StatusNone Fixed
    Assigned toNone jay

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code