*BSD News Article 7348


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!metro!ipso!runxtsa!bde
From: bde@runx.oz.au (Bruce Evans)
Subject: 386BSD-0.1 access() broken for multiple modes
Message-ID: <1992Nov4.041031.2688@runx.oz.au>
Organization: RUNX Un*x Timeshare.  Sydney, Australia.
Date: Wed, 4 Nov 92 04:10:31 GMT
Lines: 21

access() is supposed to return 0 if all of the desired access modes
would be granted.  In 386BSD-0.1, it returns 0 if one of the modes
would be granted.  The fix is simple:

*** /usr/src/sys.386bsd/ufs/ufs_vnops.c~	Wed Dec 25 09:24:07 1991
--- /usr/src/sys.386bsd/ufs/ufs_vnops.c	Sun Oct 25 15:54:30 1992
***************
*** 194,198 ****
  		;
  	}
! 	if ((ip->i_mode & mode) != 0)
  		return (0);
  	return (EACCES);
--- 194,198 ----
  		;
  	}
! 	if ((ip->i_mode & mode) == mode)
  		return (0);
  	return (EACCES);
-- 
Bruce Evans  (bde@runx.oz.au)