Linked by Thom Holwerda on Sat 10th May 2008 20:27 UTC, submitted by rosebug
Bugs & Viruses 1983. The year of the IBM PC XT, the Apple Lisa, Pioneer 10 leaving the solar system, and Hooters opening up shop in Florida. It's also the birthyear of a 25 year old BSD bug, squashed only a few days ago.
Permalink for comment 313755
To read all comments associated with this story, please click here.
RE: Not 'UNIX' bug
by cstoner on Sun 11th May 2008 01:01 UTC in reply to "Not 'UNIX' bug"
cstoner
Member since:
2008-05-11

It is a fringe case bug that caused some headaches with Samba. The problem was actually known for three years.

It comes down to directory access. A directory is stored as a block that points to all of its 'contents' somewhere else on the disk. To navigate these directories, originally, you had to manually pull out the contents from the pointer. This library addressed a lot of those issues for the BSDs.

UNIX is a concurrent system. Several people can do several things at once on the same system. This is where the bug comes from. If one persons program were to seek -- the term for iterating through the contents until you find what you're looking for -- through a directory to find a file, you get an index into that directory's 'contents array' as a return value.

The index has several purposes, but that's besides the point.

EDIT: This is not techinally correct. Correction follows.
If you seeked to a point in the directory, and then someone else deleted something.

EDIT:
There was a special case when you were deleting the first file in a directory, and that case was not correctly accounted for when you seeked through a directory.



Your index would be off because of the way the deletion was handled. The result? You get the contents of another file -- one that you didn't ask for.

Edited 2008-05-11 01:06 UTC

Reply Parent Score: 3