Commit graph

40277 commits

Author SHA1 Message Date
Roberto Bampi
1c52ca9693 PixelPaint: Push layer creation onto the undo stack
Before this change, creating a layer, painting something on it and
undoing would delete the layer as well as the paint on it.
2022-08-22 12:49:11 +02:00
Jannis Weis
8fa34b43ce HexEditor: Fix utf16 validation
Previously the utf8_view was validated for the utf16 valude instead
of the utf16_view.
2022-08-22 12:48:47 +02:00
Jannis Weis
32205495e6 LibGUI: Clear selected index of Breadcrumbbar if segment is removed
If the segment corresponding to the selected index is removed the index
is no longer valid.
2022-08-22 12:48:11 +02:00
Jannis Weis
3911758277 FileManager: Disable open_child_directory_action if no child exists 2022-08-22 12:48:11 +02:00
Jannis Weis
8b395ffcc5 FileManager: Respond to all selection changes in the Breadcrumbbar
Use Breadcrumbbars on_segment_change instead of on_segment_click.
This allows us to remove the manual handler invokation in the
open_child_directory_action
2022-08-22 12:48:11 +02:00
Jannis Weis
a00fa793b3 LibGUI: Add on_segment_change handler to Breadcrumbbar
This allows programs to respond to any selection changes of the
Breadcrumbbar, not just ones made by clicking one of the buttons.
2022-08-22 12:48:11 +02:00
Anthony Iacono
f86b671de2 Kernel: Use Process::credentials() and remove user ID/group ID helpers
Move away from using the group ID/user ID helpers in the process to
allow for us to take advantage of the immutable credentials instead.
2022-08-22 12:46:32 +02:00
Skye Sprung
8026d8926c Documentation: Change spelling error in CLionConfiguration.md
Change "want exclude" to "want to exclude"
2022-08-22 08:48:29 +01:00
Xexxa
0335829e71 Base: Add more emoji
> #️⃣ - U+23 U+FE0F U+20E3 Keycap Number Sign
*️⃣ - U+2A U+FE0F U+20E3 Keycap Asterisk
0️⃣ - U+30 U+FE0F U+20E3 Keycap Digit Zero
1️⃣ - U+31 U+FE0F U+20E3 Keycap Digit One
2️⃣ - U+32 U+FE0F U+20E3 Keycap Digit Two
3️⃣ - U+33 U+FE0F U+20E3 Keycap Digit Three
4️⃣ - U+34 U+FE0F U+20E3 Keycap Digit Four
5️⃣ - U+35 U+FE0F U+20E3 Keycap Digit Five
6️⃣ - U+36 U+FE0F U+20E3 Keycap Digit Six
7️⃣ - U+37 U+FE0F U+20E3 Keycap Digit Seven
8️⃣ - U+38 U+FE0F U+20E3 Keycap Digit Eight
9️⃣ - U+39 U+FE0F U+20E3 Keycap Digit Nine
🇨🇲 - U+1F1E8 U+1F1F2 CM Cameroon
🇳🇵 - U+1F1F3 U+1F1F5 NP Nepal
🇲🇲 - U+1F1F2 U+1F1F2 MM Myanmar (Burma)
🇧🇧 - U+1F1E7 U+1F1E7 BB Barbados
🇬🇼 - U+1F1EC U+1F1FC GW Guinea-Bissau
🇹🇬 - U+1F1F9 U+1F1EC TG Togo
🇸🇴 - U+1F1F8 U+1F1F4 SO Somalia
🇦🇼 - U+1F1E6 U+1F1FC AW Aruba
💈 - U+1F488 Barber Pole
📯 - U+1F4EF Postal Horn
🥫 - U+1F96B Canned Food
🪓 - U+1FA93 Axe
🧀 - U+1F9C0 Cheese Wedge
 - U+2614 Umbrella with Rain Drops
