summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-21 21:55:21 +0000
committerMiles Bader <miles@gnu.org>1997-02-21 21:55:21 +0000
commit7c9b2ac22c2dd7e8f499da50aed7640b3af5defd (patch)
tree15477aabd6e5eb88077e77ea27f99a6b227275ec /libdiskfs
parentc9c36bf191be88846d67dcbe6bebc0b3c4938fb7 (diff)
(diskfs_S_dir_lookup):
Allow symlinks to be opened for O_READ.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-lookup.c7
1 files changed, 4 insertions, 3 deletions
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))