From aa46af68880038694a2efc7bf0fa8949abb6c4a1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 12 May 2002 19:55:41 +0000 Subject: 2002-05-12 Roland McGrath * fakeroot.c (netfs_attempt_lookup): Treat EOPNOTSUPP like EACCES. When all modes fail, try opening the node with zero openmodes. --- trans/fakeroot.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'trans') diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 51536b34..93435f5d 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -336,23 +336,30 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir, flags = O_RDWR|O_EXEC; file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); - if (file == MACH_PORT_NULL && (errno == EACCES + if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP || errno == EROFS || errno == EISDIR)) { flags = O_RDWR; file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); } - if (file == MACH_PORT_NULL && (errno == EACCES + if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP || errno == EROFS || errno == EISDIR)) { flags = O_READ|O_EXEC; file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); } - if (file == MACH_PORT_NULL && errno == EACCES) + if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP + || errno == EISDIR)) { flags = O_READ; file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); } + if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP + || errno == EISDIR)) + { + flags = 0; + file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); + } *np = 0; if (file == MACH_PORT_NULL) err = errno; -- cgit v1.2.3