Commit Graph

554 Commits

Author SHA1 Message Date
Andreas Kling
8f7333f080 LibCore: Add a forward declaration header
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
2020-02-14 23:31:18 +01:00
Andreas Kling
3bbf4610d2 AK: Add a forward declaration header
You can now #include <AK/Forward.h> to get most of the AK types as
forward declarations.

Header dependency explosion is one of the main contributors to compile
times at the moment, so this is a step towards smaller include graphs.
2020-02-14 23:31:18 +01:00
Shannon Booth
8249e666fc Userland: Fix typos in setting user id
Fixes: #1219
2020-02-14 23:30:22 +01:00
Shannon Booth
1f75dfd95d Userland: Fix error handling in rm program
Fixes: #1218
2020-02-14 23:30:22 +01:00
Andreas Kling
e22283e5e6 Userland: Use Core::DateTime 2020-02-11 20:43:29 +01:00
Andreas Kling
a1e7064937 gron: Use pledge() 2020-02-11 12:42:06 +01:00
Andreas Kling
05e772d276 jp: Use pledge() 2020-02-11 12:16:07 +01:00
William McPherson
d55d2b2794 LibAudio/aplay: Handle WAV header errors properly
We shouldn't just ASSERT() if the header parse fails. This was crashing
Piano completely.
2020-02-10 14:04:27 +01:00
William McPherson
c8eaae3eaf Userland: Fix segfault in chown
chown takes 2 arguments, not 1.
2020-02-10 11:11:29 +01:00
Liav A
88cf46dc98 Userland: Use IO helpers from LibBareMetal 2020-02-09 19:38:17 +01:00
Andreas Kling
8325662186 more: Read keystrokes from stdout instead of trying to re-open it
If we're running more on a TTY that we don't have filesystem access to,
we can't rely on open(ttyname(STDOUT_FILENO)). Since all the stdio fd's
are opened read/write anyway, we can just read from stdout, even if it
feels a bit weird. :^)
2020-02-08 15:50:00 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Andreas Kling
97edc82a26 LibAudio: Remove leading A from filenames 2020-02-06 15:18:03 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling
9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
Andreas Kling
11580babbf LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really
wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename
the library to LibGfx. :^)
2020-02-06 11:56:38 +01:00
Andreas Kling
92f77864de LibAudio: Put all classes in the Audio namespace and remove leading A 2020-02-06 10:40:02 +01:00
Andreas Kling
5b7924b9e7 LibProtocol: Rename namespace LibProtocol => Protocol 2020-02-05 19:13:44 +01:00
Andreas Kling
c5bd9d4ed1 LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02 15:15:33 +01:00
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Jesse Buhagiar
f9609fe08a Userland: useradd utility
This commit implements the `useradd` utility that is found on most,
if not all *NIX systems. It allows the root user to add new users
to the password file found in `/etc/passwd`, thereby making
it easier to manipulate the file.
2020-02-02 10:58:45 +01:00
Andreas Kling
a27c5d2fb7 Kernel: Fail with EFAULT for any address+size that would wrap around
Previously we were only checking that each of the virtual pages in the
specified range were valid.

This made it possible to pass in negative buffer sizes to some syscalls
as long as (address) and (address+size) were on the same page.
2020-01-29 12:56:07 +01:00
Sergey Bugaev
f983dfe319 Userland+Terminal: Port to new CArgsParser API
While at it, also add some niceties and fix some things.
2020-01-28 13:50:18 +01: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
a7b984ec49 sleep: Use pledge() 2020-01-27 21:39:35 +01:00
Andreas Kling
8f6dc3e9a0 mknod: Use pledge() 2020-01-27 21:38:36 +01:00
Andreas Kling
23ffd6c319 Kernel+LibC+Userland: Switch to 64-bit time_t
Let's not have that 2038 problem people are talking about. :^)
2020-01-27 10:59:29 +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
Sergey Bugaev
c0b32f7b76 Meta: Claim copyright for files created by me
This changes copyright holder to myself for the source code files that I've
created or have (almost) completely rewritten. Not included are the files
that were significantly changed by others even though it was me who originally
created them (think HtmlView), or the many other files I've contributed code to.
2020-01-24 15:15:16 +01:00
Brian Gianforcaro
cf151fa0e1 rpcdump: Use pledge() and unveil() 2020-01-23 10:22:54 +01:00
Brian Gianforcaro
e3e22cd42e lspci: Use pledge() and unveil() 2020-01-23 09:51:45 +01:00
Brian Gianforcaro
ce6864dd79 man: Use unveil() 2020-01-22 11:40:41 +01:00
Brian Gianforcaro
319cb28452 dmesg: Use pledge() and unveil() 2020-01-22 11:40:22 +01:00
Andreas Kling
cec0268ffa id: Use unveil()
And so "id" becomes our first user of unveil(), giving himself access
to read /etc/passwd and /etc/group :^)
2020-01-20 22:21:41 +01:00
Andreas Kling
e711936c78 Userland: Add a dummy passthrough "flock" program
This allows you to run our build system's Makefiles inside SerenityOS
itself (since they rely on "flock")

Obviously it doesn't do any locking as we don't support that yet.
2020-01-20 20:44:29 +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
Sergey Bugaev
cf04de188e Userland: Print which path we failed to ls 2020-01-17 21:49:58 +01:00
rhin123
0f3880ec4a Userland: Stop id command accepting -n in default format 2020-01-17 09:39:11 +01:00
joshua stein
d7e8431cdb Userland/ls: escape non-printable characters
Fixes #1044
2020-01-15 23:13:15 +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
ad5ee27ea9 mv: Use pledge() 2020-01-13 14:51:35 +01:00
Andreas Kling
8ccc2b25c2 cp: Use pledge() 2020-01-13 14:51:18 +01:00
Brian Gianforcaro
1915151116 man: Use pledge() 2020-01-13 11:04:35 +01:00
Brian Gianforcaro
f7148c766a more: Use pledge() 2020-01-13 11:04:35 +01:00
Brian Gianforcaro
e45a4b0931 md: Use pledge() 2020-01-13 11:04:35 +01:00
Brian Gianforcaro
a77da7f245 ls: Use pledge() 2020-01-13 11:04:35 +01:00
Brian Gianforcaro
70defb34e6 tail: Use pledge() 2020-01-13 11:04:35 +01:00
Andreas Kling
0c44a12247 Kernel: read() and write() should EOVERFLOW if (offset+size) overflows 2020-01-12 20:20:17 +01:00
Sergey Bugaev
8ca6e63119 Userland: Support custom programs and mount options in chroot 2020-01-12 20:02:11 +01:00