*BSD News Article 8958


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.hawaii.edu!ames!sun-barr!cs.utexas.edu!wotan.compaq.com!moxie!hackney
From: hackney@moxie.hou.tx.us (Greg Hackney)
Subject: 386BSD - Bug in UFS file system + proposed fix
Message-ID: <1992Dec16.012248.8123@moxie.hou.tx.us>
Sender: hackney@moxie.hou.tx.us (Greg Hackney)
Organization: None
Date: Wed, 16 Dec 1992 01:22:48 GMT
Lines: 45

[ I posted this once, but I'm reasonably sure it didn't make it out ]

There is a major bug in the 386BSD UFS code relating to file permissions.
The major symptom is:

   Can't read most files that you don't own on a remote NFS 386BSD system,
   although there is public read permission, i.e.:

-r--r--r--   1 root     other          5 Dec 15 19:15 /tmp/hell

A very minor symptom is you can't read some LOCAL files, although
there is public read permission, i.e. a file that looks like:

-------r--   1 root     other          5 Dec 15 19:15 /tmp/hell

[ This functionality seems broken on SunOS 4.1 too, but not on USL S5R4. ]

Attached is the proposed fix for 386BSD.
--
Greg Hackney  hackney@compaq.com
Mike Busby    mcb@compaq.com

---< cut here >---

*** sys.386bsd/ufs/ufs_vnops.c.orig	Tue Dec 15 19:07:09 1992
--- sys.386bsd/ufs/ufs_vnops.c	Tue Dec 15 19:06:55 1992
***************
*** 201,207 ****
  found:
  		;
  	}
! 	if ((ip->i_mode & mode) == mode)
  		return (0);
  	return (EACCES);
  }
--- 201,207 ----
  found:
  		;
  	}
! 	if ((ip->i_mode & mode) != 0)
  		return (0);
  	return (EACCES);
  }