summaryrefslogtreecommitdiff
path: root/libtrivfs/dir-lookup.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-02-19 07:45:38 +0000
committerThomas Bushnell <thomas@gnu.org>1999-02-19 07:45:38 +0000
commitb4d4e7e9b8ca92adddbb2c19bb1c3d1beda23441 (patch)
treed32663d27d6836afbc5ca79fcc852f7cd778b748 /libtrivfs/dir-lookup.c
parentb2a6f425757ea52463ec2353712cc79b3446f60c (diff)
1999-02-06 Mark Kettenis <kettenis@gnu.org>
* trivfs.h (trivfs_check_access_hook): New variable. * fsys-getroot.c (trivfs_S_fsys_getroot): Use trivfs_check_acces_hook. * dir-lookup.c (trivfs_S_dir_lookup): Likewise. * file-access.c (trivfs_S_file_check_access): Likewise.
Diffstat (limited to 'libtrivfs/dir-lookup.c')
-rw-r--r--libtrivfs/dir-lookup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libtrivfs/dir-lookup.c b/libtrivfs/dir-lookup.c
index 80677711..5a10bf22 100644
--- a/libtrivfs/dir-lookup.c
+++ b/libtrivfs/dir-lookup.c
@@ -49,7 +49,11 @@ trivfs_S_dir_lookup (struct trivfs_protid *cred,
flags &= ~(O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS);
/* Validate permissions */
- file_check_access (cred->realnode, &perms);
+ if (! trivfs_check_access_hook)
+ file_check_access (cred->realnode, &perms);
+ else
+ (*trivfs_check_access_hook) (cred->po->cntl, cred->user,
+ cred->realnode, &perms);
if ((flags & (O_READ|O_WRITE|O_EXEC) & perms)
!= (flags & (O_READ|O_WRITE|O_EXEC)))
return EACCES;