home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.minix
- Path: sparky!uunet!mcsun!sun4nl!relay.philips.nl!philce!meulenbr
- From: meulenbr@ce.philips.nl (Frans Meulenbroeks)
- Subject: Re: Bug in fs Minix1.6.23
- Message-ID: <1992Nov19.081218.25559@philce.ce.philips.nl>
- Sender: usenet@philce.ce.philips.nl (USENET post news)
- Organization: Philips Consumer Electronics, Eindhoven
- References: <flebbe.722116609@wega>
- Date: Thu, 19 Nov 1992 08:12:18 GMT
- Lines: 35
-
- flebbe@wega.tat.physik.uni-tuebingen.de (Olaf Flebbe) writes:
-
- >Hi,
-
- >I discovered a bug in the 1.6.23 fs, while using test21. Here a quote
- >from source of do_rename() in fs/link.c
-
- >do_rename() {
- >[...]
- > struct inode *old_dirp, *old_ip; /* ptrs to old dir, file inodes */
- >[ ...]
- > if ( (old_ip = advance(old_dirp, old_name)) == NIL_INODE) r = err_code;
- >[ ... (no return statements) ...]
- > odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY); /* TRUE iff dir */
-
- >The source describes how to get a pointer to the inode of file
- >old_name and how to test, whether it is a directory. But suppose
- >advance fails, then advance will return a NIL_INODE, which fs tries to
- >derefence. ->Crash.
-
- [...]
-
- >Is there already a "official" patch around?
-
- Yes. add:
- if (old_ip != NIL_INODE)
- before the line
- odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY); /* TRUE iff dir */
-
- This will be part of the next version.
-
- Enjoy,
- --
- Frans Meulenbroeks Philips Research Laboratories
- preferred email address: meulenbr@prl.philips.nl
-