summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-lookup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 59e850cd..8667fd3b 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -125,7 +125,24 @@ diskfs_S_dir_lookup (struct protid *dircred,
error = diskfs_lookup (dnp, path, CREATE, &np, ds, dircred);
}
else
- error = diskfs_lookup (dnp, path, LOOKUP, &np, 0, dircred);
+ {
+ /* XXX should be done in wrapper */
+ np = diskfs_check_cache (dnp, path);
+ if (np)
+ {
+ /* Verify that we were allowed in. XXX should be done
+ in wrapper for diskfs_lookup */
+ assert (S_ISDIR (dp->dn_stat.st_mode));
+ error = diskfs_access (dp, S_IEXEC, cred);
+ if (error)
+ {
+ diskfs_nrele (np);
+ np = 0;
+ }
+ }
+ else
+ error = diskfs_lookup (dnp, path, LOOKUP, &np, 0, dircred);
+ }
if (lastcomp && create && excl && (!error || error == EAGAIN))
error = EEXIST;