🧨 - U+1F9E8 Firecracker
⛸️ - U+26F8 U+FE0F Ice Skate
🪧 - U+1FAA7 Placard
🇯🇪 - U+1F1EF U+1F1EA JE Jersey
🪨 - U+1FAA8 Rock
📮 - U+1F4EE Postbox
🇻🇨 - U+1F1FB U+1F1E8 VC St. Vincent & Grenadines
2022-08-22 08:43:06 +01:00
Ryan Liptak
221d9089e9 Meta: Generate emoji.txt at build time from Unicode's emoji-test.txt
Instead of manually updating emoji.txt whenever new emoji are added,
we use Unicode's emoji-test.txt to generate emoji.txt on each build,
including only the emojis that Serenity supports at that time.

By using emoji-test.txt, we can also include all forms of each emoji
(fully-qualified, minimally-qualified, and unqualified) which can be
helpful when double-checking how certain forms are handled.
2022-08-22 08:42:54 +01:00
Ryan Liptak
8f4317e207 Base: Move Serenity-specific emoji from emoji.txt to emoji-serenity.txt 2022-08-22 08:42:54 +01:00
Andreas Kling
bf25b0a0b5 PixelPaint: Show more specific Undo/Redo action text
The Undo/Redo actions now tell you what kind of action will be
undone/redone. This is achieved by adding an "action text" field to the
ImageUndoCommand and having everyone who calls did_complete_action()
provide this text.
2022-08-21 20:33:03 +02:00
Andreas Kling
101eb53de5 PixelPaint: Add Tool::tool_name() as a single-point-of-truth
Let the tools know what their names are.
2022-08-21 20:33:01 +02:00
Andreas Kling
c45f99f735 PixelPaint: Make Filter::filter_name() const 2022-08-21 20:19:59 +02:00
Andreas Kling
17687435ca WindowServer: Redraw menu items after client updates them somehow
This fixes an issue where the undo/redo actions in TextEditor only
updated once you hovered over them.
2022-08-21 20:04:33 +02:00
Andreas Kling
42435ce5e4 Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy
Instead of temporary changing the open file description's "blocking"
flag while doing a non-waiting recvfrom, we instead plumb the currently
wanted blocking behavior all the way through to the underlying socket.
2022-08-21 16:45:42 +02:00
Andreas Kling
8997c6a4d1 Kernel: Make Socket::connect() take credentials as input 2022-08-21 16:35:03 +02:00
Andreas Kling
51318d51a4 Kernel: Make Socket::bind() take credentials as input 2022-08-21 16:33:09 +02:00
Andreas Kling
8d0bd3f225 Kernel: Make LocalSocket do chown/chmod through VFS
This ensures that all the permissions checks are made against the
provided credentials. Previously we were just calling through directly
to the inode setters, which did no security checks!
2022-08-21 16:22:34 +02:00
Andreas Kling
dbe182f1c6 Kernel: Make Inode::resolve_as_link() take credentials as input 2022-08-21 16:17:13 +02:00
Andreas Kling
006f753647 Kernel: Make File::{chown,chmod} take credentials as input
...instead of getting them from Process::current(). :^)
2022-08-21 16:15:29 +02:00
Andreas Kling
c3351d4b9f Kernel: Make VirtualFileSystem functions take credentials as input
Instead of getting credentials from Process::current(), we now require
that they be provided as input to the various VFS functions.

This ensures that an atomic set of credentials is used throughout an
entire VFS operation.
2022-08-21 16:02:24 +02:00
James Bellamy
9744dedb50 Kernel: Use credentials object in Socket set_origin/acceptor 2022-08-21 14:55:01 +02:00
James Bellamy
2686640baf Kernel: Use credentials object in LocalSocket constructor 2022-08-21 14:55:01 +02:00
James Bellamy
386642ffcf Kernel: Use credentials object in VirtualFileSystem
Use credentials object in mknod, create, mkdir, and symlink
2022-08-21 14:55:01 +02:00
James Bellamy
8ef5dbed21 Kernel: Use credentials object in Coredump:try_create_target_file 2022-08-21 14:55:01 +02:00
MacDue
78813313f9 PixelPaint: Fix tool preview positions after moving a layer
Previously the tool previews did not account for the position of
the layer, so would be drawn in the wrong location if the layer was
not at 0,0.
2022-08-21 14:13:08 +02:00
MacDue
973771f8f4 PixelPaint: Make outline ellipse the same size as other ellipses
The non-AA outline ellipse was drawn outside the bounding rectangle
unlike all other ellipses. This commit now scales it to match the
size of the other ellipse drawing modes (AA, filled, etc).
2022-08-21 14:13:08 +02:00
Andreas Kling
18abba2c4d Kernel: Make sys$getppid() not take the big lock
This only needs to access the process PPID, which is protected by the
"protected data" lock.
2022-08-21 13:29:36 +02:00
Andreas Kling
8ed06ad814 Kernel: Guard Process "protected data" with a spinlock
This ensures that both mutable and immutable access to the protected
data of a process is serialized.

