[braindamaged?] use of access(2) -- long note

Douglas B. Jones douglas at dcc1.UUCP
Thu Mar 17 05:20:56 AEST 1988


There has been some talk about the access(2) only working on the real
uid/gid pair. Two alternate possibilites:

1) have a saccess(2) which will check against setuid/setgid. If they fail,
   then it will check against realuid/realgid. OR, maybe it will just check
   against the setuid/setgid.

2) have another routine, call it faccess(2), which will have the call:

	ret = faccess(file_path,uid,gid);

   so you can check against the uid and gid pair. You could also set uid
   or gid to -1, and it would not check for that type.

	ret = faccess(file_path,uid,-1);	/* don't check for gid */

	ret = faccess(file_path,-1,gid);	/* don't check for uid */

	ret = faccess(file_path,uid,gid);	/* check for both */

   I'm not familiar with NFS, but I seem to remember something about some
   id having -1 as the uid (and/or maybe gid) number. If this is the case,
   some other number might have to be picked; say -9999 or -MAXINT.

-- 
Douglas B. Jones
DeKalb College / 555 N. Indian Creek Drive
Clarkston, Ga. 30021 / (404) 299-4233
{cbosgd,hplabs,ihnp4,seismo,ulyses}!gatech!dcc1!douglas or douglas at dcc1



More information about the Comp.unix.questions mailing list