summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-01-12LibGfx: Make it possible to apply an (integer) scale to a PainterNico Weber
This adds a scale factor to Painter, which will be used for HighDPI support. It's also a step towards general affine transforms on Painters. All of Painter's public API takes logical coordinates, while some internals deal with physical coordinates now. If scale == 1, logical and physical coordinates are the same. For scale == 2, a 200x100 bitmap would be covered by a logical {0, 0, 100, 50} rect, while its physical size would be {0, 0, 200, 100}. Most of Painter's functions just assert that scale() == 1 is for now, but most functions called by WindowServer are updated to handle arbitrary (integer) scale. Also add a new Demo "LibGfxScaleDemo" that covers the converted functions and that can be used to iteratively add scaling support to more functions. To make Painter's interface deal with logical coordinates only, make translation() and clip_rect() non-public.
2021-01-12LibGfx: Make Painter::draw_pixel() with thickness = 1 work with RGBALinus Groh
The underlying fill_rect() works correctly, but the special case for thickness = 1 was not blending the new color with the target pixel's color, causing RGBA colors to be painted as their RGB counterpart.
2021-01-12Shell: Use lstat instead of access to check if glob target existsAnotherTest
Fixes #4905
2021-01-12LibCore: Don't create an RPC server when built for lagomAnotherTest
There's no reason to have this, and it will most likely fail anyway (since there's likely no /tmp/rpc).
2021-01-12LibPthread: Add pthread_equal()Andreas Kling
2021-01-12LibPthread: Stub pthread_setcancelstate() and pthread_setcanceltype()Andreas Kling
2021-01-12Libraries: Remove LibUnwindAndreas Kling
This was not used for anything.
2021-01-12HexEditor: Hide unnecessary scrollbars in the main file viewAndreas Kling
2021-01-12Demos: Remove HelloWorld demoAndreas Kling
2021-01-12Services: Move to Userland/Services/Andreas Kling
2021-01-12DevTools: Move to Userland/DevTools/Andreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling
2021-01-12Applications: Move to Userland/Applications/Andreas Kling
2021-01-12Games: Move to Userland/Games/Andreas Kling
2021-01-12MenuApplets: Move to Userland/MenuApplets/Andreas Kling
2021-01-12Demos: Move to Userland/Demos/Andreas Kling
2021-01-12Userland: Move command-line utilities to Userland/Utilities/Andreas Kling
2021-01-12Shell: Move to Userland/Shell/Andreas Kling
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2021-01-12wc: Remove a memory leak.Emanuele Torre
2021-01-12wc: printf(), fprintf(stderr, ...) -> out(), outln(), warnln().Emanuele Torre
Problem: - We were using some incorrect format strings in printf-functions: * "%7lu" to print `size_t` values instead of "%7zu"; * "%7i" to print `unsigned int` values instead of "%7u". Solution: - Use out(), outln() and warnln() instead of printf-functions. :^)
2021-01-12wc: Fix code style.Emanuele Torre
`unsigned int` -> `unsigned`. Use brace initialisers instead of equal initialisers for struct members. Prefix global variables with `g_`. Wrap multi-line statements in curly braces. Also: Use const references instead of references when possible. Rename `file_name` to `file_specifier`: "-" is not a file name. Rename `files` to `file_specifiers`. Avoid some useless checks.
2021-01-12userdel: Use pledge() and unveil()Brendan Coles
2021-01-12useradd: Use pledge()Brendan Coles
2021-01-11strace: Use pledge()Andreas Kling
2021-01-11Kernel: Add dedicated "ptrace" pledge promiseAndreas Kling
The vast majority of programs don't ever need to use sys$ptrace(), and it seems like a high-value system call to prevent a compromised process from using. This patch moves sys$ptrace() from the "proc" promise to its own, new "ptrace" promise and updates the affected apps.
2021-01-11Everywhere: Fix incorrect uses of String::format and StringBuilder::appendfSahan Fernando
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-10AK: Make MappedFile heap-allocated and ref-countedAndreas Kling
Let's adapt this class a bit better to how it's actually being used. Instead of having valid/invalid states and storing an error in case it's invalid, a MappedFile is now always valid, and the factory function that creates it will return an OSError if mapping fails.
2021-01-10LibCore: Use OSError in get_password() return typeAndreas Kling
2021-01-10Everywhere: Convert a bunch of dbgprintf() to dbgln()Andreas Kling
2021-01-09passwd: Drop "tty" pledge promise after getting password from userAndreas Kling
This leaves us with a total pledge of "stdio" when writing to /etc/passwd and /etc/shadow which is kinda neat. :^)
2021-01-09su: Drop "tty" pledge promise after getting password from userAndreas Kling
There's not much work left to do at this point, but let's be strict.
2021-01-09passwd+su: Convert fprintf(stderr, ...) to warnln()Andreas Kling
2021-01-09Everywhere: 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.Everything: The modifications in this commit were automatically made using the following command: find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-09Everywhere: 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-09su+passwd: Don't copy Core::Account unnecessarilyAndreas Kling
2021-01-09su: Use pledge() :^)Andreas Kling
Not sure why we hadn't done this one sooner, seems like a high-value program to pledge.
2021-01-09passwd: Drop privileges after opening files for writingAndreas Kling
Once we have /etc/passwd and /etc/shadow open for writing, there's no need for passwd to continue running as root. We can also drop a bunch of pledge promises, further tightening things.
2021-01-09LibCore+passwd+su+Base: Add /etc/shadow to hide hashes from users :^)Andreas Kling
This patch moves the user account password hashes from /etc/passwd, where they were world-readable, to /etc/shadow, where only root can access them. The Core::Account class is extended to support both authentication against, and modification of /etc/shadow. The default password for "anon" as of this commit is "foo" :^)
2021-01-09Loader.so+LibELF: Do not read environment variables if AT_SECURE is setItamar
AT_SECURE is set in the auxiliary vector when we execute setuid/setgid programs. In those cases, we do not want to read environment variables that influence the logic of the dynamic loader, as they can be controlled by the user.
2021-01-09LibDebug: Support shared librariesItamar
DebugSession now makes the loader stop after loading the libraries, and parses the loaded libraries of the program before continuing its execution. DebugSession now also supports inserting a breakpoint at a given symbol or source position. Additionally, DebugInfo now takes the base address of its object into consideration.
2021-01-08Userland: Add ddate utilityBrendan Coles
Today is Boomtime, day 7 of Chaos, in the YOLD 3187
2021-01-07date: Use ArgsParser and add ISO8601 / RFC3339 / RFC5322 output formatsBrendan Coles
2021-01-07Userland: Rename cp's "-r" flag to "-R"Nico Weber
Linux accepts both -r and -R, but the BSDs only like -R, and dR POSIX also only mentions -R. So make -R the canonical flag. Keep -r available as an alias for -R.
2021-01-07Userland: Give cp a "-l" flag to make hard linksNico Weber
Also present on Linux and FreeBSD.
2021-01-07Userland: Include hard link count in "ls -l" outputNico Weber
2021-01-04Everywhere: Use GUI::CommonActions::make_about_action()Andreas Kling
2021-01-04crash: Remove -x and -y which do not crash (write to / read from freed memory)Linus Groh
These do not crash the process anymore. Fixes #4685.
2021-01-03LibCore: Report error condition when reading process statistics failedTom
2021-01-03Userland: Add gml-formatLinus Groh
TL;DR: Like clang-format but for GML files :^) It takes a list of files (or reads from standard input if none is given), formats them and prints the result to standard output or writes back to the file when using the -i/--inplace option.