summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Conway: Add interactivityBen Wiederhake
2021-01-22LibGfx: Add a draw_scaled_bitmap() variant that takes a FloatRect as src_rectNico Weber
Consider draw_scaled_bitmap({0, 0, 10, 10}, source, {0, 0, 5, 5}). Imagine wanting to split that up into two calls, like e.g. the compositor when redrawing the background with damage rects. You really want to be able to say draw_scaled_bitmap({0, 0, 5, 10}, source, {0, 0, 2.5, 5}) but up to now you couldn't. Now you can. This makes painting very low-res images (such as tile.png) in mode "stretch" work much better.
2021-01-22LibGfx: Allow comparing Points, Sizes, and Rects of different typeNico Weber
2021-01-22Libraries: Add missing headersBen Wiederhake
A C++ source file containing just #include <LibFoo/Bar.h> should always compile cleanly. This patch adds missing header inclusions that could have caused weird error messages if they were used in a different context. Also, this confused QtCreator.
2021-01-22LibGUI: Resolve cyclic inclusionBen Wiederhake
Application.h includes Widget.h which includes Application.h. I'm not entirely sure what the semantics are in this case, but avoiding this seems to be the safer approach. In this case, Widget does not actually use Application, so let's just remove the unused include.
2021-01-22LibCrypto: Make PEM.h able to stand aloneBen Wiederhake
These headers should probably all be converted into proper functions of LibCrypto, especially since we have shared objects.
2021-01-22PixelPaint: adding an option to export as PNGPierre
2021-01-22LibGfx: adding a very simple PNG writerPierre
With this patch it is possible to create PNG files. Only minimal options are supported. The PNG is created with one big IDAT chunk containing only non-compressible DEFLATE blocks.
2021-01-22LibGfx: Implement scaling support for draw_tiled_bitmap()Nico Weber
Closes #5017.
2021-01-22su: Drop "id" pledge after switching userAndreas Kling
2021-01-22passwd: Drop "rpath" pledge after opening filesAndreas Kling
We needed this for mkstemp() since it used lstat() internally. Now that it only uses open(), we don't need to pledge "rpath".
2021-01-22LibC: Templatize unique filename enumeration for mkstemp() et alAndreas Kling
This allows us to implement mkstemp() with open() directly, instead of first lstat()'ing, and then open()'ing the filename. Also implement tmpfile() in terms of mkstemp() instead of mktemp().
2021-01-22Kernel+Userland: Remove "dns" pledge promise aliasAndreas Kling
This was just an alias for "unix" that I added early on back when there was some belief that we might be compatible with OpenBSD. We're clearly never going to be compatible with their pledges so just drop the alias.
2021-01-22Everywhere: Fix typosLinus Groh
2021-01-22Calculator: Give the '9' button a blue foreground color as wellLinus Groh
2021-01-22Meta: Get building on NixOS (#5005)Jonathan Turner
2021-01-22LibGfx: Implement blit_offset() in terms of blit()Nico Weber
It's less code, and blit() already handles scaled painters. Fixes the window server asserting in highdpi mode with a centered background image. Part of #5017.
2021-01-22LibDebug: Don't assert when running on non-existent executableMaciej Zygmanowski
2021-01-22LibGfx: Remove Painter::blit_scaled() in favor of Painter::draw_scaled_bitmap()Nico Weber
draw_scaled_bitmap() has a clearer API (just source and dest rects -- blit_scaled() took those and scale factors and then ignored width and height on the source rect and it was less clear what it was supposed to do), and they do mostly the same thing. The draw_scaled_bitmap() API takes an IntRect as source rect, so it's currently not always possible to split a big draw_scaled_bitmap() into two (or more) smaller draw_scaled_bitmap() calls that do the same thing -- that'd require FloatRects. The compositor kind of wants this to be possible, but there's already a FIXME about this not looking quite right with the previous approach either. draw_scaled_bitmap() handles transparent sources, so after this change wallpapers with transparency will be blended instead of copied. But that seems fine, and if not, the Right Fix for that is to remove the alpha channel from wallpapers after loading them anyways. As an added bonus, draw_scaled_bitmap() already handles display scale, so this fixes window server asserts for background images that are shown as "stretch" (#5017). The window server still asserts for "tile" and "offset" for now though. Calling draw_scaled_bitmap() here exposed a bug in it fixed by #5041. Before that is merged, this change here will cause smearing on the background image when moving windows around.
2021-01-22LibGfx: Correctly handle source rect offset in draw_scaled_bitmapNico Weber
The do_draw_integer_scaled_bitmap() fastpath already handled this correctly, but the arbitrary scale path did not.
2021-01-22LibGfx: Compute hscale/vscale inside do_draw_scaled_bitmap instead of ↵Nico Weber
passing it in They're both read only inside do_draw_scaled_bitmap(), so there's no point in computing them earlier. No behavior change.
2021-01-22Build: Replace explicit use of mv(1) in CMake file with file(RENAME).Emanuele Torre
Also fix code style: `else ()` -> `else()`.
2021-01-22Meta: Fix silly copyright lineBen Wiederhake
2021-01-22LibPthread: Fix asserting futex return valueTom
FUTEX_WAIT returns the number of threads woken (if any). Fixes #5032
2021-01-22passwd: Remove duplicate 'wpath' pledgeDoctor5555
2021-01-21LibCore: Always fail Account authentication on missing shadow entryAndreas Kling
If a user is missing from /etc/shadow, we used to just allow anyone to authenticate as that user without a password. With this patch, authentication will instead always fail.
2021-01-21LibCore+su+passwd: Don't keep /etc/passwd and /etc/shadow openAndreas Kling
Now that we've moved to atomic replacement of these files when altering them, we don't need to keep them open for the lifetime of Core::Account so just simplify this and close them when they are not needed.
2021-01-21passwd+LibCore: Make passwd replace /etc files atomicallyAndreas Kling
Before this patch, we had a nasty race condition when changing a user's password: there was a time window between truncating /etc/shadow and writing out its new contents, where you could simply "su" to root without using a password. Instead of writing directly to /etc/passwd and /etc/shadow, we now create temporary files in /etc and fill them with the new contents. Those files are then atomically renamed to /etc/passwd and /etc/shadow. Sadly, fixing this race requires giving the passwd program a lot more privileges. This is something we can and should improve upon. :^)
2021-01-20oss-fuzz: Try harder to fix buildNico Weber
Apparently memfd_create() is newish in glibc, and oss-fuzz uses Ubuntu 16.04 as base for its docker images, which doens't yet have memfd_create(). But, not to worry, it does have the syscall define and that's all we really need :/
2021-01-20Kernel+LibC: Turn errno codes into a strongly typed enumAndreas Kling
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
2021-01-20LibGfx/Painter: Keep translation and clip_rect in logical coordinatesNico Weber
Moves Painter away from general affine transport support a bit, but this scale factor business does feel like it's a bit different. This is conceptually cleaner (everything should use logical coordinates as much as possible), and it means the code in GUI::Painter() will work without changes due to that, but the draw function implementations overall get a bit murkier (draw_rect() becomes nicer though). Still, feels like the right direction. No behavior change.
2021-01-20CrashReporter: Show pledge violation in backtraceLinus Groh
2021-01-20Kernel: Set "pledge_violation" coredump metadata in REQUIRE_PROMISE()Linus Groh
Similar to LibC storing an assertion message before aborting, process death by pledge violation now sets a "pledge_violation" key with the respective pledge name as value in its coredump metadata, which the CrashReporter will then show.
2021-01-20Revert "LibCore: Try to fix fuzzer build"Nico Weber
This reverts commit c5709c0aed02cf7c7c5cda914d9794ac5cab55e7.
2021-01-20LibJS: Include <typeinfo> in AST.cppNico Weber
Without this, the oss-fuzz build says: ../Userland/Libraries/LibJS/AST.cpp:58:34: error: member access into incomplete type 'const std::type_info' return demangle(typeid(*this).name()).substring(4); ^
2021-01-20Userland: Implement shuf for basic shufflingBen Wiederhake
2021-01-20Userland: Fix broken newlines in 'sort'Ben Wiederhake
2021-01-20LibC: Implement uniform random sampling without modulo biasBen Wiederhake
2021-01-20Conway: Don't run misleading srand()Ben Wiederhake
The randomness is taken from arc4random() which is independent from srand/rand/rand_r, so there's no need to call srand(). At best, it confuses the reader to think that there would eventually be a call to rand().