summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-08-26 23:39:24 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-08-26 23:39:24 +0200
commitc19a90851170077b99e694262d002a6e22145b49 (patch)
tree038deb0b37eb8420316dba456c80eb8ccf5ebd23
parent5a4ddc13246841da1350c8f6e783fd6a1d911aa4 (diff)
Fix ifsock permission check
POSIX requires write access to the socket, not read access, to be able to connect to it. * trans/ifsock.c (S_ifsock_getsockaddr): Test for O_WRITE instead of O_READ.
-rw-r--r--trans/ifsock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/trans/ifsock.c b/trans/ifsock.c
index 4ed65898..af2376aa 100644
--- a/trans/ifsock.c
+++ b/trans/ifsock.c
@@ -143,7 +143,7 @@ S_ifsock_getsockaddr (struct trivfs_protid *cred,
return EOPNOTSUPP;
err = file_check_access (cred->realnode, &perms);
- if (!err && !(perms & O_READ))
+ if (!err && !(perms & O_WRITE))
err = EACCES;
if (!err)