Commit graph

18 commits

Author SHA1 Message Date
Andreas Kling
7eeea4d57f Kernel: rmdir("/") should fail instead of asserting
We can't assume there's always a parent custody -- when we open "/"
there isn't gonna be one!

Fixes #1858.
2020-04-19 18:07:16 +02:00
Andreas Kling
4c19305a17 test_io: Unbreak symlink test after sys$readlink() '\0' changes 2020-04-19 18:07:09 +02:00
Andreas Kling
c64904a483 Kernel: sys$readlink() should return the number of bytes written out 2020-01-27 21:50:51 +01:00
Andreas Kling
b011857e4f Kernel: Make writev() work again
Vector::ensure_capacity() makes sure the underlying vector buffer can
contain all the data, but it doesn't update the Vector::size().

As a result, writev() would simply collect all the buffers to write,
and then do nothing.
2020-01-26 10:10:15 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Andreas Kling
d4d17ce423 Kernel: Trying to sys$link() a directory should fail with EPERM 2020-01-15 22:11:44 +01:00
Andreas Kling
9e54c7c17f Ext2FS: Don't allow creating new files in removed directories
Also don't uncache inodes when they reach i_links_count==0 unless they
also have no ref counts other than the +1 from the inode cache.
This prevents the FS from deleting the on-disk inode too soon.
2020-01-15 22:11:44 +01:00
Andreas Kling
0c44a12247 Kernel: read() and write() should EOVERFLOW if (offset+size) overflows 2020-01-12 20:20:17 +01:00
Andreas Kling
b1ffde6199 Kernel: unlink() should not follow symlinks 2020-01-10 14:07:36 +01:00
Andreas Kling
e1d4b19461 Kernel: open() and openat() should ignore non-permission bits in mode 2020-01-08 15:21:06 +01:00
Andreas Kling
fe1bf067b8 ProcFS: Reads past the end of a generated file should be zero-length 2020-01-08 12:59:06 +01:00
Andreas Kling
28ee5b0e98 TmpFS: Reads past the end of a file should be zero-length 2020-01-08 12:47:41 +01:00
Andreas Kling
50056d1d84 Kernel: mmap() should fail with ENODEV for directories 2020-01-08 12:47:37 +01:00
Andreas Kling
6a4b376021 Kernel: Validate ftruncate(fd, length) syscall inputs
- EINVAL if 'length' is negative
- EBADF if 'fd' is not open for writing
2020-01-07 14:48:43 +01:00
Andreas Kling
bbedad1197 test_io: Test that seeking past EOF and then reading returns 0 2020-01-03 04:03:52 +01:00
Andreas Kling
93e9a42bf0 test_io: Verify that write() on an O_RDONLY fd fails with EBADF 2020-01-03 03:36:17 +01:00
Andreas Kling
c19f840f32 test_io: Verify that read() on an O_WRONLY fd fails with EBADF 2020-01-03 03:34:06 +01:00
Andreas Kling
2da3edb3d0 test_io: Add a simple test program that abuses some I/O syscalls
This exposes some very bad behaviors that will need fixing.
2020-01-03 03:18:49 +01:00