bugfindutils - Bugs: bug #4380, updatedb: produces invalid db if...

 
 

bug #4380: updatedb: produces invalid db if external commands fail.

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sun 20 Jul 2003 09:50:12 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: NoneFixed Release: 4.2.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 13 May 2004 07:49:24 AM UTC, comment #2:

jay wrote:

> This problem is fixed in the CVS code for findutils. [...]


Actually it is not completely fixed. Errors in sort or tr are still ignored afaict.

Andreas Metzler <ametzler>
Mon 03 May 2004 09:59:39 AM UTC, comment #1:

This problem is fixed in the CVS code for findutils.
To resolve your problem, you could either wait for the
next official release of findutils, or check out a copy
of the code from the CVS repository for findutils.

James Youngman <jay>
Project Administrator
Sun 20 Jul 2003 09:50:12 AM UTC, original submission:

Version: 4.1.20

First reported by Stefan Wiens in http://bugs.debian.org/90381

| The `updatedb' script does not take reasonable action if one of its
| (external) commands fails for some reason. An example:
|
| stefan@xenon:~/testdir$ updatedb --localpaths=. --output=locatedb
| stefan@xenon:~/testdir$ ls -l locatedb
| -rw-r--r-- 1 stefan stefan 2746 Mar 20 04:09 locatedb
| stefan@xenon:~/testdir$ ps h | wc -l
| 28
| stefan@xenon:~/testdir$ ulimit -Su 32 # 28 + 4
| stefan@xenon:~/testdir$ updatedb --localpaths=. --output=locatedb
| /usr/bin/updatedb: Cannot fork
| stefan@xenon:~/testdir$ echo $?
| 0
| stefan@xenon:~/testdir$ ls -l locatedb
| -rw-r--r-- 1 stefan stefan 10 Mar 20 04:10 locatedb
| stefan@xenon:~/testdir$
|
| Running updatedb through `sh -x' shows that the `find' invocation
| fails, but updatedb destroys the existing database and returns
| with exit status 0.

I completely agree. I'd suggest using "set -e" to abort on any error and instead of 'find | sort | frcode > file' some code to abort if find or sort fails, my sh-scripting is not superb, I only came up with:
{ find || exit 1 ; } | { sort || exit 1 ; } | frcode

Is there a more elegant way?
cu andreas

Andreas Metzler <ametzler>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 16 Oct 2004 06:18:22 PM UTCjayOpen/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.2.0
Mon 03 May 2004 09:59:39 AM UTCjayStatusNone=>Fixed

Back to the top


Powered by Savane 3.1-cleanup1