From bfb254ed14e21e6d8b879afc5c7246c1cc768c8d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 23 Jan 2021 16:39:31 +0100 Subject: [PATCH] Ext2FS: Assert that create_directory() is called with valid mode --- Kernel/FileSystem/Ext2FileSystem.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index ad761c79d0..505046f4a9 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -1439,11 +1439,7 @@ KResult Ext2FS::create_directory(InodeIdentifier parent_id, const String& name, { LOCKER(m_lock); ASSERT(parent_id.fsid() == fsid()); - - // Fix up the mode to definitely be a directory. - // FIXME: This is a bit on the hackish side. - mode &= ~0170000; - mode |= 0040000; + ASSERT(is_directory(mode)); // NOTE: When creating a new directory, make the size 1 block. // There's probably a better strategy here, but this works for now.