Commit graph

536 commits

Author SHA1 Message Date
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
Sergey Bugaev
1a55264fe6 Userland: Support comments and blank lines in /etc/fstab 2020-01-12 20:02:11 +01:00
Andreas Kling
a27d2b7b32 chmod: Use pledge() 2020-01-12 13:25:02 +01:00
0xtechnobabble
e12798c0a9 chown: Use pledge() 2020-01-12 12:55:20 +01:00
0xtechnobabble
f501014fae Userland: Add the chgrp command
The chgrp command allows the user to easily modify a file's group while
leaving its owner unchanged.
2020-01-12 12:55:20 +01:00
0xtechnobabble
954daaa916 Userland: Add named gid/uid args parsing
This patch makes it so that if a user provides a groupname/username
instead of an id, chown will automatically convert it to a gid/uid
using getgrnam() or getpwnam() respectively.
2020-01-12 12:55:20 +01:00
Andreas Kling
e131a401e8 cat: Use pledge() 2020-01-11 21:33:12 +01:00
Andreas Kling
8c2009c5be host: Use pledge() 2020-01-11 20:49:31 +01:00
Andreas Kling
d30d3fac6f id: Use pledge() 2020-01-11 20:49:25 +01:00
Andreas Kling
409a4f7756 ping: Use pledge() 2020-01-11 20:48:43 +01:00
Sergey Bugaev
a9e6f4a2cd Userland: Support mount flags 2020-01-11 18:57:53 +01:00
Sergey Bugaev
4566c2d811 Kernel+LibC: Add support for mount flags
At the moment, the actual flags are ignored, but we correctly propagate them all
the way from the original mount() syscall to each custody that resides on the
mounted FS.
2020-01-11 18:57:53 +01:00
Andreas Kling
73788d7305 ls: Cache the user and group names instead of looking up every time 2020-01-11 13:30:17 +01:00
Andreas Kling
3f9e4cd24e chroot: Add a little chroot program
This program changes the current filesystem root and spawns a shell.
2020-01-10 23:23:20 +01:00
Andreas Kling
b1ffde6199 Kernel: unlink() should not follow symlinks 2020-01-10 14:07:36 +01:00
Andreas Kling
f026f0f4bb rm: When invoked on a symlink, remove the symlink itself 2020-01-10 14:02:52 +01:00
Andreas Kling
41d5f5c3b5 ls: Widen the user and group fields a little bit
I didn't like looking at /tmp/portal now that lookup:lookup owns one
of the sockets there :^)
2020-01-09 21:43:21 +01:00
Andreas Kling
6c549959c6 disk_benchmark: Unbreak this utility now that read() of O_WRONLY fails 2020-01-08 21:12:40 +01:00
Andreas Kling
e1d4b19461 Kernel: open() and openat() should ignore non-permission bits in mode 2020-01-08 15:21:06 +01:00