mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:54:57 +00:00
Ext2FS: Don't create a directory when asked to create a socket file
(mode & S_IFDIR) is not enough to check if "mode" is a directory, we have to check all the bits in the S_IFMT mask. Use the is_directory() helper to fix this bug.
This commit is contained in:
parent
86a9e26996
commit
f2ea6c3d4c
1 changed files with 1 additions and 1 deletions
|
@ -1043,7 +1043,7 @@ bool Ext2FSInode::write_directory(const Vector<Ext2FSDirectoryEntry>& entries)
|
|||
|
||||
KResultOr<NonnullRefPtr<Inode>> Ext2FSInode::create_child(const String& name, mode_t mode, dev_t dev, uid_t uid, gid_t gid)
|
||||
{
|
||||
if (mode & S_IFDIR)
|
||||
if (::is_directory(mode))
|
||||
return fs().create_directory(identifier(), name, mode, uid, gid);
|
||||
return fs().create_inode(identifier(), name, mode, 0, dev, uid, gid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue