Revision 2914ad38ce40d64d6d2e0254182dcd364db6a005 authored by Bill Joy on 09 May 1979, 07:13:28 UTC, committed by Bill Joy on 09 May 1979, 07:13:28 UTC
Work on file src/printenv.c Synthesized-from: 2bsd
1 parent fd888be
access.sys
--- This is a new line for sysent.c ---
2, &saccess, /* 33 = access */
--- Also extern saccess at the beginning of sysent. ---
--- And this code should be placed at the end of sys2.c ---
/*
* access system call
*/
saccess()
{
extern uchar;
register svuid, svgid;
register *ip;
svuid = u.u_uid;
svgid = u.u_gid;
u.u_uid = u.u_ruid;
u.u_gid = u.u_rgid;
ip = namei(&uchar, 0);
if (ip != NULL) {
if (u.u_arg[1]&(IREAD>>6))
access(ip, IREAD);
if (u.u_arg[1]&(IWRITE>>6))
access(ip, IWRITE);
if (u.u_arg[1]&(IEXEC>>6))
access(ip, IEXEC);
iput(ip);
}
u.u_uid = svuid;
u.u_gid = svgid;
}
--- That should do it ---
Computing file changes ...