mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +00:00
Kernel: Strip SUID+SGID bits from file when written to or chowned
Fixes #1624.
This commit is contained in:
parent
040ba77d44
commit
53d0ca2ad8
Notes:
sideshowbarker
2024-07-19 07:56:12 +09:00
Author: https://github.com/awesomekling
Commit: 53d0ca2ad8
6 changed files with 36 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue