mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
Kernel: Strip SUID+SGID bits from file when written to or chowned
Fixes #1624.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 07:56:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/53d0ca2ad8a
@@ -760,6 +760,10 @@ ssize_t Ext2FSInode::write_bytes(off_t offset, ssize_t count, const u8* data, Fi
|
||||
Locker inode_locker(m_lock);
|
||||
Locker fs_locker(fs().m_lock);
|
||||
|
||||
auto result = prepare_to_write_data();
|
||||
if (result.is_error())
|
||||
return result;
|
||||
|
||||
if (is_symlink()) {
|
||||
ASSERT(offset == 0);
|
||||
if (max((size_t)(offset + count), (size_t)m_raw_inode.i_size) < max_inline_symlink_length) {
|
||||
|
||||
Reference in New Issue
Block a user