ACCESS(2) sometimes NOT useful - (nf)

edwards at uiucuxc.UUCP edwards at uiucuxc.UUCP
Fri Sep 23 13:45:03 AEST 1983


#N:uiucuxc:5500067:000:849
uiucuxc!edwards    Sep  6 22:00:00 1983

	The 4.1bsd manual states that access(2) uses a program's real
  id's to determine access permissions on files/paths, and that this
  is useful to set-UID programs.
	Well, It really depends on what you're checking.  If a set-UID
  program wants to do things to privileged areas, then access(2) is NOT
  useful to those set-UID programs.

  For example:	If your set-UID program wants to see if a directory
		exists in a privileged area "access to a set-UIDed
		program or user only," then you can't use access(2)
		because the real [ug]id of the process wouldn't have
		access anyway (the purpose for making it Set-UID.)

  Suggestion:	eaccess(2) or equivalent to check for effective id's.
		What do you think about it?  Nasty comments >> /dev/null

			Alan Edwards
			University of Illinois @ Urbana-Champaign
			(...pur-ee!uiucdcs!uiucuxc!edwards)



More information about the Comp.unix.wizards mailing list