home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / minix / 4799 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.6 KB  |  44 lines

  1. Newsgroups: comp.os.minix
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.belwue.de!news.uni-tuebingen.de!wega!flebbe
  3. From: flebbe@wega.tat.physik.uni-tuebingen.de (Olaf Flebbe)
  4. Subject: Bug in fs Minix1.6.23
  5. Message-ID: <flebbe.722116609@wega>
  6. Sender: news@softserv.zdv.uni-tuebingen.de (News Operator)
  7. Organization: TAT (Theoretical Astrophysics Tuebingen), U. of Tuebingen, FRG
  8. Date: Wed, 18 Nov 1992 19:56:49 GMT
  9. Lines: 33
  10.  
  11. Hi,
  12.  
  13. I discovered a bug in the 1.6.23 fs, while using test21. Here a quote
  14. from source of do_rename() in fs/link.c
  15.  
  16. do_rename() {
  17. [...]
  18.   struct inode *old_dirp, *old_ip;    /* ptrs to old dir, file inodes */
  19. [ ...]
  20.   if ( (old_ip = advance(old_dirp, old_name)) == NIL_INODE) r = err_code;
  21. [ ... (no return statements) ...]
  22.   odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY);  /* TRUE iff dir */
  23.  
  24. The source describes how to get a pointer to the inode of file
  25. old_name and how to test, whether it is a directory. But suppose
  26. advance fails, then advance will return a NIL_INODE, which fs tries to
  27. derefence. ->Crash. 
  28.  
  29. This will happen, when the old_name is located in a directory with no
  30. read permissions, because advance uses the function search_dir in
  31. order to determine the inode #. The comments in search_dir state that
  32. this function checks the permissions unless the filename is "." or "..".
  33.  
  34. I'm too lazy to decide which of the described features is a bug, but
  35. a fs crash is definitly a bug.
  36.  
  37. Is there already a "official" patch around?
  38.  
  39. greetings
  40.    olaf
  41. --
  42.   Olaf Flebbe,  Theoretische Astrophysik Tuebingen
  43.   Internet:     flebbe@tat.physik.uni-tuebingen.de
  44.