summaryrefslogtreecommitdiff
path: root/Userland/Services/SpiceAgent
AgeCommit message (Collapse)Author
2023-06-03SpiceAgent: Exit early if `SPICE_DEVICE` doesn't existCaoimhe
2023-06-03SpiceAgent: Don't pledge `cpath` or open SPICE_DEVICE as `rwc`Caoimhe
Core::File's new `DontCreate` open mode removes the need for these capabilities on SpiceAgent. We shouldn't have to create this file, as if it doesn't exist, QEMU never initiated a spice connection!
2023-05-23SpiceAgent: Don't send ClipboardGrab if the shared clipboard is disabledCaoimhe
The spice server will ignore any clipboard-related messages if we don't have the appropriate capabilities, but I think it's better for us to do less CPU churning whenever the user copies something to their clipboard. It also stops the spice server from warning in the console about a clipboard grab message being recieved when the capability was never announced.
2023-05-22SpiceAgent: Gracefully exit when the Spice server disconnectsTimothy Flynn
2023-05-22SpiceAgent: Reduce copying of potentially large byte buffersTimothy Flynn
This moves buffers around instead of implicitly copying them, and marks the message types that hold these buffers as move-only.
2023-05-21SpiceAgent: Handle file transfer requests properly :^)Caoimhe
Now, we write the data recieved to a file when the user drags a file onto the Spice Viewer window. Once complete, the FileExplorer will open with the copied file highlighted.
2023-05-21SpiceAgent: Implement `FileTransferData` messagesCaoimhe
2023-05-21SpiceAgent: Implement `FileTransferStatus` messagesCaoimhe
2023-05-21SpiceAgent: Implement `FileTransferStart` messagesCaoimhe
2023-05-21SpiceAgent: Implement sending clipboard data to the spice serverCaoimhe
2023-05-21SpiceAgent: Add support for copying images to the clipboardCaoimhe
2023-05-21SpiceAgent: Add support for reading chunks larger than 2048 bytesCaoimhe
2023-05-21SpiceAgent: Implement setting the user's clipboard contents for textCaoimhe
We also now use GUI::Clipboard for setting the clipboard contents, instead of using a custom connection to the Clipboard server.
2023-05-21SpiceAgent: Implement `ClipboardRequest` messagesCaoimhe
2023-05-21SpiceAgent: Implement `ClipboardGrab` messagesCaoimhe
2023-05-21SpiceAgent: Let's start rewriting the messaging system :^)Caoimhe
The old message system was very dependent on syscalls, and the overall structure made it hard to implement new features. The new message system is pretty expandible, where each message has its own dedicated class. As well as this, we now use Core::File and AK::Stream for reading and writing messages. Using AK::Stream also allows us to change the actual data source (in this case, Core::File) without having to update a whole lot of code in the future.
2023-05-21SpiceAgent: Minor formatting changesCaoimhe
2023-05-21SpiceAgent: Use `ErrorOr<T>` for `on_message_received`Caoimhe
2023-05-21Clipboard: Avoid unnecessary IPC::Dictionary wrapperBen Wiederhake
We already have and use HashMap<DeprecatedString, DeprecatedString> nearly everywhere, which is equivalent.
2023-05-19LibIPC: Explicitly mark HashMap copy, offer move interfaceBen Wiederhake
2023-05-13SpiceAgent: Gracefully handle the host clearing the clipboardDaniel Bertalan
When the host clears the clipboard (e.g. by running `pbcopy </dev/null`) the Spice server sends an empty string to us. Previously, we would crash as `AnonymousBuffer::create_with_size` doesn't accept a size of 0. Fix this by passing `{}` to `async_set_clipboard_data` in this case.
2023-05-12LibGfx+Fuzz: Convert ImageDecoder::initialize to ErrorOrBen Wiederhake
This prevents callers from accidentally discarding the result of initialize(), which was the root cause of this OSS Fuzz bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55896&q=label%3AProj-serenity&sort=summary
2023-04-25LibCore: Simplify Core::Notifier by only allowing one event typeAndreas Kling
Not a single client of this API actually used the event mask feature to listen for readability AND writability. Let's simplify the API and have only one hook: on_activation.
2023-03-21LibGfx: Move all image loaders and writers to a subdirectoryLucas CHOLLET
2023-03-12SpiceAgent: Remove unused BMPWriter.h includeNico Weber
2023-02-26LibGfx: Return bool not ErrorOr<bool> from ImageDecoderPlugin::sniff()MacDue
Nobody made use of the ErrorOr return value and it just added more chance of confusion, since it was not clear if failing to sniff an image should return an error or false. The answer was false, if you returned Error you'd crash the ImageDecoder.
2023-02-18SpiceAgent: Rename `ClipboardType::JPG` to `ClipboardType::JPEG`Lucas CHOLLET
2023-02-18LibGfx: Rename `JPGLoader` to `JPEGLoader`Lucas CHOLLET
The patch also contains modifications on several classes, functions or files that are related to the `JPGLoader`. Renaming include: - JPGLoader{.h, .cpp} - JPGImageDecoderPlugin - JPGLoadingContext - JPG_DEBUG - decode_jpg - FuzzJPGLoader.cpp - Few string literals or texts
2023-02-13LibCore: Move Stream-based sockets into the `Core` namespaceTim Schumacher
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-20LibGfx: Re-structure the whole initialization pattern for image decodersLiav A
When trying to figure out the correct implementation, we now have a very strong distinction on plugins that are well suited for sniffing, and plugins that need a MIME type to be chosen. Instead of having multiple calls to non-static virtual sniff methods for each Image decoding plugin, we have 2 static methods for each implementation: 1. The sniff method, which in contrast to the old method, gets a ReadonlyBytes parameter and ensures we can figure out the result with zero heap allocations for most implementations. 2. The create method, which just creates a new instance so we don't expose the constructor to everyone anymore. In addition to that, we have a new virtual method called initialize, which has a per-implementation initialization pattern to actually ensure each implementation can construct a decoder object, and then have a correct context being applied to it for the actual decoding.
2023-01-13Userland: Remove a bunch of unveil calls on /sys/kernel/processesLiav A
These are not needed anymore since the introduction of the new get_root_session_id syscall.
2023-01-07Everywhere: Remove "LibC/" includes, add lint-rule against itBen Wiederhake
2022-12-08LibGfx+Userland: Make PNGWriter::encode() return ErrorOr<ByteBuffer>Andreas Kling
This is a first step towards handling PNG encoding failures instead of just falling over and crashing the program. This initial step will cause encode() to return an error if the final ByteBuffer copy fails to allocate. There are more potential failures that will be surfaced by subsequent commits. Two FIXMEs were killed in the making of this patch. :^)
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-25Services: Use new global variables at /sys/kernel/ directoryLiav A
2022-10-17SpiceAgent: Add unveil call on the /proc/all node pathLiav A
This is needed later in the program when doing unveil on the path of "/tmp/session/%sid/portal/clipboard", because %sid is translated to the root session ID which therefore relies on access to the /proc/all node.
2022-10-15NetworkSettings+SpiceAgent: Update and add required unveil pathsne0ndrag0n
2022-09-18Everywhere: Fix order of includes and #pragma onceBen Wiederhake
2022-08-14LibCore+LibIPC: Recognise %uid in pathLucas CHOLLET
This patch allows to insert "%uid" in `IPC_CLIENT_CONNECTION` declaration and in SystemServer's ini files. This pattern is replaced then replaced by the UID of the owner of the service. It opens a path for seamlessly managed, per-user portal.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-04-03Services: Use default execpromises parameter to `pledge(..)`Brian Gianforcaro
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-25SpiceAgent: Rename ClipboardServerConnectionItamar
Rename ClipboardServerConnection=>ConnectionToClipboardServer. This was done with CLion's automatic rename feature.
2022-02-25Userland: Rename IPC::ServerConnection=>IPC::ConnectionToServerItamar
This was done with CLion's automatic rename feature.
2022-01-24Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOrSam Atkins
Apologies for the enormous commit, but I don't see a way to split this up nicely. In the vast majority of cases it's a simple change. A few extra places can use TRY instead of manual error checking though. :^)
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2021-11-28SpiceAgent: Port to LibMain :^)Andreas Kling
2021-11-21LibGfx: Make ImageDecoderPlugin::frame() return ErrorOr<>Andreas Kling
This is a first step towards better error propagation from image codecs.