Note that there may still be multiple TOCTOU issues around this, as we
have a bunch of convenience accessors that make it easy to introduce
them. We'll need to audit those as well.
2022-08-21 12:25:14 +02:00
Andreas Kling
728c3fbd14 Kernel: Use RefPtr instead of LockRefPtr for Custody
By protecting all the RefPtr<Custody> objects that may be accessed from
multiple threads at the same time (with spinlocks), we remove the need
for using LockRefPtr<Custody> (which is basically a RefPtr with a
built-in spinlock.)
2022-08-21 12:25:14 +02:00
Liav A
5331d243c6 Kernel/Syscall: Make anon_create to not use Process::allocate_fd method
Instead, allocate when acquiring the lock on m_fds struct, which is
safer to do in terms of safely mutating the m_fds struct, because we
don't use the big process lock in this syscall.
2022-08-21 10:56:48 +01:00
Liav A
0eaee045cf SystemMonitor: Don't unveil /boot/Kernel.debug if it does not exist
If the user decided for some reason to not include Kernel debug symbols
in the disk image, let's not try to unveil it.
2022-08-21 10:54:40 +01:00
djwisdom
66489ba4ad Base: Update Chillychilly theme use calming background 2022-08-21 10:53:25 +01:00
Luke Wilde
5ebf444199 LibWeb: Make window.performance replaceable and configurable
Required by Discord, which polyfills it by taking the existing native
object, polyfilling missing functions and setting window.performance to
it.

This is a hard requirement as this is done in strict mode with no
try/catch and thus causes their JavaScript to stop progressing.
2022-08-21 00:01:23 +01:00
davidot
ae349ec6a8 LibJS: Use a synthetic constructor if class with parent doesn't have one
We already did this but it called the @@iterator method of
%Array.prototype% visible to the user for example by overriding that
method. This should not be visible so we use a special version of
SuperCall now.
2022-08-20 23:53:55 +01:00
davidot
b79f03182d LibJS: Add special cases for Math.cosh and add spec comments
Although this already works in most cases in non-kvm serenity cases the
cosh and other math function tend to return incorrect values for
Infinity. This makes sure that whatever the underlying cosh function
returns Math.cosh conforms to the spec.
2022-08-20 23:53:55 +01:00
Ryan Liptak
379baa984d LibGfx: Always lookup emojis without emoji presentation specifiers
This allows us to treat unqualified, minimally-qualified, and
fully-qualified emojis the same as long as emoji filenames are in their
least qualified form (with respect to emoji presentation).

For example, the transgender flag emoji has 4 possible forms:

    1F3F3 FE0F 200D 26A7 FE0F ; fully-qualified  # 🏳️‍⚧️
    1F3F3 200D 26A7 FE0F      ; unqualified      # 🏳‍⚧️
    1F3F3 FE0F 200D 26A7      ; unqualified      # 🏳️‍⚧
    1F3F3 200D 26A7           ; unqualified      # 🏳‍⚧

