diff options
Diffstat (limited to 'libdiskfs/dir-lookup.c')
-rw-r--r-- | libdiskfs/dir-lookup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index eafeefc3..05e3fc5b 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -460,12 +460,14 @@ diskfs_S_dir_lookup (struct protid *dircred, if (!newnode) /* Check permissions on existing nodes, but not new ones. */ { - if (((type == S_IFSOCK || type == S_IFBLK || type == S_IFCHR || + if ((type == S_IFSOCK || type == S_IFBLK || type == S_IFCHR || type == S_IFIFO) && (flags & (O_READ|O_WRITE|O_EXEC))) - || (type == S_IFLNK && (flags & (O_WRITE|O_EXEC)))) err = EACCES; + if (!err && type == S_IFLNK && (flags & (O_WRITE|O_EXEC))) + err = ELOOP; + if (!err && (flags & O_READ)) err = fshelp_access (&np->dn_stat, S_IREAD, dircred->user); |