From 7c9b2ac22c2dd7e8f499da50aed7640b3af5defd Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 21 Feb 1997 21:55:21 +0000 Subject: (diskfs_S_dir_lookup): Allow symlinks to be opened for O_READ. --- libdiskfs/dir-lookup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libdiskfs/dir-lookup.c') diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index b9572f05..9946300c 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -385,9 +385,10 @@ 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_IFLNK - || type == S_IFCHR || type == S_IFIFO) - && (flags & (O_READ|O_WRITE|O_EXEC))) + 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)))) error = EOPNOTSUPP; if (!error && (flags & O_READ)) -- cgit v1.2.3