In order to treat them all as the same, we now drop all forms down
to 1F3F3 200D 26A7 (skipping any FE0F codepoints) and then do the
lookup for that form.
2022-08-20 23:50:41 +01:00
Ryan Liptak
f64f5e79a8 Base: Fix all emoji filenames according to check-emoji rules 2022-08-20 23:50:41 +01:00
Ryan Liptak
68ff0a7d13 Meta: Add check-emoji script to validate emoji filenames
Verifies that emoji filenames:
- Contain only uppercase letters, numbers, +, and _
- Use _ and a separator between codepoints, not +
- Do not include the U+FE0F emoji presentation specifier
2022-08-20 23:50:41 +01:00
Andreas Kling
619ac65302 Kernel: Get GID from credentials object in sys$setgroups()
I missed one instance of these. Thanks Anthony Iacono for spotting it!
2022-08-20 22:41:49 +02:00
Andreas Kling
9eeee24a39 Kernel+LibC: Enforce a limit on the number of supplementary group IDs
This patch adds the NGROUPS_MAX constant and enforces it in
sys$setgroups() to ensure that no process has more than 32 supplementary
group IDs.

The number doesn't mean anything in particular, just had to pick a
number. Perhaps one day we'll have a reason to change it.
2022-08-20 22:39:56 +02:00
Andreas Kling
998c1152ef Kernel: Mark syscalls that get/set user/group ID as not needing big lock
Now that these operate on the neatly atomic and immutable Credentials
object, they should no longer require the process big lock for
synchronization. :^)
2022-08-20 18:36:47 +02:00
Andreas Kling
122d7d9533 Kernel: Add Credentials to hold a set of user and group IDs
This patch adds a new object to hold a Process's user credentials:

- UID, EUID, SUID
- GID, EGID, SGID, extra GIDs

Credentials are immutable and child processes initially inherit the
Credentials object from their parent.

Whenever a process changes one or more of its user/group IDs, a new
Credentials object is constructed.

Any code that wants to inspect and act on a set of credentials can now
do so without worrying about data races.
2022-08-20 18:32:50 +02:00
Andreas Kling
bec314611d Kernel: Move InodeMetadata methods out of line 2022-08-20 17:20:44 +02:00
Andreas Kling
11eee67b85 Kernel: Make self-contained locking smart pointers their own classes
Until now, our kernel has reimplemented a number of AK classes to
provide automatic internal locking:

- RefPtr
- NonnullRefPtr
- WeakPtr
- Weakable

This patch renames the Kernel classes so that they can coexist with
the original AK classes:

- RefPtr => LockRefPtr
- NonnullRefPtr => NonnullLockRefPtr
- WeakPtr => LockWeakPtr
- Weakable => LockWeakable

The goal here is to eventually get rid of the Lock* classes in favor of
using external locking.
2022-08-20 17:20:43 +02:00
Andreas Kling
e475263113 AK+Kernel: Add AK::AtomicRefCounted and use everywhere in the kernel
Instead of having two separate implementations of AK::RefCounted, one
for userspace and one for kernelspace, there is now RefCounted and
AtomicRefCounted.
2022-08-20 17:15:52 +02:00
Tim Schumacher
4889eb019a strace: Pledge rpath for searching binaries
After commit 91a03bc6ae we no longer try
to discover files for exec-ing by simply trying to exec on them, but we
check for the files existence by using `Core::file::exists()` first.

Contrary to the old solution, this now requires the `rpath` pledge, so
pledge it to keep `strace` from crashing when using non-absolute paths.
2022-08-20 12:28:46 +02:00
Ryan Liptak
548c23ded3 Base: Add 10 new (mostly weather-related) emojis
☀️ - U+2600 U+FE0F SUN
☁️ - U+2601 U+FE0F CLOUD
🌤️ - U+1F324 U+FE0F SUN BEHIND SMALL CLOUD
🌥️ - U+1F325 U+FE0F SUN BEHIND LARGE CLOUD
🌦️ - U+1F326 U+FE0F SUN BEHIND RAIN CLOUD
🌧️ - U+1F327 U+FE0F CLOUD WITH RAIN
🌨️ - U+1F328 U+FE0F CLOUD WITH SNOW
🌩️ - U+1F329 U+FE0F CLOUD WITH LIGHTNING
💯 - U+1F4AF HUNDRED POINTS
🫧 - U+1FAE7 BUBBLES
2022-08-20 09:11:21 +01:00
Liav A
00e59e8ab7 Kernel: Annotate SpinlockProtected<PacketList> in NetworkAdapter class 2022-08-19 23:50:28 -07:00