From 5bf22b2c4a2b3a98137df370fcb9c44acddc7113 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 23 Nov 2011 14:14:59 +0100 Subject: [PATCH] ramfs doesn't allow opening files as directories. --- sortix/fs/ramfs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sortix/fs/ramfs.cpp b/sortix/fs/ramfs.cpp index b3e36401..cd4c8602 100644 --- a/sortix/fs/ramfs.cpp +++ b/sortix/fs/ramfs.cpp @@ -250,6 +250,8 @@ namespace Sortix return NULL; } + if ( (flags & O_LOWERFLAGS) == O_SEARCH ) { Error::Set(ENOTDIR); return NULL; } + DevBuffer* file = OpenFile(path, flags, mode); if ( !file ) { return NULL; } Device* wrapper = new DevFileWrapper(file, flags);